Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / NamedPipeTransportManager.cs / 1 / NamedPipeTransportManager.cs
//---------------------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------------------- namespace System.ServiceModel.Channels { using System; using System.ServiceModel; using System.Security.Principal; using System.Collections.Generic; abstract class NamedPipeTransportManager : ConnectionOrientedTransportManager, ITransportManagerRegistration { List allowedUsers; HostNameComparisonMode hostNameComparisonMode; Uri listenUri; protected NamedPipeTransportManager(Uri listenUri) { this.listenUri = listenUri; } protected void SetAllowedUsers(List allowedUsers) { this.allowedUsers = allowedUsers; } protected void SetHostNameComparisonMode(HostNameComparisonMode hostNameComparisonMode) { this.hostNameComparisonMode = hostNameComparisonMode; } internal List AllowedUsers { get { return this.allowedUsers; } } public HostNameComparisonMode HostNameComparisonMode { get { return this.hostNameComparisonMode; } protected set { HostNameComparisonModeHelper.Validate(value); lock (base.ThisLock) { ThrowIfOpen(); this.hostNameComparisonMode = value; } } } public Uri ListenUri { get { return this.listenUri; } } internal override string Scheme { get { return Uri.UriSchemeNetPipe; } } bool AreAllowedUsersEqual(List otherAllowedUsers) { return ((this.allowedUsers == otherAllowedUsers) || (IsSubset(this.allowedUsers, otherAllowedUsers) && IsSubset(otherAllowedUsers, this.allowedUsers))); } protected virtual bool IsCompatible(NamedPipeChannelListener channelListener) { if (channelListener.InheritBaseAddressSettings) { return true; } return ( base.IsCompatible(channelListener) && this.AreAllowedUsersEqual(channelListener.AllowedUsers) && (this.HostNameComparisonMode == channelListener.HostNameComparisonMode) ); } static bool IsSubset(List users1, List users2) { if (users1 == null) { return true; } foreach (SecurityIdentifier user in users1) { if (!users2.Contains(user)) { return false; } } return true; } internal override void OnClose() { NamedPipeChannelListener.StaticTransportManagerTable.UnregisterUri(this.ListenUri, this.HostNameComparisonMode); } protected virtual void OnSelecting(NamedPipeChannelListener channelListener) { } IList ITransportManagerRegistration.Select(TransportChannelListener channelListener) { OnSelecting((NamedPipeChannelListener)channelListener); IList result = null; if (this.IsCompatible((NamedPipeChannelListener)channelListener)) { result = new List (); result.Add(this); } return result; } } } // 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
- ASCIIEncoding.cs
- QuaternionAnimation.cs
- NetDataContractSerializer.cs
- BitVec.cs
- AnnotationAdorner.cs
- DurableInstancingOptions.cs
- ConstantExpression.cs
- ThousandthOfEmRealPoints.cs
- SqlCacheDependencyDatabase.cs
- OpenTypeLayout.cs
- ActivationServices.cs
- SQLInt64Storage.cs
- InvalidCastException.cs
- Transform3DCollection.cs
- StreamGeometry.cs
- Evidence.cs
- OpenTypeCommon.cs
- CookielessHelper.cs
- Walker.cs
- RewritingSimplifier.cs
- AnnotationResourceCollection.cs
- FixedTextSelectionProcessor.cs
- XmlDocumentFragment.cs
- WebServiceClientProxyGenerator.cs
- AssociationTypeEmitter.cs
- QueuePropertyVariants.cs
- ProvideValueServiceProvider.cs
- ScrollProperties.cs
- XmlQueryOutput.cs
- NetworkInformationException.cs
- PropertyCondition.cs
- TrustLevel.cs
- CheckBox.cs
- ExceptionHandlersDesigner.cs
- DataTableCollection.cs
- InternalResources.cs
- IntSecurity.cs
- PersonalizationState.cs
- SecurityIdentifierConverter.cs
- MatrixCamera.cs
- AccessControlEntry.cs
- RandomNumberGenerator.cs
- Highlights.cs
- SHA512Managed.cs
- ToolStripDropDownClosedEventArgs.cs
- XhtmlBasicLiteralTextAdapter.cs
- TextTreeTextBlock.cs
- LayoutDump.cs
- ComboBoxAutomationPeer.cs
- odbcmetadatafactory.cs
- FillBehavior.cs
- Point3DAnimationUsingKeyFrames.cs
- DataGridViewImageColumn.cs
- SoapElementAttribute.cs
- ObfuscateAssemblyAttribute.cs
- IndexingContentUnit.cs
- UpdateException.cs
- CheckBoxStandardAdapter.cs
- DoubleLinkList.cs
- WebExceptionStatus.cs
- ParseChildrenAsPropertiesAttribute.cs
- TextCompositionEventArgs.cs
- BaseCollection.cs
- SharedRuntimeState.cs
- EntityContainer.cs
- Event.cs
- ConfigurationPermission.cs
- ConfigurationException.cs
- CheckedPointers.cs
- SdlChannelSink.cs
- MergablePropertyAttribute.cs
- CodeDomSerializerBase.cs
- DefaultValueMapping.cs
- BinaryParser.cs
- DBSchemaRow.cs
- ClientSponsor.cs
- MaterialGroup.cs
- SystemIcmpV6Statistics.cs
- TextStore.cs
- WinFormsComponentEditor.cs
- FilterEventArgs.cs
- XmlStringTable.cs
- IdnMapping.cs
- Point3DValueSerializer.cs
- URLMembershipCondition.cs
- ExecutedRoutedEventArgs.cs
- StylusPointProperty.cs
- SvcMapFileSerializer.cs
- PtsHost.cs
- CommentEmitter.cs
- StyleTypedPropertyAttribute.cs
- RelationshipConverter.cs
- DefaultSettingsSection.cs
- SqlError.cs
- CaseInsensitiveOrdinalStringComparer.cs
- GPStream.cs
- StreamGeometry.cs
- KeyGesture.cs
- ProfessionalColorTable.cs
- UpdatePanel.cs