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
- NullEntityWrapper.cs
- ZoneButton.cs
- SqlConnectionFactory.cs
- InternalConfigRoot.cs
- xmlNames.cs
- XslVisitor.cs
- ClientRolePrincipal.cs
- InkSerializer.cs
- InstalledVoice.cs
- HtmlTableCell.cs
- IntPtr.cs
- WCFServiceClientProxyGenerator.cs
- BatchServiceHost.cs
- ListenerSingletonConnectionReader.cs
- UndirectedGraph.cs
- TextTreeFixupNode.cs
- OleDbReferenceCollection.cs
- CodeDirectionExpression.cs
- ToolStripDesignerAvailabilityAttribute.cs
- RegexStringValidator.cs
- OutputCache.cs
- FixedSchema.cs
- TextViewBase.cs
- ClientRuntimeConfig.cs
- BinarySecretSecurityToken.cs
- PropertyFilterAttribute.cs
- XmlSerializerImportOptions.cs
- IPGlobalProperties.cs
- ReflectionPermission.cs
- WindowsSidIdentity.cs
- CachedPathData.cs
- RewritingValidator.cs
- GridItemPatternIdentifiers.cs
- MSAAEventDispatcher.cs
- DataStorage.cs
- CollectionCodeDomSerializer.cs
- RootContext.cs
- RuntimeEnvironment.cs
- OrCondition.cs
- XmlSchemaSimpleTypeUnion.cs
- EventItfInfo.cs
- SqlException.cs
- XmlAutoDetectWriter.cs
- XmlNamedNodeMap.cs
- DragEvent.cs
- HashUtility.cs
- AnimatedTypeHelpers.cs
- XPathMultyIterator.cs
- Rights.cs
- FormsAuthenticationTicket.cs
- ModelServiceImpl.cs
- SkinBuilder.cs
- XmlSchemaAttribute.cs
- LogConverter.cs
- TextEditorTables.cs
- DrawToolTipEventArgs.cs
- KeyTimeConverter.cs
- NetCodeGroup.cs
- TextTreeTextNode.cs
- TabItemWrapperAutomationPeer.cs
- MonitoringDescriptionAttribute.cs
- PropVariant.cs
- OdbcConnectionStringbuilder.cs
- GridToolTip.cs
- CriticalFinalizerObject.cs
- StringInfo.cs
- SpecialNameAttribute.cs
- TreeNodeBindingDepthConverter.cs
- CodeTypeParameter.cs
- StrokeDescriptor.cs
- DataServiceQuery.cs
- WindowsStreamSecurityUpgradeProvider.cs
- StringWriter.cs
- ObjectDataSourceFilteringEventArgs.cs
- NaturalLanguageHyphenator.cs
- BinaryWriter.cs
- Aes.cs
- DashStyle.cs
- ApplyTemplatesAction.cs
- AndMessageFilter.cs
- ProcessStartInfo.cs
- ActivatableWorkflowsQueryResult.cs
- DeviceContext2.cs
- CredentialCache.cs
- AssemblyCollection.cs
- InvalidPrinterException.cs
- FlowNode.cs
- MembershipAdapter.cs
- TableLayoutCellPaintEventArgs.cs
- Visual.cs
- ParseNumbers.cs
- ContextStaticAttribute.cs
- filewebresponse.cs
- FormViewDeleteEventArgs.cs
- TextViewSelectionProcessor.cs
- OdbcEnvironmentHandle.cs
- XmlWriter.cs
- DataPointer.cs
- SelectionProviderWrapper.cs
- Brush.cs