Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CodeNamespaceImport.cs
- Span.cs
- WebPartCancelEventArgs.cs
- BitmapMetadataBlob.cs
- EventSinkActivityDesigner.cs
- ChangeConflicts.cs
- BaseTreeIterator.cs
- WebBrowserEvent.cs
- AssemblyEvidenceFactory.cs
- ScriptRegistrationManager.cs
- AffineTransform3D.cs
- ProcessHostServerConfig.cs
- ExtensibleClassFactory.cs
- CodeAttributeArgumentCollection.cs
- MessageSecurityOverTcpElement.cs
- ToolStripSeparator.cs
- FileAuthorizationModule.cs
- WebReferencesBuildProvider.cs
- BinaryExpression.cs
- TemplateInstanceAttribute.cs
- EdmRelationshipRoleAttribute.cs
- CalendarKeyboardHelper.cs
- TypeForwardedToAttribute.cs
- mongolianshape.cs
- HttpHandlerActionCollection.cs
- MarginCollapsingState.cs
- IncrementalCompileAnalyzer.cs
- ToolStripPanelCell.cs
- PenThread.cs
- UserControl.cs
- SmtpNtlmAuthenticationModule.cs
- Column.cs
- Control.cs
- RemotingSurrogateSelector.cs
- XmlUtil.cs
- PipelineModuleStepContainer.cs
- MenuStrip.cs
- ApplicationServiceHelper.cs
- xdrvalidator.cs
- StrokeCollection2.cs
- RoleGroup.cs
- SimpleType.cs
- ServiceContractGenerator.cs
- WmfPlaceableFileHeader.cs
- TableLayoutPanelDesigner.cs
- TextAnchor.cs
- ResourcesBuildProvider.cs
- ListMarkerSourceInfo.cs
- XmlSchemaChoice.cs
- OLEDB_Enum.cs
- ValidatedMobileControlConverter.cs
- Content.cs
- NumberSubstitution.cs
- HttpCachePolicy.cs
- WorkflowWebService.cs
- AppDomainAttributes.cs
- NetSectionGroup.cs
- EntityFrameworkVersions.cs
- Thumb.cs
- CommonXSendMessage.cs
- KeyValueConfigurationElement.cs
- GetReadStreamResult.cs
- ServicesUtilities.cs
- SqlDependency.cs
- Propagator.JoinPropagator.SubstitutingCloneVisitor.cs
- TextDpi.cs
- followingquery.cs
- PeerNameRecordCollection.cs
- SerializationException.cs
- JulianCalendar.cs
- RunWorkerCompletedEventArgs.cs
- RemotingSurrogateSelector.cs
- PingOptions.cs
- Floater.cs
- SiteMapHierarchicalDataSourceView.cs
- UriExt.cs
- StrokeNode.cs
- SimplePropertyEntry.cs
- MapPathBasedVirtualPathProvider.cs
- Schema.cs
- PropertyValueUIItem.cs
- KerberosSecurityTokenAuthenticator.cs
- StateRuntime.cs
- RuleRefElement.cs
- ToolStripDropDownButton.cs
- LayoutInformation.cs
- CollectionType.cs
- NumericExpr.cs
- Tuple.cs
- CodeComment.cs
- DataGrid.cs
- RedBlackList.cs
- CodeDefaultValueExpression.cs
- QueryCacheEntry.cs
- ThrowHelper.cs
- SmtpNetworkElement.cs
- ParenthesizePropertyNameAttribute.cs
- COSERVERINFO.cs
- XmlComplianceUtil.cs
- IRCollection.cs