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
- TextSelectionHelper.cs
- _UriTypeConverter.cs
- PersonalizableAttribute.cs
- SplitterEvent.cs
- Item.cs
- Line.cs
- SmiTypedGetterSetter.cs
- RemotingConfigParser.cs
- InvokeHandlers.cs
- ITreeGenerator.cs
- elementinformation.cs
- TextInfo.cs
- PartialList.cs
- LicFileLicenseProvider.cs
- ListViewItemEventArgs.cs
- XmlMapping.cs
- TransactionCache.cs
- XmlAttribute.cs
- XmlnsCache.cs
- NavigationExpr.cs
- DurableRuntimeValidator.cs
- WinEventHandler.cs
- SmiMetaData.cs
- login.cs
- XmlNamespaceDeclarationsAttribute.cs
- IncrementalCompileAnalyzer.cs
- ControlPropertyNameConverter.cs
- NamespaceExpr.cs
- PageWrapper.cs
- DynamicValidatorEventArgs.cs
- SiteMapNodeItemEventArgs.cs
- BaseServiceProvider.cs
- TabControl.cs
- OdbcRowUpdatingEvent.cs
- Timer.cs
- AssemblyCacheEntry.cs
- OletxResourceManager.cs
- UTF32Encoding.cs
- RectAnimation.cs
- TreeViewImageIndexConverter.cs
- ContractInferenceHelper.cs
- connectionpool.cs
- ChildTable.cs
- CounterSample.cs
- DataGridItem.cs
- WebChannelFactory.cs
- LogicalExpr.cs
- DummyDataSource.cs
- ObjectItemAssemblyLoader.cs
- ScriptRegistrationManager.cs
- JsonFormatWriterGenerator.cs
- VariableBinder.cs
- RuleSettingsCollection.cs
- CodeSubDirectory.cs
- ColorBlend.cs
- ObjectDataSourceFilteringEventArgs.cs
- Directory.cs
- ClaimTypes.cs
- ReadOnlyNameValueCollection.cs
- XmlDomTextWriter.cs
- SmiConnection.cs
- OdbcFactory.cs
- GorillaCodec.cs
- ValueProviderWrapper.cs
- OleDbReferenceCollection.cs
- XmlNodeReader.cs
- SqlUserDefinedAggregateAttribute.cs
- DataGridViewButtonColumn.cs
- EdgeProfileValidation.cs
- BuiltInPermissionSets.cs
- ThaiBuddhistCalendar.cs
- Oid.cs
- FactoryMaker.cs
- ProgressiveCrcCalculatingStream.cs
- Rect3D.cs
- DataChangedEventManager.cs
- WizardStepBase.cs
- XmlSchemaExternal.cs
- LogEntrySerializationException.cs
- validationstate.cs
- Catch.cs
- TypedTableBase.cs
- XmlLanguageConverter.cs
- SimpleBitVector32.cs
- SmtpLoginAuthenticationModule.cs
- BuildManagerHost.cs
- ToolTipService.cs
- NamedObject.cs
- WebServiceClientProxyGenerator.cs
- CodeMemberProperty.cs
- Funcletizer.cs
- SoapHeaderAttribute.cs
- PublisherMembershipCondition.cs
- ResourceDictionary.cs
- ClientClassGenerator.cs
- TableLayoutCellPaintEventArgs.cs
- Page.cs
- httpapplicationstate.cs
- MexHttpBindingElement.cs
- SR.cs