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
- OrCondition.cs
- odbcmetadatafactory.cs
- DbFunctionCommandTree.cs
- ImageIndexConverter.cs
- Rotation3DAnimation.cs
- ServiceHostingEnvironment.cs
- MediaTimeline.cs
- PermissionSet.cs
- WinInetCache.cs
- UnknownWrapper.cs
- NullRuntimeConfig.cs
- DataPagerField.cs
- Atom10FormatterFactory.cs
- TypeKeyValue.cs
- RepeaterItemEventArgs.cs
- SubtreeProcessor.cs
- ColumnReorderedEventArgs.cs
- ConstructorNeedsTagAttribute.cs
- MetaModel.cs
- DataKey.cs
- HttpDebugHandler.cs
- DataBindEngine.cs
- XamlVector3DCollectionSerializer.cs
- RangeValidator.cs
- ModelTreeEnumerator.cs
- XmlSerializableWriter.cs
- SuppressMessageAttribute.cs
- EmptyCollection.cs
- DependencyPropertyValueSerializer.cs
- SelectionItemPattern.cs
- RawStylusActions.cs
- XmlDataSourceNodeDescriptor.cs
- WinFormsSpinner.cs
- ErrorWebPart.cs
- HttpStreams.cs
- ConfigurationSectionGroupCollection.cs
- HtmlImage.cs
- ProfileGroupSettingsCollection.cs
- ResourceExpressionBuilder.cs
- infer.cs
- BuildResult.cs
- TraceContextEventArgs.cs
- DivideByZeroException.cs
- StateMachineWorkflowDesigner.cs
- ApplyHostConfigurationBehavior.cs
- Utils.cs
- IntSecurity.cs
- ScrollItemProviderWrapper.cs
- TypeUtil.cs
- userdatakeys.cs
- Brush.cs
- PreparingEnlistment.cs
- MonitorWrapper.cs
- SinglePhaseEnlistment.cs
- Subset.cs
- FormattedText.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- ReadOnlyDataSource.cs
- StringWriter.cs
- WindowsGraphicsWrapper.cs
- WindowsScroll.cs
- CharacterBufferReference.cs
- ListDictionaryInternal.cs
- SQLRoleProvider.cs
- TraceFilter.cs
- StatusBarPanelClickEvent.cs
- XPathParser.cs
- Lookup.cs
- ComponentEditorForm.cs
- Dynamic.cs
- ExpressionBuilderContext.cs
- followingsibling.cs
- Label.cs
- ValidatorCompatibilityHelper.cs
- MsmqAuthenticationMode.cs
- ProfileParameter.cs
- AccessDataSourceView.cs
- ClientBuildManager.cs
- Mutex.cs
- OperationAbortedException.cs
- PerspectiveCamera.cs
- BamlWriter.cs
- FontConverter.cs
- ActivityValidator.cs
- IdentityManager.cs
- GlyphRunDrawing.cs
- RectAnimationBase.cs
- NullableLongSumAggregationOperator.cs
- ConnectionConsumerAttribute.cs
- AuthenticationModulesSection.cs
- XmlNodeChangedEventArgs.cs
- SByteStorage.cs
- TextPattern.cs
- Table.cs
- CommandManager.cs
- TransferRequestHandler.cs
- XmlArrayItemAttribute.cs
- IsolatedStorageFileStream.cs
- XmlDataSource.cs
- CodeDefaultValueExpression.cs