mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-19 01:31:17 -10:00
Adding reference source for System.Data System.Data.DataSetExtensions System.Data.Entity System.Data.Entity.Design System.Data.Linq System.Data.SqlXml System.ServiceModel System.ServiceModel.Activation System.ServiceModel.Activities System.ServiceModel.Channels System.ServiceModel.Discovery System.ServiceModel.Internals System.ServiceModel.Routing System.ServiceModel.WasHosting System.ServiceModel.Web System.Web System.Web.ApplicationServices System.Web.DynamicData System.Web.Entity System.Web.Entity.Design System.Web.Extensions System.Web.Mobile System.Web.Routing System.Web.Services System.Xml System.Xml.Linq
96 lines
3.3 KiB
C#
96 lines
3.3 KiB
C#
//------------------------------------------------------------
|
|
// 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<TChannel> BuildChannelFactory<TChannel>(BindingContext context)
|
|
{
|
|
if (context == null)
|
|
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context"));
|
|
|
|
context.BindingParameters.Add(this);
|
|
return context.BuildInnerChannelFactory<TChannel>();
|
|
}
|
|
|
|
public override bool CanBuildChannelFactory<TChannel>(BindingContext context)
|
|
{
|
|
if (context == null)
|
|
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context"));
|
|
|
|
context.BindingParameters.Add(this);
|
|
return context.CanBuildInnerChannelFactory<TChannel>();
|
|
}
|
|
|
|
public override IChannelListener<TChannel> BuildChannelListener<TChannel>(BindingContext context)
|
|
{
|
|
if (context == null)
|
|
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context"));
|
|
|
|
context.BindingParameters.Add(this);
|
|
return context.BuildInnerChannelListener<TChannel>();
|
|
}
|
|
|
|
public override bool CanBuildChannelListener<TChannel>(BindingContext context)
|
|
{
|
|
if (context == null)
|
|
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context"));
|
|
|
|
context.BindingParameters.Add(this);
|
|
return context.CanBuildInnerChannelListener<TChannel>();
|
|
}
|
|
|
|
public override PeerResolver CreatePeerResolver()
|
|
{
|
|
return new PnrpPeerResolver(this.referralPolicy);
|
|
}
|
|
|
|
public override T GetProperty<T>(BindingContext context)
|
|
{
|
|
return context.GetInnerProperty<T>();
|
|
}
|
|
}
|
|
}
|