Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Configuration / PeerTransportElement.cs / 1 / PeerTransportElement.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Configuration { using System.Net; using System.Configuration; using System.ServiceModel; using System.ServiceModel.Channels; public partial class PeerTransportElement : BindingElementExtensionElement { public PeerTransportElement() { } public override Type BindingElementType { get { return typeof(PeerTransportBindingElement); } } [ConfigurationProperty(ConfigurationStrings.ListenIPAddress, DefaultValue = PeerTransportDefaults.ListenIPAddress)] [System.ComponentModel.TypeConverter(typeof(PeerTransportListenAddressConverter))] [PeerTransportListenAddressValidator()] public IPAddress ListenIPAddress { get { return (IPAddress)base[ConfigurationStrings.ListenIPAddress]; } set { base[ConfigurationStrings.ListenIPAddress] = value; } } [ConfigurationProperty(ConfigurationStrings.MaxBufferPoolSize, DefaultValue = TransportDefaults.MaxBufferPoolSize)] [LongValidator(MinValue = 1)] public long MaxBufferPoolSize { get { return (long)base[ConfigurationStrings.MaxBufferPoolSize]; } set { base[ConfigurationStrings.MaxBufferPoolSize] = value; } } [ConfigurationProperty(ConfigurationStrings.MaxReceivedMessageSize, DefaultValue = TransportDefaults.MaxReceivedMessageSize)] [LongValidator(MinValue = 1)] public long MaxReceivedMessageSize { get { return (long)base[ConfigurationStrings.MaxReceivedMessageSize]; } set { base[ConfigurationStrings.MaxReceivedMessageSize] = value; } } [ConfigurationProperty(ConfigurationStrings.Port, DefaultValue = PeerTransportDefaults.Port)] [IntegerValidator(MinValue = PeerTransportConstants.MinPort, MaxValue = PeerTransportConstants.MaxPort)] public int Port { get { return (int) base[ConfigurationStrings.Port]; } set { base[ConfigurationStrings.Port] = value; } } [ConfigurationProperty(ConfigurationStrings.Security)] public PeerSecurityElement Security { get { return (PeerSecurityElement)base[ConfigurationStrings.Security]; } } public override void ApplyConfiguration(BindingElement bindingElement) { base.ApplyConfiguration(bindingElement); PeerTransportBindingElement binding = (PeerTransportBindingElement)bindingElement; binding.ListenIPAddress= this.ListenIPAddress; binding.Port = this.Port; binding.MaxBufferPoolSize = this.MaxBufferPoolSize; binding.MaxReceivedMessageSize = this.MaxReceivedMessageSize; #pragma warning suppress 56506 //[....]; base.ApplyConfiguration() checks for 'binding' being null this.Security.ApplyConfiguration(binding.Security); } public override void CopyFrom(ServiceModelExtensionElement from) { base.CopyFrom(from); PeerTransportElement source = (PeerTransportElement) from; #pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument this.ListenIPAddress = source.ListenIPAddress; this.Port = source.Port; this.MaxBufferPoolSize = source.MaxBufferPoolSize; this.MaxReceivedMessageSize = source.MaxReceivedMessageSize; this.Security.CopyFrom(source.Security); } protected internal override BindingElement CreateBindingElement() { PeerTransportBindingElement binding = new PeerTransportBindingElement(); this.ApplyConfiguration(binding); return binding; } protected internal override void InitializeFrom(BindingElement bindingElement) { base.InitializeFrom(bindingElement); PeerTransportBindingElement binding = (PeerTransportBindingElement)bindingElement; this.ListenIPAddress= binding.ListenIPAddress; this.Port = binding.Port; this.MaxBufferPoolSize = binding.MaxBufferPoolSize; this.MaxReceivedMessageSize = binding.MaxReceivedMessageSize; this.Security.InitializeFrom(binding.Security); } } } // 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
- StatusBarItemAutomationPeer.cs
- MimeTypeMapper.cs
- DbProviderFactory.cs
- WebPartConnectionsConfigureVerb.cs
- Vector3D.cs
- RuleDefinitions.cs
- InlineUIContainer.cs
- ClientRuntimeConfig.cs
- XmlSortKey.cs
- OleDbTransaction.cs
- NativeStructs.cs
- CopyAttributesAction.cs
- DaylightTime.cs
- AuthenticatingEventArgs.cs
- DataGridViewAdvancedBorderStyle.cs
- AdornerDecorator.cs
- DataGridViewElement.cs
- DataSourceSelectArguments.cs
- ShapeTypeface.cs
- GenericPrincipal.cs
- DataGridViewCellCollection.cs
- StylusPointProperty.cs
- MulticastIPAddressInformationCollection.cs
- ThousandthOfEmRealDoubles.cs
- GenericXmlSecurityTokenAuthenticator.cs
- DbConnectionStringBuilder.cs
- ExpressionVisitorHelpers.cs
- TypeValidationEventArgs.cs
- CodeTypeReference.cs
- DataBoundControlActionList.cs
- NameValuePermission.cs
- OdbcException.cs
- StatusStrip.cs
- WebPartConnectionsCancelEventArgs.cs
- Point3DIndependentAnimationStorage.cs
- RectKeyFrameCollection.cs
- TextTreeTextNode.cs
- ConnectionManagementSection.cs
- EventsTab.cs
- WmfPlaceableFileHeader.cs
- MetadataSource.cs
- DataObjectFieldAttribute.cs
- SchemaComplexType.cs
- HttpListenerResponse.cs
- ListView.cs
- FastEncoder.cs
- ADMembershipProvider.cs
- PagedDataSource.cs
- OpacityConverter.cs
- BaseCollection.cs
- ProxyHelper.cs
- Label.cs
- ObservableCollectionDefaultValueFactory.cs
- NavigateEvent.cs
- SplitterEvent.cs
- ThreadExceptionEvent.cs
- ForeignKeyConstraint.cs
- AQNBuilder.cs
- IntPtr.cs
- ToolboxItemFilterAttribute.cs
- XmlSchemaInclude.cs
- _ListenerResponseStream.cs
- GeneralTransform3D.cs
- ListenerElementsCollection.cs
- X509CertificateClaimSet.cs
- EventBuilder.cs
- SubqueryRules.cs
- WindowsImpersonationContext.cs
- DeviceFilterEditorDialog.cs
- ConstraintStruct.cs
- StickyNoteHelper.cs
- DictionaryEntry.cs
- Rect.cs
- OdbcConnectionFactory.cs
- ContextActivityUtils.cs
- X509DefaultServiceCertificateElement.cs
- SetterBase.cs
- LookupNode.cs
- TextClipboardData.cs
- TableLayoutSettings.cs
- OrCondition.cs
- FullTextState.cs
- Vector.cs
- CodeBlockBuilder.cs
- CodeAttachEventStatement.cs
- TraceSection.cs
- TypeDependencyAttribute.cs
- DataGridPreparingCellForEditEventArgs.cs
- DataGridRowsPresenter.cs
- ObjectParameterCollection.cs
- PropertyPanel.cs
- TableLayoutSettings.cs
- HtmlContainerControl.cs
- SecurityContextKeyIdentifierClause.cs
- Number.cs
- ListChangedEventArgs.cs
- WizardPanelChangingEventArgs.cs
- ConvertersCollection.cs
- XPathNodePointer.cs
- FilterEventArgs.cs