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
- DataGridViewControlCollection.cs
- EditableTreeList.cs
- Visitors.cs
- DoubleMinMaxAggregationOperator.cs
- JsonDataContract.cs
- TextTreeFixupNode.cs
- NewItemsContextMenuStrip.cs
- GridViewHeaderRowPresenter.cs
- Clause.cs
- Freezable.cs
- SafeRightsManagementQueryHandle.cs
- PipeException.cs
- BasicBrowserDialog.designer.cs
- EditorZoneBase.cs
- SecUtil.cs
- TemplatePagerField.cs
- SafeHandle.cs
- Ray3DHitTestResult.cs
- AsyncCompletedEventArgs.cs
- GeometryConverter.cs
- MissingMemberException.cs
- ApplicationSecurityInfo.cs
- AvtEvent.cs
- ConnectionAcceptor.cs
- ClassHandlersStore.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- RecognizeCompletedEventArgs.cs
- DocumentCollection.cs
- PartialList.cs
- InternalCache.cs
- __ComObject.cs
- CreateUserWizardStep.cs
- WsdlImporterElement.cs
- TransformGroup.cs
- Roles.cs
- CqlIdentifiers.cs
- LogEntrySerializer.cs
- dtdvalidator.cs
- SqlException.cs
- ObjectDataSourceView.cs
- QualifiedCellIdBoolean.cs
- SafeNativeMethodsCLR.cs
- ExecutionScope.cs
- ListDesigner.cs
- OneWayChannelListener.cs
- ExclusiveTcpTransportManager.cs
- TreeNodeBindingCollection.cs
- HttpFormatExtensions.cs
- COMException.cs
- SqlTriggerContext.cs
- DeploymentExceptionMapper.cs
- SharedStatics.cs
- DtrList.cs
- DBSchemaTable.cs
- RtType.cs
- ColorInterpolationModeValidation.cs
- GroupBox.cs
- OdbcDataAdapter.cs
- BeginStoryboard.cs
- RegexRunner.cs
- Aggregates.cs
- CommonBehaviorsSection.cs
- ReadOnlyDictionary.cs
- _ScatterGatherBuffers.cs
- WebPartRestoreVerb.cs
- NetTcpSecurity.cs
- DetailsViewPageEventArgs.cs
- ReflectionPermission.cs
- ListBindableAttribute.cs
- PathFigureCollectionConverter.cs
- UserControlCodeDomTreeGenerator.cs
- TypedLocationWrapper.cs
- AndCondition.cs
- DesignBindingEditor.cs
- BadImageFormatException.cs
- Window.cs
- PasswordBoxAutomationPeer.cs
- UntypedNullExpression.cs
- WebDisplayNameAttribute.cs
- WebControlParameterProxy.cs
- DesignerActionService.cs
- DemultiplexingClientMessageFormatter.cs
- SystemResourceKey.cs
- ToolBarButtonClickEvent.cs
- HtmlDocument.cs
- Page.cs
- ZoomComboBox.cs
- CustomAttributeBuilder.cs
- StructuralObject.cs
- TableCellAutomationPeer.cs
- XslUrlEditor.cs
- IconConverter.cs
- BitmapCodecInfo.cs
- SettingsAttributes.cs
- DataServiceRequestArgs.cs
- HttpResponse.cs
- RegexTree.cs
- ColumnWidthChangingEvent.cs
- StrokeNodeEnumerator.cs
- ISAPIWorkerRequest.cs