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
- PropertyPathWorker.cs
- RoutedPropertyChangedEventArgs.cs
- PreviewPrintController.cs
- LocalizableAttribute.cs
- WebServiceAttribute.cs
- DataTableClearEvent.cs
- MachineKeySection.cs
- SharedPersonalizationStateInfo.cs
- SessionPageStateSection.cs
- PolyLineSegment.cs
- DataBoundLiteralControl.cs
- DataPagerCommandEventArgs.cs
- SmtpFailedRecipientsException.cs
- OleCmdHelper.cs
- PersonalizationStateInfo.cs
- DataSourceHelper.cs
- StylusButtonCollection.cs
- RegexMatch.cs
- DurableInstancingOptions.cs
- ExecutionContext.cs
- TableLayoutCellPaintEventArgs.cs
- HoistedLocals.cs
- ADRoleFactory.cs
- SchemaTypeEmitter.cs
- UTF32Encoding.cs
- PolyLineSegmentFigureLogic.cs
- ObjectDataSourceDesigner.cs
- VoiceChangeEventArgs.cs
- HasCopySemanticsAttribute.cs
- ListViewItem.cs
- CapabilitiesAssignment.cs
- RegexWorker.cs
- VerificationException.cs
- CapabilitiesUse.cs
- SessionPageStatePersister.cs
- ShutDownListener.cs
- StandardBindingCollectionElement.cs
- KeyConverter.cs
- TemplatePagerField.cs
- ZoneButton.cs
- MarkupCompilePass1.cs
- ObjectSet.cs
- MenuCommandsChangedEventArgs.cs
- UnsafeNativeMethods.cs
- ErrorLog.cs
- CancellationTokenSource.cs
- PermissionListSet.cs
- Italic.cs
- CodeNamespaceCollection.cs
- SqlMetaData.cs
- TableLayoutPanelCodeDomSerializer.cs
- followingquery.cs
- IdentitySection.cs
- BaseCodeDomTreeGenerator.cs
- MsmqBindingElementBase.cs
- RecommendedAsConfigurableAttribute.cs
- DataControlButton.cs
- BaseUriHelper.cs
- CurrencyWrapper.cs
- TimeSpan.cs
- AppSecurityManager.cs
- StrongNameKeyPair.cs
- QilStrConcatenator.cs
- OutputCacheProfile.cs
- GridViewRowPresenterBase.cs
- QueryCursorEventArgs.cs
- RoutedEventValueSerializer.cs
- XmlDomTextWriter.cs
- SecureStringHasher.cs
- WinInetCache.cs
- XmlNode.cs
- LogoValidationException.cs
- EpmCustomContentDeSerializer.cs
- RepeaterItemEventArgs.cs
- PerformanceCounterLib.cs
- ModuleConfigurationInfo.cs
- DiscoveryReferences.cs
- QueuePathDialog.cs
- CollectionConverter.cs
- CaseStatementSlot.cs
- SettingsAttributeDictionary.cs
- ListDataHelper.cs
- SortedList.cs
- DoubleSumAggregationOperator.cs
- ExceptionUtil.cs
- PasswordTextContainer.cs
- WebScriptMetadataMessageEncodingBindingElement.cs
- SqlCommandSet.cs
- OutputWindow.cs
- DoubleLinkList.cs
- DbReferenceCollection.cs
- PointAnimationUsingPath.cs
- LicenseContext.cs
- WindowsScroll.cs
- ExpressionEditorAttribute.cs
- HwndSourceParameters.cs
- TextEditorTyping.cs
- TabControlAutomationPeer.cs
- TrackingServices.cs
- DbConnectionHelper.cs