Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Configuration / PeerCredentialElement.cs / 1 / PeerCredentialElement.cs
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
namespace System.ServiceModel.Configuration
{
using System;
using System.Configuration;
using System.ServiceModel.Channels;
using System.ServiceModel.Security;
using System.Xml;
using System.Security.Cryptography.X509Certificates;
public sealed partial class PeerCredentialElement : ConfigurationElement
{
public PeerCredentialElement()
{
}
[ConfigurationProperty(ConfigurationStrings.Certificate)]
public X509PeerCertificateElement Certificate
{
get { return (X509PeerCertificateElement)base[ConfigurationStrings.Certificate]; }
}
[ConfigurationProperty(ConfigurationStrings.PeerAuthentication)]
public X509PeerCertificateAuthenticationElement PeerAuthentication
{
get { return (X509PeerCertificateAuthenticationElement)base[ConfigurationStrings.PeerAuthentication]; }
}
[ConfigurationProperty(ConfigurationStrings.MessageSenderAuthentication)]
public X509PeerCertificateAuthenticationElement MessageSenderAuthentication
{
get { return (X509PeerCertificateAuthenticationElement)base[ConfigurationStrings.MessageSenderAuthentication]; }
}
public void Copy(PeerCredentialElement from)
{
if (this.IsReadOnly())
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(SR.GetString(SR.ConfigReadOnly)));
}
if (null == from)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("from");
}
this.Certificate.Copy(from.Certificate);
this.PeerAuthentication.Copy(from.PeerAuthentication);
this.MessageSenderAuthentication.Copy(from.MessageSenderAuthentication);
}
internal void ApplyConfiguration(PeerCredential creds)
{
if (creds == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("creds");
}
PropertyInformationCollection propertyInfo = this.ElementInformation.Properties;
if (propertyInfo[ConfigurationStrings.Certificate].ValueOrigin != PropertyValueOrigin.Default)
{
this.Certificate.ApplyConfiguration(creds);
}
if (propertyInfo[ConfigurationStrings.PeerAuthentication].ValueOrigin != PropertyValueOrigin.Default)
{
this.PeerAuthentication.ApplyConfiguration(creds.PeerAuthentication);
}
if (propertyInfo[ConfigurationStrings.MessageSenderAuthentication].ValueOrigin != PropertyValueOrigin.Default)
{
this.MessageSenderAuthentication.ApplyConfiguration(creds.MessageSenderAuthentication);
}
}
}
}
// 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
- RightsManagementLicense.cs
- SchemaCollectionCompiler.cs
- GroupBox.cs
- oledbmetadatacolumnnames.cs
- XmlCharCheckingReader.cs
- PrincipalPermission.cs
- ListBox.cs
- BinaryObjectInfo.cs
- MDIControlStrip.cs
- PauseStoryboard.cs
- PromptEventArgs.cs
- UnicodeEncoding.cs
- ReaderWriterLockSlim.cs
- SrgsText.cs
- Group.cs
- CodeMethodInvokeExpression.cs
- StorageInfo.cs
- CompilerHelpers.cs
- ServicePointManagerElement.cs
- GatewayDefinition.cs
- TextStore.cs
- AsyncPostBackTrigger.cs
- FormatterConverter.cs
- ArgumentsParser.cs
- Decorator.cs
- WsatExtendedInformation.cs
- ViewBox.cs
- OutputCacheSettings.cs
- Enlistment.cs
- TabControl.cs
- ObjectItemCollection.cs
- TickBar.cs
- FrameworkContentElement.cs
- PrtTicket_Public_Simple.cs
- TransportChannelListener.cs
- KeySplineConverter.cs
- QualifiedCellIdBoolean.cs
- Internal.cs
- ApplyHostConfigurationBehavior.cs
- PopupControlService.cs
- DataServiceRequestOfT.cs
- VirtualizingStackPanel.cs
- StrongNameMembershipCondition.cs
- _ListenerRequestStream.cs
- Lasso.cs
- LineGeometry.cs
- SocketElement.cs
- Schema.cs
- EncoderParameters.cs
- Root.cs
- bidPrivateBase.cs
- TextBoxBase.cs
- DaylightTime.cs
- CacheMemory.cs
- InvokePattern.cs
- DeploymentSection.cs
- KeyboardNavigation.cs
- XsltArgumentList.cs
- cookiecollection.cs
- QueryOperationResponseOfT.cs
- EllipseGeometry.cs
- XmlAttributes.cs
- EntityContainerAssociationSetEnd.cs
- KeyEventArgs.cs
- PropertyEmitter.cs
- HasCopySemanticsAttribute.cs
- IssuedTokenClientBehaviorsElement.cs
- SqlRowUpdatingEvent.cs
- Compiler.cs
- FactoryId.cs
- CompiledIdentityConstraint.cs
- Debug.cs
- SyndicationElementExtension.cs
- BindingMemberInfo.cs
- HtmlTernaryTree.cs
- AmbientLight.cs
- HttpBindingExtension.cs
- EditCommandColumn.cs
- HMACSHA384.cs
- InvokeBinder.cs
- ResetableIterator.cs
- Root.cs
- DesignerHelpers.cs
- Hex.cs
- EntityObject.cs
- ScaleTransform.cs
- DbModificationCommandTree.cs
- SafeNativeMethods.cs
- AsymmetricKeyExchangeDeformatter.cs
- ReflectTypeDescriptionProvider.cs
- AnimationException.cs
- Stack.cs
- ProcessThread.cs
- CryptoApi.cs
- NameValuePermission.cs
- VerificationException.cs
- InputBinder.cs
- RectangleConverter.cs
- ListViewDataItem.cs
- DbConnectionPool.cs