Files
dotnet-bot adf899c629 Adding System.Data..., System.ServiceModel..., and System.Web...
Adding reference source for
System.Data
System.Data.DataSetExtensions
System.Data.Entity
System.Data.Entity.Design
System.Data.Linq
System.Data.SqlXml
System.ServiceModel
System.ServiceModel.Activation
System.ServiceModel.Activities
System.ServiceModel.Channels
System.ServiceModel.Discovery
System.ServiceModel.Internals
System.ServiceModel.Routing
System.ServiceModel.WasHosting
System.ServiceModel.Web
System.Web
System.Web.ApplicationServices
System.Web.DynamicData
System.Web.Entity
System.Web.Entity.Design
System.Web.Extensions
System.Web.Mobile
System.Web.Routing
System.Web.Services
System.Xml
System.Xml.Linq
2016-05-03 00:07:37 +02:00

80 lines
3.4 KiB
C#

//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
namespace System.ServiceModel.Activities.Configuration
{
using System.ComponentModel;
using System.Configuration;
using System.Runtime;
using System.ServiceModel.Activities;
using System.ServiceModel.Activities.Description;
using System.ServiceModel.Configuration;
public sealed class SendMessageChannelCacheElement : BehaviorExtensionElement
{
ConfigurationPropertyCollection properties;
public SendMessageChannelCacheElement()
{
}
[ConfigurationProperty(ConfigurationStrings.AllowUnsafeCaching, DefaultValue = ChannelCacheDefaults.DefaultAllowUnsafeSharing)]
public bool AllowUnsafeCaching
{
get { return (bool)base[ConfigurationStrings.AllowUnsafeCaching]; }
set { base[ConfigurationStrings.AllowUnsafeCaching] = value; }
}
[ConfigurationProperty(ConfigurationStrings.FactorySettings)]
public FactorySettingsElement FactorySettings
{
get { return (FactorySettingsElement)base[ConfigurationStrings.FactorySettings]; }
}
[ConfigurationProperty(ConfigurationStrings.ChannelSettings)]
public ChannelSettingsElement ChannelSettings
{
get { return (ChannelSettingsElement)base[ConfigurationStrings.ChannelSettings]; }
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Configuration", "Configuration102:ConfigurationPropertyAttributeRule", MessageId = "System.ServiceModel.Activities.Configuration.SendMessageChannelCacheElement.BehaviorType", Justification = "Not a configurable property; a property that had to be overridden from abstract parent class")]
public override Type BehaviorType
{
get { return typeof(SendMessageChannelCacheBehavior); }
}
protected override ConfigurationPropertyCollection Properties
{
get
{
if (this.properties == null)
{
ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection();
properties.Add(new ConfigurationProperty(ConfigurationStrings.AllowUnsafeCaching, typeof(bool), ChannelCacheDefaults.DefaultAllowUnsafeSharing));
properties.Add(new ConfigurationProperty(ConfigurationStrings.FactorySettings, typeof(FactorySettingsElement)));
properties.Add(new ConfigurationProperty(ConfigurationStrings.ChannelSettings, typeof(ChannelSettingsElement)));
this.properties = properties;
}
return this.properties;
}
}
protected internal override object CreateBehavior()
{
return new SendMessageChannelCacheBehavior()
{
AllowUnsafeCaching = this.AllowUnsafeCaching,
FactorySettings = new ChannelCacheSettings { IdleTimeout = FactorySettings.IdleTimeout, LeaseTimeout = FactorySettings.LeaseTimeout, MaxItemsInCache = FactorySettings.MaxItemsInCache },
ChannelSettings = new ChannelCacheSettings { IdleTimeout = ChannelSettings.IdleTimeout, LeaseTimeout = ChannelSettings.LeaseTimeout, MaxItemsInCache = ChannelSettings.MaxItemsInCache }
};
}
}
}