Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / PnrpPeerResolverBindingElement.cs / 1 / PnrpPeerResolverBindingElement.cs
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------
namespace System.ServiceModel.Channels
{
using System.ComponentModel;
using System.ServiceModel;
using System.ServiceModel.PeerResolvers;
public sealed class PnrpPeerResolverBindingElement : PeerResolverBindingElement
{
PeerReferralPolicy referralPolicy;
public PnrpPeerResolverBindingElement() { }
public PnrpPeerResolverBindingElement(PeerReferralPolicy referralPolicy)
{
this.referralPolicy = referralPolicy;
}
PnrpPeerResolverBindingElement(PnrpPeerResolverBindingElement elementToBeCloned) : base(elementToBeCloned)
{
this.referralPolicy = elementToBeCloned.referralPolicy;
}
public override PeerReferralPolicy ReferralPolicy
{
get
{
return referralPolicy;
}
set
{
if(!PeerReferralPolicyHelper.IsDefined(value))
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnumArgumentException("value", (int)value, typeof(PeerReferralPolicy)));
}
referralPolicy = value;
}
}
public override BindingElement Clone()
{
return new PnrpPeerResolverBindingElement(this);
}
public override IChannelFactory BuildChannelFactory(BindingContext context)
{
if (context == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context"));
context.BindingParameters.Add(this);
return context.BuildInnerChannelFactory();
}
public override bool CanBuildChannelFactory(BindingContext context)
{
if (context == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context"));
context.BindingParameters.Add(this);
return context.CanBuildInnerChannelFactory();
}
public override IChannelListener BuildChannelListener(BindingContext context)
{
if (context == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context"));
context.BindingParameters.Add(this);
return context.BuildInnerChannelListener();
}
public override bool CanBuildChannelListener(BindingContext context)
{
if (context == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context"));
context.BindingParameters.Add(this);
return context.CanBuildInnerChannelListener();
}
public override PeerResolver CreatePeerResolver()
{
return new PnrpPeerResolver(this.referralPolicy);
}
public override T GetProperty(BindingContext context)
{
return context.GetInnerProperty();
}
}
}
// 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
- RuleSettings.cs
- ArgumentNullException.cs
- MouseCaptureWithinProperty.cs
- ContainerParagraph.cs
- CLRBindingWorker.cs
- WebPartDeleteVerb.cs
- ExitEventArgs.cs
- FunctionOverloadResolver.cs
- PowerModeChangedEventArgs.cs
- KeyGesture.cs
- PointHitTestResult.cs
- LinqDataSourceHelper.cs
- OdbcConnectionOpen.cs
- CompressionTracing.cs
- EventDescriptorCollection.cs
- BaseResourcesBuildProvider.cs
- WeakReference.cs
- WebPartExportVerb.cs
- ArraySegment.cs
- XmlSerializationGeneratedCode.cs
- ProcessHostFactoryHelper.cs
- IPPacketInformation.cs
- ApplicationInfo.cs
- SecurityDescriptor.cs
- WorkflowWebService.cs
- PrintPageEvent.cs
- DbgUtil.cs
- Clipboard.cs
- KeyedHashAlgorithm.cs
- CompilationUnit.cs
- Group.cs
- Point3DCollectionValueSerializer.cs
- SmiContext.cs
- WebPartConnectionsDisconnectVerb.cs
- BookmarkUndoUnit.cs
- RegexCharClass.cs
- FontStyle.cs
- ZipIOLocalFileDataDescriptor.cs
- XmlBindingWorker.cs
- BindingExpression.cs
- OpenTypeCommon.cs
- ClientProxyGenerator.cs
- WebBrowser.cs
- ObjectListSelectEventArgs.cs
- LingerOption.cs
- CounterSample.cs
- AliasedExpr.cs
- XmlAnyElementAttribute.cs
- OleDbParameter.cs
- EnterpriseServicesHelper.cs
- WebReferenceOptions.cs
- ScrollData.cs
- SettingsAttributes.cs
- TextBoxAutoCompleteSourceConverter.cs
- FormsIdentity.cs
- BufferModeSettings.cs
- DrawingDrawingContext.cs
- DesignerContextDescriptor.cs
- Merger.cs
- Debug.cs
- BuilderPropertyEntry.cs
- ConvertEvent.cs
- Int32RectConverter.cs
- AppearanceEditorPart.cs
- SecurityProtocolCorrelationState.cs
- ClientScriptManager.cs
- SEHException.cs
- NavigationExpr.cs
- DataColumnChangeEvent.cs
- NamespaceInfo.cs
- EpmSyndicationContentSerializer.cs
- XmlMessageFormatter.cs
- XamlStream.cs
- TreeWalkHelper.cs
- XmlSchemaGroup.cs
- OpenFileDialog.cs
- XmlDesigner.cs
- MruCache.cs
- NameValueConfigurationElement.cs
- ListViewInsertionMark.cs
- TraceRecords.cs
- QilInvoke.cs
- DispatcherBuilder.cs
- Timer.cs
- xmlsaver.cs
- WpfWebRequestHelper.cs
- _UriSyntax.cs
- UpWmlMobileTextWriter.cs
- RegexMatchCollection.cs
- MessageQueueInstaller.cs
- ZipArchive.cs
- SystemWebSectionGroup.cs
- AssemblyAttributesGoHere.cs
- SafeEventHandle.cs
- Main.cs
- ValueHandle.cs
- DataGridRowAutomationPeer.cs
- CharEnumerator.cs
- QueryTaskGroupState.cs
- QuaternionConverter.cs