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
- GPRECT.cs
- XmlHierarchicalEnumerable.cs
- HttpRawResponse.cs
- ListDictionary.cs
- RootBrowserWindowProxy.cs
- HelpEvent.cs
- ResolveNameEventArgs.cs
- ScrollPattern.cs
- MarkupExtensionParser.cs
- PathData.cs
- TrackingServices.cs
- HttpListenerResponse.cs
- SamlDoNotCacheCondition.cs
- xmlglyphRunInfo.cs
- SystemBrushes.cs
- While.cs
- MediaTimeline.cs
- InputManager.cs
- Command.cs
- storagemappingitemcollection.viewdictionary.cs
- SafeFileMapViewHandle.cs
- NativeObjectSecurity.cs
- RepeatBehaviorConverter.cs
- PriorityQueue.cs
- InputElement.cs
- CompiledELinqQueryState.cs
- VisualStyleInformation.cs
- Button.cs
- ScaleTransform.cs
- HierarchicalDataBoundControl.cs
- EditorZoneBase.cs
- FillErrorEventArgs.cs
- WebBrowserNavigatingEventHandler.cs
- QueryCoreOp.cs
- MouseEvent.cs
- PrintDocument.cs
- NativeMethods.cs
- _NestedSingleAsyncResult.cs
- DockAndAnchorLayout.cs
- EmbossBitmapEffect.cs
- ConnectionStringSettings.cs
- View.cs
- CultureMapper.cs
- ContainerFilterService.cs
- CharacterShapingProperties.cs
- MatchNoneMessageFilter.cs
- VoiceInfo.cs
- QilExpression.cs
- WSFederationHttpSecurityElement.cs
- MessageTraceRecord.cs
- XmlStreamStore.cs
- SqlDependencyListener.cs
- RecognizerBase.cs
- XmlDigitalSignatureProcessor.cs
- TextEditorContextMenu.cs
- InfoCardSymmetricAlgorithm.cs
- PageVisual.cs
- DoubleConverter.cs
- XmlTextWriter.cs
- ObjectViewListener.cs
- GeometryHitTestResult.cs
- DataList.cs
- EndpointDispatcherTable.cs
- DataBoundControlHelper.cs
- UTF32Encoding.cs
- InheritanceAttribute.cs
- DataSpaceManager.cs
- XmlConvert.cs
- Send.cs
- BoolLiteral.cs
- Pair.cs
- TimeoutValidationAttribute.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- Int16Converter.cs
- SetterBaseCollection.cs
- TextDecoration.cs
- DataBindingValueUIHandler.cs
- InstanceDescriptor.cs
- Popup.cs
- ContextBase.cs
- RefType.cs
- BlockingCollection.cs
- IndicCharClassifier.cs
- MenuItemBindingCollection.cs
- MimeTypeMapper.cs
- HtmlTable.cs
- PrincipalPermissionMode.cs
- EditingCoordinator.cs
- ExtendedProperty.cs
- ComboBox.cs
- CompilerParameters.cs
- DataTableTypeConverter.cs
- EntityModelBuildProvider.cs
- SecurityContextCookieSerializer.cs
- FontNamesConverter.cs
- ContainerControl.cs
- XmlQualifiedName.cs
- Bits.cs
- BrowserDefinitionCollection.cs
- HyperLinkField.cs