Variable<T> Класс
Определение
Представляет переменную в рабочем процессе.Represents a variable in a workflow.
generic <typename T>
public ref class Variable sealed : System::Activities::Variable
public sealed class Variable<T> : System.Activities.Variable
type Variable<'T> = class
inherit Variable
Public NotInheritable Class Variable(Of T)
Inherits Variable
Параметры типа
- T
Type выражения Variable<T>.The Type of the Variable<T>.
- Наследование
Примеры
В этом примере в объекте Variable<T> хранится строка сообщения.In this example, a Variable<T> is used to hold a message string. Это сообщение выводится в окно консоли посредством действия WriteLine.This message is written to the console window by a WriteLine activity.
Variable<string> msg =
new Variable<string>() { Default = "Hello World!" };
Activity wf = new Sequence()
{
Variables =
{
msg
},
Activities =
{
new WriteLine()
{
Text = msg
}
}
};
Конструкторы
Variable<T>() |
Инициализирует новый экземпляр класса Variable<T>.Initializes a new instance of the Variable<T> class. |
Variable<T>(Expression<Func<ActivityContext,T>>) |
Инициализирует новый экземпляр класса Variable<T> с выражением по умолчанию.Initializes a new instance of the Variable<T> class with the default expression. |
Variable<T>(String) |
Инициализирует новый экземпляр класса Variable<T> с именем переменной.Initializes a new instance of the Variable<T> class with the variable name. |
Variable<T>(String, Expression<Func<ActivityContext,T>>) |
Инициализирует новый экземпляр класса Variable<T> с именем переменной и выражением по умолчанию.Initializes a new instance of the Variable<T> class with the variable name and default expression. |
Variable<T>(String, T) |
Инициализирует новый экземпляр класса Variable<T> с именем переменной и значением по умолчанию.Initializes a new instance of the Variable<T> class with the variable name and default value. |
Свойства
Default |
Возвращает или задает объект Activity<TResult>, представляющий значение по умолчанию для данного объекта Variable<T>.Gets or sets the Activity<TResult> that represents the default value for this Variable<T>. |
Modifiers |
Возвращает или задает значение VariableModifiers для этой переменной Variable.Gets or sets the VariableModifiers value for this Variable. (Унаследовано от Variable) |
Name |
Возвращает или задает имя таблицы для объекта Variable.Gets or sets the name of the Variable. (Унаследовано от Variable) |
NameCore |
Возвращает имя объекта Variable.Gets the name of the Variable. (Унаследовано от Variable) |
Type |
Возвращает или задает тип LocationReference.Gets or sets the type of the LocationReference. (Унаследовано от LocationReference) |
TypeCore |
При реализации в производном классе возвращает или задает версию типа объекта LocationReference, локализованную с учетом национальных стандартов.When implemented in a derived class, gets or sets the culturally localized version of the type of the LocationReference. (Унаследовано от LocationReference) |
Методы
Equals(Object) |
Определяет, равен ли указанный объект текущему объекту.Determines whether the specified object is equal to the current object. (Унаследовано от Object) |
Get(ActivityContext) |
Возвращает значение переменной с использованием указанного ActivityContext.Gets the value of the variable using the specified ActivityContext. |
GetHashCode() |
Служит в качестве хэш-функции по умолчанию.Serves as the default hash function. (Унаследовано от Object) |
GetLocation(ActivityContext) |
Возвращает объект Location<T> для переменной.Returns the Location<T> of the variable. |
GetType() |
Возвращает объект Type для текущего экземпляра.Gets the Type of the current instance. (Унаследовано от Object) |
MemberwiseClone() |
Создает неполную копию текущего объекта Object.Creates a shallow copy of the current Object. (Унаследовано от Object) |
Set(ActivityContext, Object) |
Задает значение переменной Variable с использованием указанного контекста ActivityContext.Sets the value of the Variable using the specified ActivityContext. (Унаследовано от Variable) |
Set(ActivityContext, T) |
Задает значение переменной.Sets the value of the variable. |
ToString() |
Возвращает строку, представляющую текущий объект.Returns a string that represents the current object. (Унаследовано от Object) |