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
- UpDownEvent.cs
- WebPartUserCapability.cs
- OleDbRowUpdatedEvent.cs
- XsltLoader.cs
- XdrBuilder.cs
- MsmqIntegrationBindingElement.cs
- RTTypeWrapper.cs
- TableParaClient.cs
- EncoderExceptionFallback.cs
- AnimationLayer.cs
- TreeNodeClickEventArgs.cs
- Inflater.cs
- UnsafeCollabNativeMethods.cs
- WorkflowFileItem.cs
- WebPartDisplayMode.cs
- SafeMILHandle.cs
- ClientTargetSection.cs
- BrushConverter.cs
- Typography.cs
- ImportedPolicyConversionContext.cs
- TreeViewItem.cs
- AlphabetConverter.cs
- XmlReader.cs
- NumericUpDownAcceleration.cs
- RegexCapture.cs
- ExtensionSimplifierMarkupObject.cs
- _KerberosClient.cs
- EncoderExceptionFallback.cs
- RoleManagerModule.cs
- coordinatorscratchpad.cs
- IHttpResponseInternal.cs
- ListBoxChrome.cs
- WindowsAuthenticationModule.cs
- GridProviderWrapper.cs
- Executor.cs
- BinaryObjectInfo.cs
- GeometryHitTestParameters.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- OleDbDataAdapter.cs
- CheckableControlBaseAdapter.cs
- TransactionFilter.cs
- GcSettings.cs
- BufferModesCollection.cs
- EntityCommandDefinition.cs
- _ConnectionGroup.cs
- DocumentGridPage.cs
- MediaPlayerState.cs
- SystemParameters.cs
- DrawTreeNodeEventArgs.cs
- ConfigurationConverterBase.cs
- _RequestCacheProtocol.cs
- DrawingGroupDrawingContext.cs
- _NtlmClient.cs
- returneventsaver.cs
- TraceEventCache.cs
- Scheduler.cs
- EDesignUtil.cs
- CultureInfoConverter.cs
- AndCondition.cs
- DESCryptoServiceProvider.cs
- OwnerDrawPropertyBag.cs
- VectorCollectionConverter.cs
- ListViewEditEventArgs.cs
- MemoryRecordBuffer.cs
- ClientTargetCollection.cs
- Events.cs
- WmlPageAdapter.cs
- AdPostCacheSubstitution.cs
- SoapAttributeOverrides.cs
- MarshalDirectiveException.cs
- TableCellCollection.cs
- DataGridSortCommandEventArgs.cs
- XmlDigitalSignatureProcessor.cs
- WorkflowServiceHostFactory.cs
- tabpagecollectioneditor.cs
- RuleInfoComparer.cs
- RectangleF.cs
- PerfService.cs
- CollectionChangedEventManager.cs
- KeyedHashAlgorithm.cs
- FontWeight.cs
- Selection.cs
- NoneExcludedImageIndexConverter.cs
- ColorInterpolationModeValidation.cs
- TextSelectionProcessor.cs
- XhtmlBasicListAdapter.cs
- IProducerConsumerCollection.cs
- UserControlAutomationPeer.cs
- DataGridViewElement.cs
- BmpBitmapEncoder.cs
- RegexReplacement.cs
- XmlSchemaDatatype.cs
- MessageFilterTable.cs
- PointConverter.cs
- Int32Collection.cs
- SignedInfo.cs
- OleServicesContext.cs
- SmiGettersStream.cs
- PropertyManager.cs
- UpDownBase.cs