WorkflowApplication.ResumeBookmark 메서드

정의

책갈피를 다시 시작하기 위한 작업을 시작합니다.

오버로드

ResumeBookmark(String, Object, TimeSpan)

지정한 값 및 시간 제한 간격을 사용하여 지정한 이름의 책갈피를 다시 시작하기 위한 작업을 시작합니다. 다시 시작할 책갈피는 워크플로 인스턴스 내의 작업에서 이전에 만든 것입니다.

ResumeBookmark(Bookmark, Object, TimeSpan)

지정한 값 및 시간 제한 간격을 사용하여 지정한 책갈피를 다시 시작하기 위한 작업을 시작합니다. 다시 시작할 책갈피는 워크플로 인스턴스 내의 작업에서 이전에 만든 것입니다.

ResumeBookmark(Bookmark, Object)

지정한 값을 사용하여 지정한 책갈피를 다시 시작하기 위한 작업을 시작합니다. 다시 시작할 책갈피는 워크플로 인스턴스 내의 작업에서 이전에 만든 것입니다.

ResumeBookmark(String, Object)

지정한 값을 사용하여 지정한 이름의 책갈피를 다시 시작하기 위한 작업을 시작합니다. 다시 시작할 책갈피는 워크플로 인스턴스 내의 작업에서 이전에 만든 것입니다.

ResumeBookmark(String, Object, TimeSpan)

지정한 값 및 시간 제한 간격을 사용하여 지정한 이름의 책갈피를 다시 시작하기 위한 작업을 시작합니다. 다시 시작할 책갈피는 워크플로 인스턴스 내의 작업에서 이전에 만든 것입니다.

public:
 System::Activities::BookmarkResumptionResult ResumeBookmark(System::String ^ bookmarkName, System::Object ^ value, TimeSpan timeout);
public System.Activities.BookmarkResumptionResult ResumeBookmark (string bookmarkName, object value, TimeSpan timeout);
member this.ResumeBookmark : string * obj * TimeSpan -> System.Activities.BookmarkResumptionResult
Public Function ResumeBookmark (bookmarkName As String, value As Object, timeout As TimeSpan) As BookmarkResumptionResult

매개 변수

bookmarkName
String

다시 시작할 책갈피의 이름입니다.

value
Object

책갈피를 다시 시작할 때 호출할 메서드에 대한 매개 변수로 전달되는 개체입니다.

timeout
TimeSpan

책갈피가 다시 시작되어야 하는 시간 간격입니다.

반환

책갈피 다시 시작 작업의 결과입니다.

예제

다음 예제에서는 를 만드는 작업을 사용하는 ReadLine 워크플로를 Bookmark만듭니다. 워크플로가 시작되고 가 만들어지고 워크플로가 유휴 상태가 되면 Bookmark 사용자의 입력이 수집되고 책갈피가 다시 시작됩니다.

public sealed class ReadLine : NativeActivity<string>
{
    [RequiredArgument]
    public InArgument<string> BookmarkName { get; set; }

    protected override void Execute(NativeActivityContext context)
    {
        // Create a Bookmark and wait for it to be resumed.
        context.CreateBookmark(BookmarkName.Get(context),
            new BookmarkCallback(OnResumeBookmark));
    }

    // NativeActivity derived activities that do asynchronous operations by calling
    // one of the CreateBookmark overloads defined on System.Activities.NativeActivityContext
    // must override the CanInduceIdle property and return true.
    protected override bool CanInduceIdle
    {
        get { return true; }
    }

