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
- RelationshipConstraintValidator.cs
- SiteMapHierarchicalDataSourceView.cs
- PropertyValue.cs
- Object.cs
- TextAutomationPeer.cs
- DocumentOrderQuery.cs
- StyleCollection.cs
- ApplicationBuildProvider.cs
- TemplateBuilder.cs
- DataGridViewColumn.cs
- IdnMapping.cs
- ArglessEventHandlerProxy.cs
- ClassData.cs
- StringAnimationUsingKeyFrames.cs
- SecurityChannelFaultConverter.cs
- UxThemeWrapper.cs
- BamlLocalizer.cs
- GenericWebPart.cs
- HostSecurityManager.cs
- FlowchartDesigner.Helpers.cs
- WebHttpDispatchOperationSelector.cs
- SessionEndingCancelEventArgs.cs
- XmlStreamStore.cs
- XmlSchemaSimpleType.cs
- ParsedAttributeCollection.cs
- ChannelServices.cs
- TextFormatterContext.cs
- Listener.cs
- SequentialUshortCollection.cs
- ModelTreeEnumerator.cs
- DataControlFieldCollection.cs
- HtmlShim.cs
- EventNotify.cs
- Byte.cs
- MediaPlayerState.cs
- ThicknessAnimationBase.cs
- BidOverLoads.cs
- LookupBindingPropertiesAttribute.cs
- RenderingEventArgs.cs
- DataGridViewCellStyle.cs
- ToolStripDropDownButton.cs
- SqlMethodTransformer.cs
- XmlDictionaryReaderQuotas.cs
- JapaneseCalendar.cs
- OdbcPermission.cs
- DynamicMethod.cs
- SnapLine.cs
- Array.cs
- ZoneMembershipCondition.cs
- DataTemplate.cs
- MenuItem.cs
- XmlDataLoader.cs
- RowUpdatedEventArgs.cs
- Triangle.cs
- ExecutionTracker.cs
- TimersDescriptionAttribute.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- Parallel.cs
- SafeSecurityHelper.cs
- CategoryValueConverter.cs
- QilChoice.cs
- ToolStripDropDownDesigner.cs
- GPPOINTF.cs
- ExpressionPrefixAttribute.cs
- SystemIcmpV6Statistics.cs
- filewebrequest.cs
- UriSection.cs
- Size.cs
- EventLogPermission.cs
- UniqueConstraint.cs
- XmlQueryOutput.cs
- TemplateControl.cs
- MimeBasePart.cs
- Formatter.cs
- DispatchWrapper.cs
- TextHidden.cs
- TextDpi.cs
- BeginEvent.cs
- SqlInfoMessageEvent.cs
- ClientTargetCollection.cs
- Relationship.cs
- SerialErrors.cs
- DataGridViewDataErrorEventArgs.cs
- PropertyInformation.cs
- VirtualPathProvider.cs
- ColorPalette.cs
- ScriptingSectionGroup.cs
- GorillaCodec.cs
- ListBox.cs
- PathTooLongException.cs
- ToolStripContentPanel.cs
- CellLabel.cs
- OperationContractGenerationContext.cs
- DocumentGrid.cs
- XmlDocumentType.cs
- XamlTreeBuilderBamlRecordWriter.cs
- WeakReference.cs
- SafeCoTaskMem.cs
- HtmlToClrEventProxy.cs
- ImageBrush.cs