You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
parent
a569aebcfd
commit
e79aa3c0ed
@ -0,0 +1,117 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <copyright file="WorkflowRuntimeSection.cs" company="Microsoft">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Collections.Specialized;
|
||||
|
||||
using System.Workflow.Runtime;
|
||||
|
||||
namespace System.Workflow.Runtime.Configuration
|
||||
{
|
||||
/// <summary> Configuration settings for the WorkflowRuntime </summary>
|
||||
/// <remarks><para>
|
||||
/// Services that are automatically instantiated must implement one of the
|
||||
/// following constructors:
|
||||
/// <code>
|
||||
/// public MyService();
|
||||
/// public MyService(NameValueCollection);
|
||||
/// public MyService(WorkflowRuntime);
|
||||
/// public MyService(WorkflowRuntime, NameValueCollection);
|
||||
/// </code>
|
||||
/// </para></remarks>
|
||||
/// <see cref="System.Workflow.Runtime.Hosting.WorkflowRuntime"/>
|
||||
/// <see cref="System.Workflow.Runtime.Hosting.WorkflowRuntimeServiceSettings"/>
|
||||
/// <see cref="System.Workflow.Runtime.Hosting.WorkflowRuntimeServiceSettingsCollection"/>
|
||||
/// <see cref="System.Configuration.ConfigurationSection"/>
|
||||
[Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")]
|
||||
public class WorkflowRuntimeSection : ConfigurationSection
|
||||
{
|
||||
private const string _services = "Services";
|
||||
private const string commonParametersSectionName = "CommonParameters";
|
||||
private const string _name = "Name";
|
||||
private const string _validateOnCreate = "ValidateOnCreate";
|
||||
private const string _enablePerfCounters = "EnablePerformanceCounters";
|
||||
private const string _definitionCacheCapacity = "WorkflowDefinitionCacheCapacity";
|
||||
|
||||
internal const string DefaultSectionName = "WorkflowRuntime";
|
||||
|
||||
/// <summary> The capacity of WorkflowDefinition cache </summary>
|
||||
[ConfigurationProperty(_definitionCacheCapacity, DefaultValue = 0)]
|
||||
public int WorkflowDefinitionCacheCapacity
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)base[_definitionCacheCapacity];
|
||||
}
|
||||
set
|
||||
{
|
||||
base[_definitionCacheCapacity] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> The name of the service container </summary>
|
||||
[ConfigurationProperty(_name, DefaultValue = "")]
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)base[_name];
|
||||
}
|
||||
set
|
||||
{
|
||||
base[_name] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[ConfigurationProperty(_validateOnCreate, DefaultValue = true)]
|
||||
public bool ValidateOnCreate
|
||||
{
|
||||
get
|
||||
{
|
||||
return (bool)base[_validateOnCreate];
|
||||
}
|
||||
set
|
||||
{
|
||||
base[_validateOnCreate] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[ConfigurationProperty(_enablePerfCounters, DefaultValue = true)]
|
||||
public bool EnablePerformanceCounters
|
||||
{
|
||||
get
|
||||
{
|
||||
return (bool)base[_enablePerfCounters];
|
||||
}
|
||||
set
|
||||
{
|
||||
base[_enablePerfCounters] = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary> The providers to be instantiated by the service container. </summary>
|
||||
[ConfigurationProperty(_services, DefaultValue = null)]
|
||||
public WorkflowRuntimeServiceElementCollection Services
|
||||
{
|
||||
get
|
||||
{
|
||||
return (WorkflowRuntimeServiceElementCollection)base[_services];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> The resources to be shared by the services. </summary>
|
||||
[ConfigurationProperty(WorkflowRuntimeSection.commonParametersSectionName, DefaultValue = null)]
|
||||
public NameValueConfigurationCollection CommonParameters
|
||||
{
|
||||
get
|
||||
{
|
||||
return (NameValueConfigurationCollection)base[WorkflowRuntimeSection.commonParametersSectionName];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <copyright file="WorkflowRuntimeServiceSettings.cs" company="Microsoft">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Collections.Specialized;
|
||||
|
||||
|
||||
namespace System.Workflow.Runtime.Configuration
|
||||
{
|
||||
/// <summary> Configuration element for a WorkflowRuntime service </summary>
|
||||
[Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")]
|
||||
public class WorkflowRuntimeServiceElement : ConfigurationElement
|
||||
{
|
||||
|
||||
/// <summary> Collection of service-specific name-value pairs </summary>
|
||||
private NameValueCollection _parameters = new NameValueCollection();
|
||||
|
||||
private const string _type = "type";
|
||||
|
||||
public NameValueCollection Parameters
|
||||
{
|
||||
get { return _parameters; }
|
||||
}
|
||||
|
||||
public WorkflowRuntimeServiceElement()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary> The assembly-qualified type name of the service </summary>
|
||||
/// <remarks> Type is also used as the collection key in WorkflowRuntimeServiceSettingsCollections </remarks>
|
||||
[ConfigurationProperty(_type, DefaultValue = null)]
|
||||
public string Type
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)base[_type];
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
throw new ArgumentNullException("value");
|
||||
|
||||
base[_type] = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected override bool OnDeserializeUnrecognizedAttribute(string name, string value)
|
||||
{
|
||||
_parameters.Add(name, value);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <copyright file="WorkflowRuntimeServiceSettingsCollection.cs" company="Microsoft">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Configuration;
|
||||
|
||||
|
||||
namespace System.Workflow.Runtime.Configuration
|
||||
{
|
||||
/// <summary> Collection of WorkflowRuntimeServiceSettings used by WorkflowRuntimeSection </summary>
|
||||
[Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")]
|
||||
public class WorkflowRuntimeServiceElementCollection : ConfigurationElementCollection
|
||||
{
|
||||
/// <summary> Creates a new WorkflowRuntimeServiceSettings object </summary>
|
||||
/// <returns> An empty WorkflowRuntimeServiceSettings </returns>
|
||||
protected override ConfigurationElement CreateNewElement()
|
||||
{
|
||||
return new WorkflowRuntimeServiceElement();
|
||||
}
|
||||
|
||||
/// <summary> Returns the Type of the WorkflowRuntimeServiceSettings object </summary>
|
||||
/// <param name="settings"> The WorkflowRuntimeServiceSettings </param>
|
||||
/// <returns> The Type name of the WorkflowRuntimeServiceSettings </returns>
|
||||
protected override object GetElementKey(ConfigurationElement settings)
|
||||
{
|
||||
return ((WorkflowRuntimeServiceElement)settings).Type;
|
||||
}
|
||||
|
||||
/// <summary> Adds a WorkflowRuntimeServiceSettings object to this collection </summary>
|
||||
/// <param name="settings"> The settings object to add </param>
|
||||
public void Add(WorkflowRuntimeServiceElement serviceSettings)
|
||||
{
|
||||
if (serviceSettings == null)
|
||||
throw new ArgumentNullException("serviceSettings");
|
||||
|
||||
base.BaseAdd(serviceSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user