    public void OnResumeBookmark(NativeActivityContext context, Bookmark bookmark, object obj)
    {
        // When the Bookmark is resumed, assign its value to
        // the Result argument.
        Result.Set(context, (string)obj);
    }
Variable<string> name = new Variable<string>();

Activity wf = new Sequence
{
    Variables = { name },
    Activities =
     {
         new WriteLine
         {
             Text = "What is your name?"
         },
         new ReadLine
         {
             BookmarkName = "UserName",
             Result = new OutArgument<string>(name)
         },
         new WriteLine
         {
             Text = new InArgument<string>((env) =>
                 ("Hello, " + name.Get(env)))
         }
     }
};

// Create a WorkflowApplication instance.
WorkflowApplication wfApp = new WorkflowApplication(wf);

// Workflow lifecycle events omitted except idle.
AutoResetEvent idleEvent = new AutoResetEvent(false);

wfApp.Idle = delegate(WorkflowApplicationIdleEventArgs e)
{
    idleEvent.Set();
};

// Run the workflow.
wfApp.Run();

// Wait for the workflow to go idle before gathering
// the user's input.
idleEvent.WaitOne();

// Gather the user's input and resume the bookmark.
// Bookmark resumption only occurs when the workflow
// is idle. If a call to ResumeBookmark is made and the workflow
// is not idle, ResumeBookmark blocks until the workflow becomes
// idle before resuming the bookmark.
BookmarkResumptionResult result = wfApp.ResumeBookmark("UserName",
    Console.ReadLine());

// Possible BookmarkResumptionResult values:
// Success, NotFound, or NotReady
Console.WriteLine("BookmarkResumptionResult: {0}", result);

설명

책갈피 결과는 다시 시작 작업이 성공했는지 아니면 실패했는지를 나타냅니다.

적용 대상

ResumeBookmark(Bookmark, Object, TimeSpan)

지정한 값 및 시간 제한 간격을 사용하여 지정한 책갈피를 다시 시작하기 위한 작업을 시작합니다. 다시 시작할 책갈피는 워크플로 인스턴스 내의 작업에서 이전에 만든 것입니다.

public:
 System::Activities::BookmarkResumptionResult ResumeBookmark(System::Activities::Bookmark ^ bookmark, System::Object ^ value, TimeSpan timeout);
public System.Activities.BookmarkResumptionResult ResumeBookmark (System.Activities.Bookmark bookmark, object value, TimeSpan timeout);
member this.ResumeBookmark : System.Activities.Bookmark * obj * TimeSpan -> System.Activities.BookmarkResumptionResult
Public Function ResumeBookmark (bookmark As Bookmark, value As Object, timeout As TimeSpan) As BookmarkResumptionResult

매개 변수

bookmark
Bookmark

다시 시작할 책갈피입니다.

value
Object

책갈피를 다시 시작할 때 호출할 메서드에 대한 매개 변수로 전달되는 개체입니다.

timeout
TimeSpan

책갈피가 다시 시작되어야 하는 시간 간격입니다.

반환

책갈피 다시 시작 작업의 결과입니다.

예제

다음 예제에서는 를 만드는 작업을 사용하는 ReadLine 워크플로를 Bookmark만듭니다. 워크플로가 시작되고 가 만들어지고 워크플로가 유휴 상태가 되면 Bookmark 사용자의 입력이 수집되고 책갈피가 다시 시작됩니다.

public sealed class ReadLine : NativeActivity<string>
{
    [RequiredArgument]
    public InArgument<string> BookmarkName { get; set; }

    protected override void Execute(NativeActivityContext context)
    {
        // Create a Bookmark and wait for it to be resumed.
        context.CreateBookmark(BookmarkName.Get(context),
            new BookmarkCallback(OnResumeBookmark));
    }

    // NativeActivity derived activities that do asynchronous operations by calling
    // one of the CreateBookmark overloads defined on System.Activities.NativeActivityContext
    // must override the CanInduceIdle property and return true.
    protected override bool CanInduceIdle
    {
        get { return true; }
    }

