DynamicActivity Classe
Definição
Fornece um modelo de objeto que permite construir dinamicamente atividades que fazem interface com o designer do WF e o runtime usando ICustomTypeDescriptor.Provides an object model that allows you to construct activities dynamically that interface with the WF designer and runtime using ICustomTypeDescriptor.
public ref class DynamicActivity sealed : System::Activities::Activity, System::ComponentModel::ICustomTypeDescriptor
[System.Windows.Markup.ContentProperty("Implementation")]
public sealed class DynamicActivity : System.Activities.Activity, System.ComponentModel.ICustomTypeDescriptor
[<System.Windows.Markup.ContentProperty("Implementation")>]
type DynamicActivity = class
inherit Activity
interface ICustomTypeDescriptor
Public NotInheritable Class DynamicActivity
Inherits Activity
Implements ICustomTypeDescriptor
- Herança
- Atributos
- Implementações
Exemplos
O exemplo a seguir mostra como criar um DynamicActivity .The following example shows how to create a DynamicActivity.
// Variables
var iterationVariable = new DelegateInArgument<int>() { Name = "iterationVariable" };
var accumulator = new Variable<int>() { Default = 0, Name = "accumulator" };
// Define the Input and Output arguments that the DynamicActivity binds to
var numbers = new InArgument<List<int>>();
var average = new OutArgument<double>();
var result = new Variable<double>() { Name = "result" };
return new DynamicActivity()
{
DisplayName = "Find average",
Properties =
{
// Input argument
new DynamicActivityProperty
{
Name = "Numbers",
Type = typeof(InArgument<List<int>>),
Value = numbers
},
// Output argument
new DynamicActivityProperty
{
Name = "Average",
Type = typeof(OutArgument<double>),
Value = average
}
},
Implementation = () =>
new Sequence
{
Variables = { result, accumulator },
Activities =
{
new ForEach<int>
{
Values = new ArgumentValue<IEnumerable<int>> { ArgumentName = "Numbers" },
Body = new ActivityAction<int>
{
Argument = iterationVariable,
Handler = new Assign<int>
{
To = accumulator,
Value = new InArgument<int>(env => iterationVariable.Get(env) + accumulator.Get(env))
}
}
},
// Calculate the average and assign to the output argument.
new Assign<double>
{
To = new ArgumentReference<double> { ArgumentName = "Average" },
Value = new InArgument<double>(env => accumulator.Get(env) / numbers.Get(env).Count<int>())
},
}
}
Construtores
| DynamicActivity() |
Cria uma nova instância da classe DynamicActivity.Creates a new instance of the DynamicActivity class. |
Propriedades
| Attributes |
Obtém a coleção de atributos da atividade gerada dinamicamente.Gets the collection of attributes of the dynamically generated activity. |
| CacheId |
Obtém um identificador do cache que é exclusivo no escopo da definição do fluxo de trabalho.Gets the identifier of the cache that is unique within the scope of the workflow definition. (Herdado de Activity) |
| Constraints |
Retorna uma coleção de atividades Constraint que são configuradas para fornecer validação para a DynamicActivity.Returns a collection of Constraint activities that are configured to provide validation for the DynamicActivity. |
| DisplayName |
Obtém ou define um nome amigável opcional que é usado para depuração, validação, manipulação de exceções e acompanhamento.Gets or sets an optional friendly name that is used for debugging, validation, exception handling, and tracking. (Herdado de Activity) |
| Id |
Obtém um identificador que é exclusivo no escopo da definição do fluxo de trabalho.Gets an identifier that is unique in the scope of the workflow definition. (Herdado de Activity) |
| Implementation |
Obtém ou define a lógica de execução da atividade.Gets or sets the execution logic of the activity. |
| ImplementationVersion |
Obtém ou define a versão de implementação da atividade.Gets or sets the implementation version of the activity. |
| ImplementationVersion |
Obtém ou define a versão de implementação usada.Gets or sets the version of the implementation used. (Herdado de Activity) |
| Name |
O nome a ser exibido para a atividade no designer de fluxo de trabalho.The name to be displayed for the activity in the workflow designer. |
| Properties |
Obtém a coleção de propriedades que são mapeadas para os argumentos da atividade gerada dinamicamente.Gets the collection of properties that map to the arguments of the dynamically generated activity. |
Métodos
| CacheMetadata(ActivityMetadata) |
Cria e valida uma descrição dos argumentos, das variáveis, das atividades filho e dos representantes da atividade.Creates and validates a description of the activity's arguments, variables, child activities, and activity delegates. (Herdado de Activity) |
| Equals(Object) |
Determina se o objeto especificado é igual ao objeto atual.Determines whether the specified object is equal to the current object. (Herdado de Object) |
| GetHashCode() |
Serve como a função de hash padrão.Serves as the default hash function. (Herdado de Object) |
| GetType() |
Obtém o Type da instância atual.Gets the Type of the current instance. (Herdado de Object) |
| MemberwiseClone() |
Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object. (Herdado de Object) |
| OnCreateDynamicUpdateMap(UpdateMapMetadata, Activity) |
Gera um evento ao criar o mapa de atualização dinâmica.Raises an event when creating dynamic update map. (Herdado de Activity) |
| ShouldSerializeDisplayName() |
Indica se a propriedade DisplayName deve ser serializada.Indicates whether the DisplayName property should be serialized. (Herdado de Activity) |
| ToString() |
Retorna um String que contém o Id e DisplayName do Activity.Returns a String that contains the Id and DisplayName of the Activity. (Herdado de Activity) |
Implantações explícitas de interface
| ICustomTypeDescriptor.GetAttributes() |
Retorna uma coleção de atributos da atividade dinâmica.Returns a collection of attributes of the dynamic activity. |
| ICustomTypeDescriptor.GetClassName() |
Retorna o nome de classe da atividade dinâmica.Returns the class name of the dynamic activity. |
| ICustomTypeDescriptor.GetComponentName() |
Retorna o nome do componente da atividade dinâmica.Returns the component name of the dynamic activity. |
| ICustomTypeDescriptor.GetConverter() |
Retorna um conversor de tipo da atividade dinâmica.Returns a type converter for the dynamic activity. |
| ICustomTypeDescriptor.GetDefaultEvent() |
Retorna o evento padrão da atividade dinâmica.Returns the default event for the dynamic activity. |
| ICustomTypeDescriptor.GetDefaultProperty() |
Retorna a propriedade padrão da atividade dinâmica.Returns the default property for the dynamic activity. |
| ICustomTypeDescriptor.GetEditor(Type) |
Retorna um editor com o tipo base especificado.Returns an editor with the specified base type. |
| ICustomTypeDescriptor.GetEvents() |
Retorna a coleção de eventos da atividade dinâmica.Returns the collection of events of the dynamic activity. |
| ICustomTypeDescriptor.GetEvents(Attribute[]) |
Retorna a coleção de eventos da atividade dinâmica usando uma matriz de atributos especificada como um filtro.Returns the collection of events of the dynamic activity using a specified array of attributes as a filter. |
| ICustomTypeDescriptor.GetProperties() |
Retorna a coleção de propriedades da atividade dinâmica.Returns the collection of properties of the dynamic activity. |
| ICustomTypeDescriptor.GetProperties(Attribute[]) |
Retorna a coleção de propriedades de atividade dinâmica usando uma matriz de atributos especificada como um filtro.Returns the collection of properties of the dynamic activity using a specified array of attributes as a filter. |
| ICustomTypeDescriptor.GetPropertyOwner(PropertyDescriptor) |
Retorna esta instância da classe DynamicActivity.Returns this instance of the DynamicActivity class. |