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
- ToolStripLabel.cs
- InlineUIContainer.cs
- LinkArea.cs
- WindowsListViewScroll.cs
- InvokeSchedule.cs
- CacheEntry.cs
- CodeCatchClause.cs
- ReadWriteObjectLock.cs
- AnnotationResourceChangedEventArgs.cs
- DescendantOverDescendantQuery.cs
- RichTextBoxConstants.cs
- FileDialogCustomPlacesCollection.cs
- ToolboxDataAttribute.cs
- CodeAccessSecurityEngine.cs
- OSEnvironmentHelper.cs
- AutomationPatternInfo.cs
- EditorPartCollection.cs
- AttachedAnnotationChangedEventArgs.cs
- HttpHandlerAction.cs
- CodeGenerator.cs
- ColumnHeader.cs
- TraceContextRecord.cs
- ProtocolsInstallComponent.cs
- NativeBuffer.cs
- EtwTrackingParticipant.cs
- ClientSponsor.cs
- AssemblyNameProxy.cs
- SoapInteropTypes.cs
- CodeArrayIndexerExpression.cs
- DetailsViewRowCollection.cs
- MbpInfo.cs
- PropertyManager.cs
- ListViewGroupCollectionEditor.cs
- WindowsPrincipal.cs
- PagePropertiesChangingEventArgs.cs
- UpdatePanelTrigger.cs
- ExpressionBindingsDialog.cs
- MetadataPropertyCollection.cs
- RuntimeEnvironment.cs
- Vector3DCollectionValueSerializer.cs
- HostingEnvironmentException.cs
- HttpHandlerAction.cs
- BoolLiteral.cs
- WebPartEventArgs.cs
- EditorAttribute.cs
- StyleSheetDesigner.cs
- ClosableStream.cs
- UserControl.cs
- SiteMapNode.cs
- TcpHostedTransportConfiguration.cs
- DocumentationServerProtocol.cs
- ConnectionPoolManager.cs
- HtmlInputPassword.cs
- OleDbEnumerator.cs
- NativeMethodsOther.cs
- GcSettings.cs
- XmlSiteMapProvider.cs
- VerificationException.cs
- SimpleHandlerFactory.cs
- InputMethodStateTypeInfo.cs
- WorkflowMessageEventArgs.cs
- TextTreeRootTextBlock.cs
- TextEffect.cs
- FlowStep.cs
- AlgoModule.cs
- SplineKeyFrames.cs
- Command.cs
- InfoCardSymmetricCrypto.cs
- XmlFormatExtensionPointAttribute.cs
- CommentEmitter.cs
- SqlFactory.cs
- Debug.cs
- VisualStyleTypesAndProperties.cs
- TextCompositionEventArgs.cs
- NamedPipeAppDomainProtocolHandler.cs
- WebBrowser.cs
- CultureMapper.cs
- WebPartMovingEventArgs.cs
- ClickablePoint.cs
- AssociationTypeEmitter.cs
- AtomContentProperty.cs
- WaitHandle.cs
- GraphicsPathIterator.cs
- Renderer.cs
- ErrorView.xaml.cs
- RegistryDataKey.cs
- XPathException.cs
- ClientReliableChannelBinder.cs
- SocketConnection.cs
- ExceptQueryOperator.cs
- QilList.cs
- CompilerLocalReference.cs
- SqlParameterizer.cs
- ResourceAssociationSet.cs
- IntSecurity.cs
- OutputCacheProfile.cs
- PreApplicationStartMethodAttribute.cs
- ArraySet.cs
- UnsafeNativeMethods.cs
- AutomationPropertyChangedEventArgs.cs