|
Dieser Artikel wurde maschinell übersetzt. Bewegen Sie den Mauszeiger über die Sätze im Artikel, um den Originaltext anzuzeigen. Weitere Informationen
|
Übersetzung
Original
|
DynamicActivity-Klasse
.NET Framework 4.5
Namespace: System.Activities
Assembly: System.Activities (in System.Activities.dll)
Der DynamicActivity-Typ macht die folgenden Member verfügbar.
| Name | Beschreibung | |
|---|---|---|
![]() | DynamicActivity |
| Name | Beschreibung | |
|---|---|---|
![]() | Attributes | |
![]() | CacheId | |
![]() | Constraints | |
![]() | DisplayName | |
![]() | Id | |
![]() | Implementation | |
![]() | ImplementationVersion | |
![]() | Name | |
![]() | Properties |
| Name | Beschreibung | |
|---|---|---|
![]() | Equals(Object) | |
![]() | GetHashCode | |
![]() | GetType | |
![]() | ShouldSerializeDisplayName | |
![]() | ToString |
| Name | Beschreibung | |
|---|---|---|
![]() ![]() | ICustomTypeDescriptor.GetAttributes | |
![]() ![]() | ICustomTypeDescriptor.GetClassName | |
![]() ![]() | ICustomTypeDescriptor.GetComponentName | |
![]() ![]() | ICustomTypeDescriptor.GetConverter | |
![]() ![]() | ICustomTypeDescriptor.GetDefaultEvent | |
![]() ![]() | ICustomTypeDescriptor.GetDefaultProperty | |
![]() ![]() | ICustomTypeDescriptor.GetEditor | |
![]() ![]() | ICustomTypeDescriptor.GetEvents() | |
![]() ![]() | ICustomTypeDescriptor.GetEvents(Attribute[]) | |
![]() ![]() | ICustomTypeDescriptor.GetProperties() | |
![]() ![]() | ICustomTypeDescriptor.GetProperties(Attribute[]) | |
![]() ![]() | ICustomTypeDescriptor.GetPropertyOwner |
// 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>()) }, } }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core-Rolle wird nicht unterstützt), Windows Server 2008 R2 (Server Core-Rolle wird mit SP1 oder höher unterstützt; Itanium wird nicht unterstützt)
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen für .NET Framework.