    public void OnResumeBookmark(NativeActivityContext context, Bookmark bookmark, object obj)
    {
        // When the Bookmark is resumed, assign its value to
        // the Result argument.
        Result.Set(context, (string)obj);
    }
Variable<string> name = new Variable<string>();

Activity wf = new Sequence
{
    Variables = { name },
    Activities =
     {
         new WriteLine
         {
             Text = "What is your name?"
         },
         new ReadLine
         {
             BookmarkName = "UserName",
             Result = new OutArgument<string>(name)
         },
         new WriteLine
         {
             Text = new InArgument<string>((env) =>
                 ("Hello, " + name.Get(env)))
         }
     }
};

// Create a WorkflowApplication instance.
WorkflowApplication wfApp = new WorkflowApplication(wf);

// Workflow lifecycle events omitted except idle.
AutoResetEvent idleEvent = new AutoResetEvent(false);

wfApp.Idle = delegate(WorkflowApplicationIdleEventArgs e)
{
    idleEvent.Set();
};

// Run the workflow.
wfApp.Run();

// Wait for the workflow to go idle before gathering
// the user's input.
idleEvent.WaitOne();

// Gather the user's input and resume the bookmark.
BookmarkResumptionResult result = wfApp.ResumeBookmark(new Bookmark("UserName"),
    Console.ReadLine(), TimeSpan.FromSeconds(15));

// Possible BookmarkResumptionResult values:
// Success, NotFound, or NotReady
Console.WriteLine("BookmarkResumptionResult: {0}", result);

설명

책갈피 결과는 다시 시작 작업이 성공했는지 아니면 실패했는지를 나타냅니다.

적용 대상

ResumeBookmark(Bookmark, Object)

지정한 값을 사용하여 지정한 책갈피를 다시 시작하기 위한 작업을 시작합니다. 다시 시작할 책갈피는 워크플로 인스턴스 내의 작업에서 이전에 만든 것입니다.

public:
 System::Activities::BookmarkResumptionResult ResumeBookmark(System::Activities::Bookmark ^ bookmark, System::Object ^ value);
public System.Activities.BookmarkResumptionResult ResumeBookmark (System.Activities.Bookmark bookmark, object value);
member this.ResumeBookmark : System.Activities.Bookmark * obj -> System.Activities.BookmarkResumptionResult
Public Function ResumeBookmark (bookmark As Bookmark, value As Object) As BookmarkResumptionResult

매개 변수

bookmark
Bookmark

다시 시작할 책갈피입니다.

value
Object

책갈피를 다시 시작할 때 호출할 메서드에 대한 매개 변수로 전달되는 개체입니다.

반환

책갈피 다시 시작 작업의 결과입니다.

예제

다음 예제에서는 를 만드는 작업을 사용하는 ReadLine 워크플로를 Bookmark만듭니다. 워크플로가 시작되고 가 만들어지고 워크플로가 유휴 상태가 되면 Bookmark 사용자의 입력이 수집되고 책갈피가 다시 시작됩니다.

public sealed class ReadLine : NativeActivity<string>
{
    [RequiredArgument]
    public InArgument<string> BookmarkName { get; set; }

    protected override void Execute(NativeActivityContext context)
    {
        // Create a Bookmark and wait for it to be resumed.
        context.CreateBookmark(BookmarkName.Get(context),
            new BookmarkCallback(OnResumeBookmark));
    }

    // NativeActivity derived activities that do asynchronous operations by calling
    // one of the CreateBookmark overloads defined on System.Activities.NativeActivityContext
    // must override the CanInduceIdle property and return true.
    protected override bool CanInduceIdle
    {
        get { return true; }
    }

