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
- ControlPaint.cs
- CellRelation.cs
- IndicShape.cs
- CorrelationService.cs
- CancellationTokenRegistration.cs
- PeerInputChannel.cs
- TrackingProfile.cs
- ProfessionalColorTable.cs
- ActivationArguments.cs
- ModelItemDictionary.cs
- SettingsPropertyValue.cs
- Point3DKeyFrameCollection.cs
- FaultContractAttribute.cs
- BitmapEffectRenderDataResource.cs
- ProtocolsSection.cs
- XmlAttributeAttribute.cs
- StructuralType.cs
- HtmlInputButton.cs
- WindowsProgressbar.cs
- FlowLayoutSettings.cs
- DateTimeFormatInfo.cs
- RoutingEndpointTrait.cs
- ToolStripItem.cs
- ConfigXmlCDataSection.cs
- RelationshipEntry.cs
- CommandSet.cs
- SingleAnimation.cs
- RemotingServices.cs
- FixUpCollection.cs
- ItemCheckEvent.cs
- DocumentsTrace.cs
- DTCTransactionManager.cs
- Baml2006Reader.cs
- ListViewSortEventArgs.cs
- Root.cs
- DifferencingCollection.cs
- CallbackValidatorAttribute.cs
- HttpListener.cs
- CodeParameterDeclarationExpression.cs
- DrawingVisual.cs
- TimeZoneNotFoundException.cs
- ApplicationCommands.cs
- ResourceFallbackManager.cs
- ContentFileHelper.cs
- MembershipPasswordException.cs
- NavigateEvent.cs
- StreamedWorkflowDefinitionContext.cs
- GridPattern.cs
- WindowsNonControl.cs
- ThaiBuddhistCalendar.cs
- TabControlAutomationPeer.cs
- ClockGroup.cs
- ButtonColumn.cs
- Soap12FormatExtensions.cs
- NavigationExpr.cs
- Maps.cs
- WrapPanel.cs
- SqlDuplicator.cs
- DesignerCategoryAttribute.cs
- BeginStoryboard.cs
- DocumentsTrace.cs
- ScriptModule.cs
- MobileUserControl.cs
- DynamicVirtualDiscoSearcher.cs
- EncoderNLS.cs
- SchemeSettingElementCollection.cs
- XmlDocumentType.cs
- CodeNamespace.cs
- ElementMarkupObject.cs
- UICuesEvent.cs
- Imaging.cs
- CacheDependency.cs
- XmlSchemaObjectTable.cs
- MemoryStream.cs
- RunClient.cs
- Coordinator.cs
- PlaceHolder.cs
- XmlMemberMapping.cs
- EndPoint.cs
- GeneralTransform2DTo3D.cs
- StringInfo.cs
- PipelineModuleStepContainer.cs
- documentsequencetextpointer.cs
- ValueTable.cs
- Transform.cs
- UInt32Storage.cs
- GlyphShapingProperties.cs
- DockProviderWrapper.cs
- AppDomainManager.cs
- BooleanKeyFrameCollection.cs
- RowType.cs
- WindowAutomationPeer.cs
- UserUseLicenseDictionaryLoader.cs
- coordinatorfactory.cs
- CallContext.cs
- XmlChildEnumerator.cs
- StateMachine.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- HttpCacheVary.cs
- NativeMethods.cs