Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Security / SecurityTokenParametersEnumerable.cs / 1 / SecurityTokenParametersEnumerable.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Security { using System.Collections.Generic; using System.ServiceModel; using System.ServiceModel.Channels; using System.ServiceModel.Security.Tokens; class SecurityTokenParametersEnumerable : IEnumerable{ SecurityBindingElement sbe; bool clientTokensOnly; public SecurityTokenParametersEnumerable(SecurityBindingElement sbe) : this(sbe, false) { } public SecurityTokenParametersEnumerable(SecurityBindingElement sbe, bool clientTokensOnly) { if (sbe == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("sbe"); this.sbe = sbe; this.clientTokensOnly = clientTokensOnly; } public IEnumerator GetEnumerator() { if (this.sbe is SymmetricSecurityBindingElement) { SymmetricSecurityBindingElement ssbe = (SymmetricSecurityBindingElement)sbe; if (ssbe.ProtectionTokenParameters != null && (!this.clientTokensOnly || !ssbe.ProtectionTokenParameters.HasAsymmetricKey)) yield return ssbe.ProtectionTokenParameters; } else if (this.sbe is AsymmetricSecurityBindingElement) { AsymmetricSecurityBindingElement asbe = (AsymmetricSecurityBindingElement)sbe; if (asbe.InitiatorTokenParameters != null) yield return asbe.InitiatorTokenParameters; if (asbe.RecipientTokenParameters != null && !this.clientTokensOnly) yield return asbe.RecipientTokenParameters; } foreach (SecurityTokenParameters stp in this.sbe.EndpointSupportingTokenParameters.Endorsing) if (stp != null) yield return stp; foreach (SecurityTokenParameters stp in this.sbe.EndpointSupportingTokenParameters.SignedEncrypted) if (stp != null) yield return stp; foreach (SecurityTokenParameters stp in this.sbe.EndpointSupportingTokenParameters.SignedEndorsing) if (stp != null) yield return stp; foreach (SecurityTokenParameters stp in this.sbe.EndpointSupportingTokenParameters.Signed) if (stp != null) yield return stp; foreach (SupportingTokenParameters str in this.sbe.OperationSupportingTokenParameters.Values) if (str != null) { foreach (SecurityTokenParameters stp in str.Endorsing) if (stp != null) yield return stp; foreach (SecurityTokenParameters stp in str.SignedEncrypted) if (stp != null) yield return stp; foreach (SecurityTokenParameters stp in str.SignedEndorsing) if (stp != null) yield return stp; foreach (SecurityTokenParameters stp in str.Signed) if (stp != null) yield return stp; } } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException()); } } } // 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
- XmlILOptimizerVisitor.cs
- UriExt.cs
- SchemaNamespaceManager.cs
- StringResourceManager.cs
- Rijndael.cs
- COM2IDispatchConverter.cs
- XmlTypeMapping.cs
- ValueUtilsSmi.cs
- WsatConfiguration.cs
- FontNamesConverter.cs
- Lasso.cs
- OletxResourceManager.cs
- StorageMappingFragment.cs
- QilTargetType.cs
- DataPagerCommandEventArgs.cs
- RequestCachePolicyConverter.cs
- XmlDownloadManager.cs
- DataStreams.cs
- TableRow.cs
- ListComponentEditor.cs
- RepeatBehaviorConverter.cs
- EntityDataSourceState.cs
- AssociationEndMember.cs
- FontDialog.cs
- Timer.cs
- Exceptions.cs
- SecurityKeyUsage.cs
- TreeView.cs
- DataObjectFieldAttribute.cs
- ProcessExitedException.cs
- DropSource.cs
- errorpatternmatcher.cs
- ISFClipboardData.cs
- IpcClientChannel.cs
- PipeException.cs
- NameValueConfigurationCollection.cs
- IMembershipProvider.cs
- TreeWalkHelper.cs
- Glyph.cs
- TextSpanModifier.cs
- OrderByLifter.cs
- MailAddressCollection.cs
- SelectionListDesigner.cs
- PointAnimationBase.cs
- CommandSet.cs
- RolePrincipal.cs
- Section.cs
- ProcessProtocolHandler.cs
- ISFClipboardData.cs
- SerialPinChanges.cs
- DbParameterCollectionHelper.cs
- NetCodeGroup.cs
- Themes.cs
- Utilities.cs
- CodeAttachEventStatement.cs
- EntityProviderServices.cs
- counter.cs
- KeyFrames.cs
- SqlSelectStatement.cs
- SecondaryViewProvider.cs
- StylusTip.cs
- CodeDefaultValueExpression.cs
- SystemDropShadowChrome.cs
- ClaimSet.cs
- InternalSendMessage.cs
- WizardStepBase.cs
- TraceListeners.cs
- ActivityStateRecord.cs
- ColumnHeaderConverter.cs
- AssemblyBuilder.cs
- ToolStripOverflow.cs
- DBPropSet.cs
- StringExpressionSet.cs
- SchemaCollectionPreprocessor.cs
- List.cs
- StackOverflowException.cs
- Listbox.cs
- XmlSchemaDatatype.cs
- LinqDataSourceSelectEventArgs.cs
- HealthMonitoringSection.cs
- DataTemplateKey.cs
- NameNode.cs
- NetworkInterface.cs
- EarlyBoundInfo.cs
- SchemaCollectionCompiler.cs
- FixedDocumentSequencePaginator.cs
- JsonReaderWriterFactory.cs
- XmlSerializer.cs
- ProfileParameter.cs
- ScriptingAuthenticationServiceSection.cs
- CompositeDataBoundControl.cs
- Timer.cs
- ProjectionAnalyzer.cs
- TemplateAction.cs
- CompositeScriptReferenceEventArgs.cs
- StringFreezingAttribute.cs
- SessionPageStatePersister.cs
- ImageConverter.cs
- ObjectIDGenerator.cs
- PropertyMetadata.cs