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
- DataTablePropertyDescriptor.cs
- SvcMapFile.cs
- WorkflowServiceBehavior.cs
- BulletedListEventArgs.cs
- SqlOuterApplyReducer.cs
- DSASignatureFormatter.cs
- Block.cs
- OutputCacheSettings.cs
- TimeZone.cs
- ExternalException.cs
- CreateUserErrorEventArgs.cs
- IfAction.cs
- NativeMethods.cs
- MatcherBuilder.cs
- XmlSchemaComplexContentRestriction.cs
- UnionCqlBlock.cs
- AppDomain.cs
- BooleanAnimationBase.cs
- HostVisual.cs
- SchemaManager.cs
- SolidBrush.cs
- ObjectPropertyMapping.cs
- CodeSnippetTypeMember.cs
- QueryOptionExpression.cs
- RpcCryptoContext.cs
- DefaultPropertyAttribute.cs
- SoapMessage.cs
- Point3DConverter.cs
- ScriptManager.cs
- ProfileSettings.cs
- DesignerDeviceConfig.cs
- ClientSettingsStore.cs
- EdmConstants.cs
- DateTimeValueSerializerContext.cs
- ObjectCloneHelper.cs
- LocatorBase.cs
- ImportContext.cs
- TimeoutValidationAttribute.cs
- TypefaceMap.cs
- FilterException.cs
- Process.cs
- StringValueSerializer.cs
- ListCardsInFileRequest.cs
- CancellationTokenRegistration.cs
- Highlights.cs
- DbgCompiler.cs
- PointLightBase.cs
- OverflowException.cs
- DataGridPagerStyle.cs
- mda.cs
- ParagraphVisual.cs
- PointHitTestResult.cs
- CollaborationHelperFunctions.cs
- ListViewHitTestInfo.cs
- MDIWindowDialog.cs
- CultureInfoConverter.cs
- XmlProcessingInstruction.cs
- OutKeywords.cs
- FormsAuthenticationUser.cs
- SortedList.cs
- Pair.cs
- ResourceReferenceExpressionConverter.cs
- UTF32Encoding.cs
- RegexCompiler.cs
- SizeValueSerializer.cs
- XPathAxisIterator.cs
- PartialCachingControl.cs
- Debug.cs
- GcHandle.cs
- FrameworkContentElement.cs
- FullTextState.cs
- ClientTarget.cs
- DataGridViewBand.cs
- Page.cs
- Vector3DCollectionConverter.cs
- NopReturnReader.cs
- SpeechDetectedEventArgs.cs
- LogoValidationException.cs
- PerformanceCountersElement.cs
- PeerValidationBehavior.cs
- MimePart.cs
- ListMarkerSourceInfo.cs
- MsmqMessage.cs
- Grammar.cs
- IdentityManager.cs
- HandlerMappingMemo.cs
- UriSectionData.cs
- COM2Enum.cs
- SizeChangedInfo.cs
- TagPrefixCollection.cs
- SingleAnimationUsingKeyFrames.cs
- FontFamilyConverter.cs
- BindingNavigator.cs
- OracleTimeSpan.cs
- safemediahandle.cs
- ByteAnimation.cs
- SQLInt32Storage.cs
- ListViewUpdateEventArgs.cs
- RegexTypeEditor.cs
- EncoderNLS.cs