Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / IdentityModel / System / IdentityModel / Tokens / SamlDoNotCacheCondition.cs / 1 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- UseLicense.cs
- hresults.cs
- behaviorssection.cs
- ActionMismatchAddressingException.cs
- TlsSspiNegotiation.cs
- PathFigure.cs
- Registry.cs
- ToolStripHighContrastRenderer.cs
- CommandSet.cs
- LoginUtil.cs
- DbConnectionFactory.cs
- UnsafeNativeMethods.cs
- SmtpClient.cs
- GraphicsContainer.cs
- AsyncPostBackTrigger.cs
- MemberHolder.cs
- SmtpNetworkElement.cs
- PathSegment.cs
- MetadataSerializer.cs
- DnsPermission.cs
- RadialGradientBrush.cs
- EmptyStringExpandableObjectConverter.cs
- NetSectionGroup.cs
- TableLayoutColumnStyleCollection.cs
- Matrix.cs
- ChildrenQuery.cs
- PrivilegedConfigurationManager.cs
- InputQueueChannel.cs
- SID.cs
- Win32SafeHandles.cs
- OdbcDataAdapter.cs
- XmlTextReaderImpl.cs
- AssociatedControlConverter.cs
- DBAsyncResult.cs
- SHA512.cs
- OrderingInfo.cs
- ProcessModuleCollection.cs
- InvokeMethodActivity.cs
- FixedTextView.cs
- XmlSchemaAttributeGroupRef.cs
- WaitForChangedResult.cs
- EncryptedPackageFilter.cs
- RemoteAsymmetricSignatureFormatter.cs
- NotifyInputEventArgs.cs
- RandomNumberGenerator.cs
- HeaderLabel.cs
- PropertyOverridesDialog.cs
- TextSpan.cs
- CursorConverter.cs
- BitStream.cs
- DataControlFieldCollection.cs
- DSASignatureDeformatter.cs
- PrincipalPermission.cs
- DirectoryObjectSecurity.cs
- DesignerLinkAdapter.cs
- CfgSemanticTag.cs
- IntSecurity.cs
- TableCellsCollectionEditor.cs
- TaskFactory.cs
- PriorityQueue.cs
- DockPanel.cs
- ProfileSettingsCollection.cs
- Psha1DerivedKeyGenerator.cs
- EpmAttributeNameBuilder.cs
- cryptoapiTransform.cs
- GridItem.cs
- InfoCardClaimCollection.cs
- Ops.cs
- SpellCheck.cs
- followingquery.cs
- TextEffectResolver.cs
- Nodes.cs
- DataServiceHost.cs
- WmfPlaceableFileHeader.cs
- ColorInterpolationModeValidation.cs
- UIElementParaClient.cs
- UrlAuthFailedErrorFormatter.cs
- TriState.cs
- MatrixTransform.cs
- FormViewDeleteEventArgs.cs
- DuplexSecurityProtocolFactory.cs
- RijndaelManaged.cs
- WriteStateInfoBase.cs
- SvcMapFileSerializer.cs
- DesignTimeParseData.cs
- DataControlPagerLinkButton.cs
- GenericTypeParameterConverter.cs
- DefaultAssemblyResolver.cs
- StatusBar.cs
- SafeUserTokenHandle.cs
- MemoryRecordBuffer.cs
- EdmValidator.cs
- SecureEnvironment.cs
- RotateTransform3D.cs
- CodeDirectoryCompiler.cs
- UIPermission.cs
- ExpressionBuilderContext.cs
- VectorCollectionValueSerializer.cs
- ConfigXmlAttribute.cs
- TrackingMemoryStreamFactory.cs