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
- OleDbConnectionInternal.cs
- ConnectionInterfaceCollection.cs
- BinaryFormatterSinks.cs
- CopyOnWriteList.cs
- DecoderFallbackWithFailureFlag.cs
- FixedDocumentSequencePaginator.cs
- TextProviderWrapper.cs
- baseaxisquery.cs
- CultureSpecificCharacterBufferRange.cs
- XmlCharacterData.cs
- UdpDuplexChannel.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- DockPanel.cs
- BindingNavigator.cs
- AttachmentService.cs
- XamlHostingConfiguration.cs
- ScriptReferenceBase.cs
- Facet.cs
- DataSourceBooleanViewSchemaConverter.cs
- Thumb.cs
- CompleteWizardStep.cs
- EndPoint.cs
- BrowserTree.cs
- ResourceCodeDomSerializer.cs
- ShutDownListener.cs
- XmlStreamStore.cs
- UriParserTemplates.cs
- ProcessHostServerConfig.cs
- DrawingContextDrawingContextWalker.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- Vertex.cs
- DataGridViewTextBoxColumn.cs
- InkCanvasSelection.cs
- XmlUtil.cs
- NamedPermissionSet.cs
- AsyncOperationManager.cs
- ParameterCollection.cs
- Variable.cs
- SmiEventSink_Default.cs
- WindowsToolbarAsMenu.cs
- Container.cs
- XPathPatternBuilder.cs
- ProxyFragment.cs
- SafeViewOfFileHandle.cs
- DataGridViewRowCancelEventArgs.cs
- CellConstantDomain.cs
- GeneralTransform.cs
- FSWPathEditor.cs
- CryptoApi.cs
- RightsManagementPermission.cs
- ArgumentValue.cs
- InternalRelationshipCollection.cs
- BaseDataList.cs
- FormsAuthenticationEventArgs.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- ImageSourceTypeConverter.cs
- Zone.cs
- DetailsViewCommandEventArgs.cs
- StringFunctions.cs
- DataGridBeginningEditEventArgs.cs
- DefinitionUpdate.cs
- EncoderNLS.cs
- ReferencedCollectionType.cs
- PasswordBox.cs
- IResourceProvider.cs
- SQLBinary.cs
- GridSplitterAutomationPeer.cs
- ScaleTransform.cs
- HtmlShimManager.cs
- SemanticAnalyzer.cs
- Thumb.cs
- DataTableNewRowEvent.cs
- Debugger.cs
- LogLogRecordEnumerator.cs
- DesignerToolStripControlHost.cs
- AuthenticateEventArgs.cs
- PointAnimationUsingPath.cs
- SafeFileHandle.cs
- OperatingSystem.cs
- SecurityBindingElement.cs
- FixedNode.cs
- MaterialCollection.cs
- CharUnicodeInfo.cs
- XmlElementAttribute.cs
- SharedConnectionWorkflowTransactionService.cs
- AppSettingsExpressionBuilder.cs
- StatusBarItem.cs
- ParserHooks.cs
- HostedElements.cs
- DayRenderEvent.cs
- Panel.cs
- FileUtil.cs
- ConfigurationElement.cs
- ScriptReferenceEventArgs.cs
- TextDocumentView.cs
- updateconfighost.cs
- WizardStepBase.cs
- Parser.cs
- TextElementCollectionHelper.cs
- StoreItemCollection.Loader.cs