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
- TextPenaltyModule.cs
- WindowsListViewGroupHelper.cs
- ServiceDiscoveryBehavior.cs
- HttpTransportElement.cs
- DefaultAssemblyResolver.cs
- contentDescriptor.cs
- AmbientValueAttribute.cs
- SqlDataSourceStatusEventArgs.cs
- SemanticValue.cs
- ShapingEngine.cs
- WindowsListBox.cs
- IncrementalCompileAnalyzer.cs
- XPathSingletonIterator.cs
- Quaternion.cs
- Decimal.cs
- MdImport.cs
- MenuBase.cs
- XmlKeywords.cs
- WebPartDisplayMode.cs
- CharConverter.cs
- SendMailErrorEventArgs.cs
- ToolStripOverflow.cs
- SessionEndedEventArgs.cs
- BinaryWriter.cs
- TcpActivation.cs
- CatalogZone.cs
- CalendarDataBindingHandler.cs
- DecimalFormatter.cs
- ContentOnlyMessage.cs
- ReceiveMessageRecord.cs
- LazyInitializer.cs
- WindowsFormsHostPropertyMap.cs
- NameObjectCollectionBase.cs
- SerializationAttributes.cs
- SpecialNameAttribute.cs
- TransformedBitmap.cs
- CurrencyWrapper.cs
- DispatcherHooks.cs
- SqlReferenceCollection.cs
- ExceptionUtility.cs
- SortedList.cs
- SoapHeaders.cs
- MarkedHighlightComponent.cs
- ProvidePropertyAttribute.cs
- ToolStripSeparator.cs
- ObjectAssociationEndMapping.cs
- GroupQuery.cs
- Literal.cs
- CallbackDebugBehavior.cs
- PaintEvent.cs
- ellipse.cs
- ReturnType.cs
- PropertyExpression.cs
- AssemblyAttributes.cs
- SymLanguageVendor.cs
- StructuralType.cs
- MatcherBuilder.cs
- ObjectViewQueryResultData.cs
- MetabaseServerConfig.cs
- Opcode.cs
- WriteFileContext.cs
- FacetEnabledSchemaElement.cs
- TheQuery.cs
- DataGridGeneralPage.cs
- DateTimeConverter.cs
- GiveFeedbackEvent.cs
- ClientCultureInfo.cs
- _IPv6Address.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- X509CertificateRecipientServiceCredential.cs
- ViewBase.cs
- URLString.cs
- ExpressionList.cs
- InternalResources.cs
- mediapermission.cs
- ConfigXmlWhitespace.cs
- AttributeAction.cs
- SrgsToken.cs
- QualifiedId.cs
- METAHEADER.cs
- TextSegment.cs
- Configuration.cs
- AsyncStreamReader.cs
- ConfigDefinitionUpdates.cs
- VectorAnimationBase.cs
- GridErrorDlg.cs
- ListDictionaryInternal.cs
- MultiTrigger.cs
- NavigationProgressEventArgs.cs
- BinaryMessageFormatter.cs
- TextTreeFixupNode.cs
- SqlTypeSystemProvider.cs
- safemediahandle.cs
- DataKey.cs
- TraceUtils.cs
- TrackingStringDictionary.cs
- ReferentialConstraint.cs
- SizeFConverter.cs
- DatePicker.cs
- XmlRawWriter.cs