a575963da9
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
46 lines
1012 B
C#
46 lines
1012 B
C#
//
|
|
// PeerResolverSettings.cs
|
|
//
|
|
// Author:
|
|
// Marcos Cobena (marcoscobena@gmail.com)
|
|
//
|
|
// Copyright 2007 Marcos Cobena (http://www.youcannoteatbits.org/)
|
|
//
|
|
|
|
using System;
|
|
using System.ServiceModel.Channels;
|
|
|
|
namespace System.ServiceModel.PeerResolvers
|
|
{
|
|
public class PeerResolverSettings
|
|
{
|
|
PeerCustomResolverSettings custom = new PeerCustomResolverSettings ();
|
|
// FIXME: Is it really by default Auto?
|
|
PeerResolverMode mode = PeerResolverMode.Auto;
|
|
|
|
public PeerResolverSettings ()
|
|
{
|
|
}
|
|
|
|
public PeerCustomResolverSettings Custom {
|
|
get { return custom; }
|
|
}
|
|
|
|
public PeerResolverMode Mode { get; set; }
|
|
|
|
public PeerReferralPolicy ReferralPolicy { get; set; }
|
|
|
|
internal BindingElement CreateBinding ()
|
|
{
|
|
switch (Mode) {
|
|
case PeerResolverMode.Pnrp:
|
|
return new PnrpPeerResolverBindingElement () { ReferralPolicy = this.ReferralPolicy };
|
|
default:
|
|
var be = Custom.CreateBinding ();
|
|
be.ReferralPolicy = this.ReferralPolicy;
|
|
return be;
|
|
}
|
|
}
|
|
}
|
|
}
|