Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / NamedPipeTransportBindingElement.cs / 1 / NamedPipeTransportBindingElement.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Channels { using System.ServiceModel.Activation; using System.Collections.Generic; using System.Net.Security; using System.Security.Principal; using System.Runtime.Serialization; using System.Xml; public class NamedPipeTransportBindingElement : ConnectionOrientedTransportBindingElement { ListallowedUsers; NamedPipeConnectionPoolSettings connectionPoolSettings = new NamedPipeConnectionPoolSettings(); public NamedPipeTransportBindingElement() : base() { } protected NamedPipeTransportBindingElement(NamedPipeTransportBindingElement elementToBeCloned) : base(elementToBeCloned) { if (elementToBeCloned.allowedUsers != null) { this.allowedUsers = new List (elementToBeCloned.AllowedUsers.Count); foreach (SecurityIdentifier id in elementToBeCloned.allowedUsers) { this.allowedUsers.Add(id); } } this.connectionPoolSettings = elementToBeCloned.connectionPoolSettings.Clone(); } // Used by SMSvcHost (see Activation\SharingService.cs) internal List AllowedUsers { get { return this.allowedUsers; } set { this.allowedUsers = value; } } public NamedPipeConnectionPoolSettings ConnectionPoolSettings { get { return this.connectionPoolSettings; } } public override string Scheme { get { return "net.pipe"; } } internal override string WsdlTransportUri { get { return TransportPolicyConstants.NamedPipeTransportUri; } } public override BindingElement Clone() { return new NamedPipeTransportBindingElement(this); } public override IChannelFactory BuildChannelFactory (BindingContext context) { if (context == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context"); } if(!this.CanBuildChannelFactory (context)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("TChannel", SR.GetString(SR.ChannelTypeNotSupported, typeof(TChannel))); } return (IChannelFactory )(object)new NamedPipeChannelFactory (this, context); } public override IChannelListener BuildChannelListener (BindingContext context) { if (context == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context"); } if (!this.CanBuildChannelListener (context)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("TChannel", SR.GetString(SR.ChannelTypeNotSupported, typeof(TChannel))); } NamedPipeChannelListener listener; if (typeof(TChannel) == typeof(IReplyChannel)) { listener = new NamedPipeReplyChannelListener(this, context); } else if (typeof(TChannel) == typeof(IDuplexSessionChannel)) { listener = new NamedPipeDuplexChannelListener(this, context); } else { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("TChannel", SR.GetString(SR.ChannelTypeNotSupported, typeof(TChannel))); } VirtualPathExtension.ApplyHostedContext(listener, context); return (IChannelListener )(object)listener; } public override T GetProperty (BindingContext context) { if (context == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context"); } if (typeof(T) == typeof(IBindingDeliveryCapabilities)) { return (T)(object)new BindingDeliveryCapabilitiesHelper(); } else { return base.GetProperty (context); } } internal override bool IsMatch(BindingElement b) { if (!base.IsMatch(b)) { return false; } NamedPipeTransportBindingElement namedPipe = b as NamedPipeTransportBindingElement; if (namedPipe == null) { return false; } if (!this.ConnectionPoolSettings.IsMatch(namedPipe.ConnectionPoolSettings)) { return false; } return true; } class BindingDeliveryCapabilitiesHelper : IBindingDeliveryCapabilities { internal BindingDeliveryCapabilitiesHelper() { } bool IBindingDeliveryCapabilities.AssuresOrderedDelivery { get { return true; } } bool IBindingDeliveryCapabilities.QueuedDelivery { get { return false; } } } } } // 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
- SrgsSemanticInterpretationTag.cs
- SurrogateDataContract.cs
- FixedElement.cs
- FactoryRecord.cs
- Util.cs
- Expression.cs
- GridViewColumnCollection.cs
- EnumConverter.cs
- CallSiteBinder.cs
- OleDbException.cs
- OrderedDictionaryStateHelper.cs
- LogEntrySerialization.cs
- ImageBrush.cs
- Scripts.cs
- RijndaelCryptoServiceProvider.cs
- SafeRegistryHandle.cs
- GrammarBuilder.cs
- WorkflowItemsPresenter.cs
- DetailsViewUpdatedEventArgs.cs
- BindingList.cs
- HttpRequest.cs
- CrossSiteScriptingValidation.cs
- TransformPatternIdentifiers.cs
- SBCSCodePageEncoding.cs
- OrderedDictionaryStateHelper.cs
- MarkupExtensionParser.cs
- Image.cs
- StreamSecurityUpgradeInitiatorBase.cs
- DbConnectionPoolGroup.cs
- DataControlLinkButton.cs
- WinFormsSpinner.cs
- OdbcDataAdapter.cs
- MdImport.cs
- TemplateControlParser.cs
- EditorPartChrome.cs
- HttpResponseHeader.cs
- BuildTopDownAttribute.cs
- VersionUtil.cs
- XmlValidatingReader.cs
- TextDecorationCollection.cs
- InvokePatternIdentifiers.cs
- FieldNameLookup.cs
- ColumnHeader.cs
- OdbcConnectionHandle.cs
- HttpConfigurationSystem.cs
- DelegateSerializationHolder.cs
- CursorInteropHelper.cs
- WindowsListViewGroupSubsetLink.cs
- HttpRuntimeSection.cs
- ZipIOExtraFieldZip64Element.cs
- RedirectionProxy.cs
- Predicate.cs
- CacheVirtualItemsEvent.cs
- CharStorage.cs
- AppDomainShutdownMonitor.cs
- ListViewTableCell.cs
- UnicastIPAddressInformationCollection.cs
- _ShellExpression.cs
- SevenBitStream.cs
- DrawingContextWalker.cs
- NetworkAddressChange.cs
- Rotation3DAnimation.cs
- ParentQuery.cs
- HttpWebResponse.cs
- CustomAssemblyResolver.cs
- ReadOnlyDataSource.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- CancelEventArgs.cs
- DispatcherSynchronizationContext.cs
- Transform3D.cs
- VBIdentifierName.cs
- SqlDuplicator.cs
- PropertyDescriptors.cs
- GeneralTransform2DTo3DTo2D.cs
- HijriCalendar.cs
- ImageSource.cs
- EtwTrace.cs
- Point3DCollectionConverter.cs
- BuildDependencySet.cs
- KeysConverter.cs
- BrowserTree.cs
- ComponentResourceKeyConverter.cs
- RelationshipEndMember.cs
- CommandValueSerializer.cs
- ArrangedElement.cs
- SqlFactory.cs
- ImmComposition.cs
- TextEncodedRawTextWriter.cs
- WebColorConverter.cs
- CodeRemoveEventStatement.cs
- ProfileInfo.cs
- InfoCardTrace.cs
- ListBoxItemAutomationPeer.cs
- ParameterSubsegment.cs
- PhonemeConverter.cs
- MouseBinding.cs
- BrowsableAttribute.cs
- PrintingPermissionAttribute.cs
- PropertyBuilder.cs
- ConnectionStringSettingsCollection.cs