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
- SQLConvert.cs
- XsdBuilder.cs
- Menu.cs
- WaitForChangedResult.cs
- VirtualPathExtension.cs
- Barrier.cs
- WebFaultClientMessageInspector.cs
- GenericEnumerator.cs
- TransformDescriptor.cs
- ObjectNavigationPropertyMapping.cs
- Currency.cs
- XhtmlBasicCommandAdapter.cs
- XmlCodeExporter.cs
- Matrix3DStack.cs
- ForEach.cs
- AttributeXamlType.cs
- StrongNamePublicKeyBlob.cs
- MarkupCompiler.cs
- SystemFonts.cs
- DataGridViewColumnEventArgs.cs
- HtmlInputCheckBox.cs
- RbTree.cs
- DataColumnChangeEvent.cs
- StandardCommands.cs
- WebPartZone.cs
- FormParameter.cs
- embossbitmapeffect.cs
- ControlLocalizer.cs
- Contracts.cs
- QilDataSource.cs
- NullableLongMinMaxAggregationOperator.cs
- DictionarySectionHandler.cs
- TitleStyle.cs
- ExpressionParser.cs
- CopyCodeAction.cs
- RunWorkerCompletedEventArgs.cs
- ServiceThrottlingBehavior.cs
- StatusStrip.cs
- TileBrush.cs
- FlowDocument.cs
- TransportManager.cs
- GridItemPatternIdentifiers.cs
- SocketElement.cs
- BrowserCapabilitiesCodeGenerator.cs
- QueryableDataSourceView.cs
- HtmlInputImage.cs
- Substitution.cs
- IssuedTokenParametersEndpointAddressElement.cs
- XPathAncestorQuery.cs
- ComponentManagerBroker.cs
- ResXResourceSet.cs
- RoutedEventArgs.cs
- XmlQueryOutput.cs
- BitmapCodecInfoInternal.cs
- HandoffBehavior.cs
- DeferredTextReference.cs
- UrlMappingsSection.cs
- XmlWriter.cs
- sqlpipe.cs
- XsdBuilder.cs
- InvalidPrinterException.cs
- ToolStripContextMenu.cs
- SerializationException.cs
- HttpModuleCollection.cs
- RegexRunner.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- Stack.cs
- PointCollectionValueSerializer.cs
- SafeMarshalContext.cs
- PropertyInformation.cs
- TcpChannelListener.cs
- HttpResponseWrapper.cs
- ActivityStatusChangeEventArgs.cs
- Propagator.Evaluator.cs
- RSAProtectedConfigurationProvider.cs
- RtfControls.cs
- ProtocolReflector.cs
- EdmEntityTypeAttribute.cs
- HttpPostedFile.cs
- CompilerGeneratedAttribute.cs
- ProxyWebPart.cs
- MultiView.cs
- PropertyNames.cs
- _SecureChannel.cs
- DragEvent.cs
- EventLogTraceListener.cs
- RuleInfoComparer.cs
- DependencyPropertyChangedEventArgs.cs
- RoutedEvent.cs
- _IPv4Address.cs
- StatusBarPanel.cs
- ServiceParser.cs
- PathFigureCollectionValueSerializer.cs
- CompositeControl.cs
- Ref.cs
- WasEndpointConfigContainer.cs
- SizeFConverter.cs
- ListViewDeleteEventArgs.cs
- CodeTypeParameterCollection.cs
- ExclusiveTcpListener.cs