Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / IdentityModel / System / IdentityModel / Tokens / SamlDoNotCacheCondition.cs / 1305376 / SamlDoNotCacheCondition.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Tokens { using System.Xml; using System.IdentityModel.Selectors; public class SamlDoNotCacheCondition : SamlCondition { bool isReadOnly = false; public SamlDoNotCacheCondition() { } public override bool IsReadOnly { get { return this.isReadOnly; } } public override void MakeReadOnly() { this.isReadOnly = true; } public override void ReadXml(XmlDictionaryReader reader, SamlSerializer samlSerializer, SecurityTokenSerializer keyInfoSerializer, SecurityTokenResolver outOfBandTokenResolver) { if (reader == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("reader")); if (samlSerializer == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("samlSerializer")); #pragma warning suppress 56506 // samlSerializer.DictionaryManager is never null. SamlDictionary dictionary = samlSerializer.DictionaryManager.SamlDictionary; if (!reader.IsStartElement(dictionary.DoNotCacheCondition, dictionary.Namespace)) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenException(SR.GetString(SR.SAMLBadSchema, dictionary.DoNotCacheCondition.Value))); // saml:DoNotCacheCondition is a empty element. So just issue a read for // the empty element. if (reader.IsEmptyElement) { reader.MoveToContent(); reader.Read(); return; } reader.MoveToContent(); reader.Read(); reader.ReadEndElement(); } public override void WriteXml(XmlDictionaryWriter writer, SamlSerializer samlSerializer, SecurityTokenSerializer keyInfoSerializer) { if (writer == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("writer")); if (samlSerializer == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("samlSerializer")); #pragma warning suppress 56506 // samlSerializer.DictionaryManager is never null. SamlDictionary dictionary = samlSerializer.DictionaryManager.SamlDictionary; writer.WriteStartElement(dictionary.PreferredPrefix.Value, dictionary.DoNotCacheCondition, dictionary.Namespace); writer.WriteEndElement(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Tokens { using System.Xml; using System.IdentityModel.Selectors; public class SamlDoNotCacheCondition : SamlCondition { bool isReadOnly = false; public SamlDoNotCacheCondition() { } public override bool IsReadOnly { get { return this.isReadOnly; } } public override void MakeReadOnly() { this.isReadOnly = true; } public override void ReadXml(XmlDictionaryReader reader, SamlSerializer samlSerializer, SecurityTokenSerializer keyInfoSerializer, SecurityTokenResolver outOfBandTokenResolver) { if (reader == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("reader")); if (samlSerializer == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("samlSerializer")); #pragma warning suppress 56506 // samlSerializer.DictionaryManager is never null. SamlDictionary dictionary = samlSerializer.DictionaryManager.SamlDictionary; if (!reader.IsStartElement(dictionary.DoNotCacheCondition, dictionary.Namespace)) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenException(SR.GetString(SR.SAMLBadSchema, dictionary.DoNotCacheCondition.Value))); // saml:DoNotCacheCondition is a empty element. So just issue a read for // the empty element. if (reader.IsEmptyElement) { reader.MoveToContent(); reader.Read(); return; } reader.MoveToContent(); reader.Read(); reader.ReadEndElement(); } public override void WriteXml(XmlDictionaryWriter writer, SamlSerializer samlSerializer, SecurityTokenSerializer keyInfoSerializer) { if (writer == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("writer")); if (samlSerializer == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("samlSerializer")); #pragma warning suppress 56506 // samlSerializer.DictionaryManager is never null. SamlDictionary dictionary = samlSerializer.DictionaryManager.SamlDictionary; writer.WriteStartElement(dictionary.PreferredPrefix.Value, dictionary.DoNotCacheCondition, dictionary.Namespace); writer.WriteEndElement(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TimerElapsedEvenArgs.cs
- EventLogLink.cs
- ServiceTimeoutsBehavior.cs
- CuspData.cs
- AttachedPropertyMethodSelector.cs
- CustomAttributeFormatException.cs
- CrossAppDomainChannel.cs
- HexParser.cs
- Module.cs
- StrongNameUtility.cs
- EndSelectCardRequest.cs
- SqlBuffer.cs
- ControlBindingsCollection.cs
- ListViewDesigner.cs
- SwitchDesigner.xaml.cs
- StrokeCollectionDefaultValueFactory.cs
- NullRuntimeConfig.cs
- ExpressionBuilder.cs
- DataGridViewRowCancelEventArgs.cs
- WebPartDisplayModeCollection.cs
- StyleModeStack.cs
- HttpContext.cs
- AccessibilityHelperForXpWin2k3.cs
- TogglePatternIdentifiers.cs
- XhtmlConformanceSection.cs
- XmlText.cs
- XmlSignatureProperties.cs
- nulltextnavigator.cs
- FixedFlowMap.cs
- Vector3DIndependentAnimationStorage.cs
- Dynamic.cs
- DesignTimeParseData.cs
- ExtendedProtectionPolicy.cs
- DefaultValueTypeConverter.cs
- FontEmbeddingManager.cs
- LineSegment.cs
- ProviderConnectionPointCollection.cs
- DataGridViewSortCompareEventArgs.cs
- SchemaInfo.cs
- UIElementParaClient.cs
- DictionaryBase.cs
- WindowsFormsSectionHandler.cs
- InvalidCommandTreeException.cs
- XmlNamedNodeMap.cs
- SessionState.cs
- ConstructorArgumentAttribute.cs
- Block.cs
- ChannelCacheDefaults.cs
- AssemblyLoader.cs
- GPPOINT.cs
- EventDescriptor.cs
- WorkflowOperationContext.cs
- GeometryGroup.cs
- QueryCoreOp.cs
- ImagingCache.cs
- SpecialNameAttribute.cs
- SeverityFilter.cs
- IsolatedStorageFileStream.cs
- DrawingServices.cs
- Transform3DGroup.cs
- DataGridViewCellMouseEventArgs.cs
- AccessViolationException.cs
- DragEventArgs.cs
- VariableDesigner.xaml.cs
- XmlTextReaderImpl.cs
- UnionQueryOperator.cs
- PersistChildrenAttribute.cs
- TableRowCollection.cs
- ToolStripSplitStackLayout.cs
- XmlReflectionMember.cs
- CompModSwitches.cs
- SearchExpression.cs
- BinHexDecoder.cs
- WorkflowQueueInfo.cs
- DataTableReaderListener.cs
- AutomationPeer.cs
- ErrorRuntimeConfig.cs
- NameObjectCollectionBase.cs
- RichTextBoxConstants.cs
- InputScopeNameConverter.cs
- TextEndOfLine.cs
- PreviewPrintController.cs
- ApplicationFileCodeDomTreeGenerator.cs
- ScrollViewerAutomationPeer.cs
- UntrustedRecipientException.cs
- XmlAttributeProperties.cs
- ExecutionTracker.cs
- UnionCodeGroup.cs
- StateItem.cs
- DataFormats.cs
- ServiceOperationWrapper.cs
- SchemaMapping.cs
- StringExpressionSet.cs
- Mutex.cs
- MarshalByValueComponent.cs
- HeaderedContentControl.cs
- ResourcePermissionBase.cs
- FileUtil.cs
- Codec.cs
- PeerNearMe.cs