File: WorkflowRuntimeSection.cs

package info (click to toggle)
mono 6.14.1%2Bds2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,282,732 kB
  • sloc: cs: 11,182,461; xml: 2,850,281; ansic: 699,123; cpp: 122,919; perl: 58,604; javascript: 30,841; asm: 21,845; makefile: 19,602; sh: 10,973; python: 4,772; pascal: 925; sql: 859; sed: 16; php: 1
file content (117 lines) | stat: -rw-r--r-- 4,147 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
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];
            }
        }
    }
}