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
- ZipPackagePart.cs
- ComPlusServiceLoader.cs
- GcHandle.cs
- PersonalizationState.cs
- SQLDateTime.cs
- InstanceCreationEditor.cs
- MsdtcWrapper.cs
- Config.cs
- SizeAnimation.cs
- RegistryPermission.cs
- CachingParameterInspector.cs
- DesignerForm.cs
- ContentWrapperAttribute.cs
- StatusBarPanelClickEvent.cs
- CollectionBase.cs
- ContainerParagraph.cs
- Int32AnimationBase.cs
- ObjectStateEntryDbDataRecord.cs
- Enumerable.cs
- NoneExcludedImageIndexConverter.cs
- ScriptingProfileServiceSection.cs
- PostBackTrigger.cs
- ListItemsPage.cs
- HierarchicalDataSourceControl.cs
- TransformPattern.cs
- InputBinder.cs
- Native.cs
- DummyDataSource.cs
- BitmapEffectInput.cs
- ColumnBinding.cs
- _BaseOverlappedAsyncResult.cs
- SHA256Managed.cs
- MetabaseReader.cs
- AppDomainManager.cs
- CustomWebEventKey.cs
- EditorZoneBase.cs
- XmlIgnoreAttribute.cs
- TypeDescriptionProviderAttribute.cs
- PathFigureCollectionValueSerializer.cs
- SamlSecurityTokenAuthenticator.cs
- PathFigureCollectionValueSerializer.cs
- IRCollection.cs
- EventMemberCodeDomSerializer.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- EventData.cs
- WindowProviderWrapper.cs
- CompilerTypeWithParams.cs
- CopyNodeSetAction.cs
- CompressEmulationStream.cs
- StorageAssociationSetMapping.cs
- StringStorage.cs
- SqlCharStream.cs
- DataGridViewCell.cs
- WebPartConnectVerb.cs
- DropSource.cs
- ToolboxItemCollection.cs
- JpegBitmapEncoder.cs
- PDBReader.cs
- XmlChoiceIdentifierAttribute.cs
- PseudoWebRequest.cs
- AuthorizationSection.cs
- SchemaElementLookUpTableEnumerator.cs
- ActivityTypeDesigner.xaml.cs
- Typography.cs
- DesignerSerializationVisibilityAttribute.cs
- Int64AnimationBase.cs
- KeyManager.cs
- safelink.cs
- HwndSource.cs
- SetState.cs
- XmlWriterDelegator.cs
- WebPartEditorCancelVerb.cs
- ADMembershipUser.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- InteropAutomationProvider.cs
- FrameDimension.cs
- FormsAuthenticationModule.cs
- RectangleConverter.cs
- StrokeRenderer.cs
- Ports.cs
- PreProcessInputEventArgs.cs
- XsltQilFactory.cs
- RSAPKCS1KeyExchangeFormatter.cs
- FileVersion.cs
- CustomError.cs
- ExpressionNormalizer.cs
- TableLayoutSettings.cs
- Point3DAnimationUsingKeyFrames.cs
- FloatSumAggregationOperator.cs
- TextEditorSpelling.cs
- DataGridViewComboBoxColumn.cs
- BinaryHeap.cs
- safelink.cs
- WebResourceAttribute.cs
- ContextQuery.cs
- SignatureConfirmations.cs
- DrawingContextWalker.cs
- SqlErrorCollection.cs
- Endpoint.cs
- OutputCacheProfileCollection.cs