Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Configuration / ServiceThrottlingElement.cs / 1 / ServiceThrottlingElement.cs
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
namespace System.ServiceModel.Configuration
{
using System.Configuration;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.Description;
using System.ServiceModel;
public sealed partial class ServiceThrottlingElement : BehaviorExtensionElement
{
public ServiceThrottlingElement()
{
}
[ConfigurationProperty(ConfigurationStrings.MaxConcurrentCalls, DefaultValue = ServiceThrottle.DefaultMaxConcurrentCalls)]
[IntegerValidator(MinValue = 1)]
public int MaxConcurrentCalls
{
get {return (int) base[ConfigurationStrings.MaxConcurrentCalls]; }
set {base[ConfigurationStrings.MaxConcurrentCalls] = value; }
}
[ConfigurationProperty(ConfigurationStrings.MaxConcurrentSessions, DefaultValue = ServiceThrottle.DefaultMaxConcurrentSessions)]
[IntegerValidator(MinValue = 1)]
public int MaxConcurrentSessions
{
get { return (int)base[ConfigurationStrings.MaxConcurrentSessions]; }
set { base[ConfigurationStrings.MaxConcurrentSessions] = value; }
}
[ConfigurationProperty(ConfigurationStrings.MaxConcurrentInstances, DefaultValue = ServiceThrottle.DefaultMaxConcurrentCalls + ServiceThrottle.DefaultMaxConcurrentSessions)]
[IntegerValidator(MinValue = 1)]
public int MaxConcurrentInstances
{
get {return (int) base[ConfigurationStrings.MaxConcurrentInstances]; }
set {base[ConfigurationStrings.MaxConcurrentInstances] = value; }
}
public override void CopyFrom(ServiceModelExtensionElement from)
{
base.CopyFrom(from);
ServiceThrottlingElement source = (ServiceThrottlingElement) from;
#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null
this.MaxConcurrentCalls = source.MaxConcurrentCalls;
this.MaxConcurrentSessions = source.MaxConcurrentSessions;
this.MaxConcurrentInstances = source.MaxConcurrentInstances;
}
protected internal override object CreateBehavior()
{
ServiceThrottlingBehavior behavior = new ServiceThrottlingBehavior();
behavior.MaxConcurrentCalls = this.MaxConcurrentCalls;
behavior.MaxConcurrentSessions = this.MaxConcurrentSessions;
PropertyInformationCollection propertyInfo = this.ElementInformation.Properties;
if (propertyInfo[ConfigurationStrings.MaxConcurrentInstances].ValueOrigin != PropertyValueOrigin.Default)
{
behavior.MaxConcurrentInstances = this.MaxConcurrentInstances;
}
return behavior;
}
public override Type BehaviorType
{
get { return typeof(ServiceThrottlingBehavior); }
}
}
}
// 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
- LocalizationComments.cs
- KeyFrames.cs
- BindingManagerDataErrorEventArgs.cs
- FileClassifier.cs
- RuntimeArgumentHandle.cs
- IdentitySection.cs
- BuildProvider.cs
- ObjectIDGenerator.cs
- CngProvider.cs
- FlowDocumentPage.cs
- CriticalHandle.cs
- SignatureResourcePool.cs
- MenuItemCollectionEditor.cs
- HttpContext.cs
- ProcessThreadCollection.cs
- AutoSizeToolBoxItem.cs
- SelectionHighlightInfo.cs
- NamedPipeActivation.cs
- ConnectionPoolRegistry.cs
- HMACRIPEMD160.cs
- PolicyManager.cs
- SequenceQuery.cs
- HostingPreferredMapPath.cs
- HashAlgorithm.cs
- DataKeyCollection.cs
- TextTreeObjectNode.cs
- BitmapFrame.cs
- _ScatterGatherBuffers.cs
- TrackingLocation.cs
- UserControlFileEditor.cs
- KnownTypesProvider.cs
- HttpApplicationFactory.cs
- XmlSchemaDatatype.cs
- TransformGroup.cs
- SqlTriggerAttribute.cs
- Material.cs
- JavaScriptObjectDeserializer.cs
- DataTableMappingCollection.cs
- BooleanFunctions.cs
- ObjectListGeneralPage.cs
- HttpPostServerProtocol.cs
- LabelDesigner.cs
- MetabaseReader.cs
- IIS7UserPrincipal.cs
- TimeZoneNotFoundException.cs
- MethodImplAttribute.cs
- FactoryGenerator.cs
- DbExpressionBuilder.cs
- ToolStripDropDownClosedEventArgs.cs
- OdbcDataReader.cs
- ValueType.cs
- WebContentFormatHelper.cs
- WpfPayload.cs
- EncoderBestFitFallback.cs
- SqlCommandBuilder.cs
- WindowsToolbar.cs
- DayRenderEvent.cs
- ProtocolsSection.cs
- HotCommands.cs
- CollectionViewGroup.cs
- PointHitTestParameters.cs
- CustomAssemblyResolver.cs
- BinarySerializer.cs
- DocumentationServerProtocol.cs
- TextBoxView.cs
- IntellisenseTextBox.designer.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- IsolatedStorageFile.cs
- CompressionTracing.cs
- OperationValidationEventArgs.cs
- SqlClientFactory.cs
- DataGridTable.cs
- SiteOfOriginContainer.cs
- DataGridViewRowsAddedEventArgs.cs
- DirectoryObjectSecurity.cs
- PageAsyncTaskManager.cs
- WorkflowViewElement.cs
- Peer.cs
- SpeakCompletedEventArgs.cs
- FillRuleValidation.cs
- __ComObject.cs
- TraceContextEventArgs.cs
- HttpGetProtocolImporter.cs
- MetadataArtifactLoaderFile.cs
- AuthenticationModeHelper.cs
- XmlSchemaType.cs
- ExplicitDiscriminatorMap.cs
- ConnectionPoint.cs
- SqlXmlStorage.cs
- PageSettings.cs
- DataObjectMethodAttribute.cs
- BooleanAnimationBase.cs
- BasicBrowserDialog.cs
- DSASignatureDeformatter.cs
- SapiRecognizer.cs
- WorkflowServiceAttributesTypeConverter.cs
- Duration.cs
- BaseValidator.cs
- ComponentChangingEvent.cs
- GridViewEditEventArgs.cs