NativeActivity 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
런타임의 기능에 대한 모든 권한이 있는 메서드를 Execute(NativeActivityContext) 사용하여 실행 논리를 구현하는 사용자 지정 활동에 대한 추상 기본 클래스입니다.
public ref class NativeActivity abstract : System::Activities::Activity
public abstract class NativeActivity : System.Activities.Activity
type NativeActivity = class
inherit Activity
Public MustInherit Class NativeActivity
Inherits Activity
- 상속
- 파생
예제
다음 코드 샘플에서는 상속되는 클래스를 만드는 방법을 보여 줍니다 NativeActivity<TResult>. 이 예제는 네이 티브 작업 샘플을 사용하는 사용자 지정 복합 에서 가져옵니다.
public sealed class MySequence : NativeActivity
{
Collection<Activity> children;
Collection<Variable> variables;
Variable<int> currentIndex;
CompletionCallback onChildComplete;
public MySequence()
: base()
{
this.children = new Collection<Activity>();
this.variables = new Collection<Variable>();
this.currentIndex = new Variable<int>();
}
public Collection<Activity> Activities
{
get
{
return this.children;
}
}
public Collection<Variable> Variables
{
get
{
return this.variables;
}
}
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
//call base.CacheMetadata to add the Activities and Variables to this activity's metadata
base.CacheMetadata(metadata);
//add the private implementation variable: currentIndex
metadata.AddImplementationVariable(this.currentIndex);
}
protected override void Execute(NativeActivityContext context)
{
InternalExecute(context, null);
}
void InternalExecute(NativeActivityContext context, ActivityInstance instance)
{
//grab the index of the current Activity
int currentActivityIndex = this.currentIndex.Get(context);
if (currentActivityIndex == Activities.Count)
{
//if the currentActivityIndex is equal to the count of MySequence's Activities
//MySequence is complete
return;
}
if (this.onChildComplete == null)
{
//on completion of the current child, have the runtime call back on this method
this.onChildComplete = new CompletionCallback(InternalExecute);
}
//grab the next Activity in MySequence.Activities and schedule it
Activity nextChild = Activities[currentActivityIndex];
context.ScheduleActivity(nextChild, this.onChildComplete);
//increment the currentIndex
this.currentIndex.Set(context, ++currentActivityIndex);
}
}
생성자
| Name | Description |
|---|---|
| NativeActivity() |
파생 클래스에서 구현되는 경우 파생 클래스의 새 인스턴스를 만듭니다. |
속성
| Name | Description |
|---|---|
| CacheId |
워크플로 정의 범위 내에서 고유한 캐시의 식별자를 가져옵니다. (다음에서 상속됨 Activity) |
| CanInduceIdle |
작업으로 인해 워크플로가 유휴 상태가 될 수 있는지 여부를 나타내는 값을 가져오거나 설정합니다. |
| Constraints |
에 대한 Constraint유효성 검사를 제공하도록 구성할 수 있는 활동 컬렉션을 Activity 가져옵니다. (다음에서 상속됨 Activity) |
| DisplayName |
디버깅, 유효성 검사, 예외 처리 및 추적에 사용되는 선택적 친숙한 이름을 가져오거나 설정합니다. (다음에서 상속됨 Activity) |
| Id |
워크플로 정의의 범위에서 고유한 식별자를 가져옵니다. (다음에서 상속됨 Activity) |
| Implementation |
활동의 실행 논리입니다. |
| ImplementationVersion |
활동의 구현 버전을 가져오거나 설정합니다. |