    public void OnResumeBookmark(NativeActivityContext context, Bookmark bookmark, object obj)
    {
        // When the Bookmark is resumed, assign its value to
        // the Result argument.
        Result.Set(context, (string)obj);
    }
Variable<string> name = new Variable<string>();

Activity wf = new Sequence
{
    Variables = { name },
    Activities =
     {
         new WriteLine
         {
             Text = "What is your name?"
         },
         new ReadLine
         {
             BookmarkName = "UserName",
             Result = new OutArgument<string>(name)
         },
         new WriteLine
         {
             Text = new InArgument<string>((env) =>
                 ("Hello, " + name.Get(env)))
         }
     }
};

// Create a WorkflowApplication instance.
WorkflowApplication wfApp = new WorkflowApplication(wf);

// Workflow lifecycle events omitted except idle.
AutoResetEvent idleEvent = new AutoResetEvent(false);

wfApp.Idle = delegate(WorkflowApplicationIdleEventArgs e)
{
    idleEvent.Set();
};

// Run the workflow.
wfApp.Run();

// Wait for the workflow to go idle before gathering
// the user's input.
idleEvent.WaitOne();

// Gather the user's input and resume the bookmark.
BookmarkResumptionResult result = wfApp.ResumeBookmark(new Bookmark("UserName"),
    Console.ReadLine());

// Possible BookmarkResumptionResult values:
// Success, NotFound, or NotReady
Console.WriteLine("BookmarkResumptionResult: {0}", result);

설명

책갈피 결과는 다시 시작 작업이 성공했는지 아니면 실패했는지를 나타냅니다.

적용 대상

ResumeBookmark(String, Object)

지정한 값을 사용하여 지정한 이름의 책갈피를 다시 시작하기 위한 작업을 시작합니다. 다시 시작할 책갈피는 워크플로 인스턴스 내의 작업에서 이전에 만든 것입니다.

public:
 System::Activities::BookmarkResumptionResult ResumeBookmark(System::String ^ bookmarkName, System::Object ^ value);
public System.Activities.BookmarkResumptionResult ResumeBookmark (string bookmarkName, object value);
member this.ResumeBookmark : string * obj -> System.Activities.BookmarkResumptionResult
Public Function ResumeBookmark (bookmarkName As String, value As Object) As BookmarkResumptionResult

매개 변수

bookmarkName
String

다시 시작할 책갈피의 이름입니다.

value
Object

책갈피를 다시 시작할 때 호출할 메서드에 대한 매개 변수로 전달되는 개체입니다.

반환

책갈피 다시 시작 작업의 결과입니다.

예제

다음 예제에서는 를 만드는 작업을 사용하는 ReadLine 워크플로를 Bookmark만듭니다. 워크플로가 시작되고 가 만들어지고 워크플로가 유휴 상태가 되면 Bookmark 사용자의 입력이 수집되고 책갈피가 다시 시작됩니다.

public sealed class ReadLine : NativeActivity<string>
{
    [RequiredArgument]
    public InArgument<string> BookmarkName { get; set; }

    protected override void Execute(NativeActivityContext context)
    {
        // Create a Bookmark and wait for it to be resumed.
        context.CreateBookmark(BookmarkName.Get(context),
            new BookmarkCallback(OnResumeBookmark));
    }

    // NativeActivity derived activities that do asynchronous operations by calling
    // one of the CreateBookmark overloads defined on System.Activities.NativeActivityContext
    // must override the CanInduceIdle property and return true.
    protected override bool CanInduceIdle
    {
        get { return true; }
    }

    public void OnResumeBookmark(NativeActivityContext context, Bookmark bookmark, object obj)
    {
        // When the Bookmark is resumed, assign its value to
        // the Result argument.
        Result.Set(context, (string)obj);
    }
Variable<string> name = new Variable<string>();

Activity wf = new Sequence
{
    Variables = { name },
    Activities =
     {
         new WriteLine
         {
             Text = "What is your name?"
         },
         new ReadLine
         {
             BookmarkName = "UserName",
             Result = new OutArgument<string>(name)
         },
         new WriteLine
         {
             Text = new InArgument<string>((env) =>
                 ("Hello, " + name.Get(env)))
         }
     }
};

// Create a WorkflowApplication instance.
WorkflowApplication wfApp = new WorkflowApplication(wf);

// Workflow lifecycle events omitted except idle.
AutoResetEvent idleEvent = new AutoResetEvent(false);

wfApp.Idle = delegate(WorkflowApplicationIdleEventArgs e)
{
    idleEvent.Set();
};

// Run the workflow.
wfApp.Run();

// Wait for the workflow to go idle before gathering
// the user's input.
idleEvent.WaitOne();

// Gather the user's input and resume the bookmark.
// Bookmark resumption only occurs when the workflow
// is idle. If a call to ResumeBookmark is made and the workflow
// is not idle, ResumeBookmark blocks until the workflow becomes
// idle before resuming the bookmark.
BookmarkResumptionResult result = wfApp.ResumeBookmark("UserName",
    Console.ReadLine());

// Possible BookmarkResumptionResult values:
// Success, NotFound, or NotReady
Console.WriteLine("BookmarkResumptionResult: {0}", result);

설명

책갈피 결과는 다시 시작 작업이 성공했는지 아니면 실패했는지를 나타냅니다.

적용 대상