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
- ImmutableObjectAttribute.cs
- AttributeEmitter.cs
- Rule.cs
- PropertyContainer.cs
- StreamGeometry.cs
- UnsafeNativeMethods.cs
- FormViewPagerRow.cs
- DiscardableAttribute.cs
- PersonalizationEntry.cs
- ColumnMapVisitor.cs
- PropertyManager.cs
- TableHeaderCell.cs
- GraphicsContext.cs
- DescendentsWalker.cs
- HttpModuleCollection.cs
- BitmapEditor.cs
- ControlCollection.cs
- Int32RectConverter.cs
- DataListItemCollection.cs
- VerificationAttribute.cs
- AdornerLayer.cs
- WebSysDescriptionAttribute.cs
- ReadOnlyHierarchicalDataSourceView.cs
- DataGridViewCellValueEventArgs.cs
- ToolBarButtonClickEvent.cs
- ValidationPropertyAttribute.cs
- WebPartCatalogCloseVerb.cs
- ContentElementAutomationPeer.cs
- SymmetricAlgorithm.cs
- TextParagraphProperties.cs
- DbConnectionPool.cs
- HostVisual.cs
- Imaging.cs
- XmlNavigatorStack.cs
- ConnectivityStatus.cs
- BufferedGraphicsManager.cs
- Header.cs
- LogicalExpr.cs
- StringReader.cs
- AccessDataSourceDesigner.cs
- ObjectDataSourceStatusEventArgs.cs
- XmlDataContract.cs
- DbReferenceCollection.cs
- iisPickupDirectory.cs
- ISAPIApplicationHost.cs
- CompiledQueryCacheEntry.cs
- DataTablePropertyDescriptor.cs
- DefaultValueConverter.cs
- MetadataItemSerializer.cs
- EventToken.cs
- input.cs
- BindUriHelper.cs
- FrameworkTemplate.cs
- VisualStyleElement.cs
- BinHexEncoder.cs
- IISMapPath.cs
- ColorBlend.cs
- XamlParser.cs
- FormsAuthenticationModule.cs
- Attributes.cs
- ApplicationId.cs
- LoginName.cs
- PixelShader.cs
- TableCellAutomationPeer.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- ComplexPropertyEntry.cs
- GeneralTransform3DTo2DTo3D.cs
- EventLogger.cs
- InfoCardServiceInstallComponent.cs
- TableLayoutSettingsTypeConverter.cs
- WindowsToolbarItemAsMenuItem.cs
- ScriptingRoleServiceSection.cs
- DbDataAdapter.cs
- ReceiveActivityValidator.cs
- ArgumentsParser.cs
- EnvelopedPkcs7.cs
- DataMemberFieldEditor.cs
- HMACSHA1.cs
- AttributeEmitter.cs
- Translator.cs
- CellRelation.cs
- DBCommand.cs
- SizeFConverter.cs
- UniqueIdentifierService.cs
- Cursors.cs
- SizeAnimationUsingKeyFrames.cs
- TextSelection.cs
- ellipse.cs
- MethodToken.cs
- BinaryUtilClasses.cs
- RoleGroup.cs
- DefaultShape.cs
- ControlPropertyNameConverter.cs
- MimeReflector.cs
- XmlLinkedNode.cs
- WindowAutomationPeer.cs
- QilGeneratorEnv.cs
- ValidationRuleCollection.cs
- FilterableData.cs
- PrtCap_Public_Simple.cs