Share via


Macros.Resume 메서드

매크로 기록이 일시 중지된 경우 다시 시작합니다. 매크로 내에서는 이 메서드를 사용할 수 없습니다.

네임스페이스:  EnvDTE
어셈블리:  EnvDTE(EnvDTE.dll)

구문

‘선언
Sub Resume
void Resume()
void Resume()
abstract Resume : unit -> unit
function Resume()

설명

매크로 기록을 일시 중지하려면 Pause를 사용합니다. 매크로 기록을 일시 중지하지 않은 상태에서 Resume을 호출하면 실행되지 않습니다.

Resume은 추가 기능에서만 사용할 수 있습니다.

매크로 기록 모드가 아닌 경우 추가 기능에서 Resume을 호출하면 이 메서드는 아무 작업도 수행하지 않고 "알 수 없는 오류"라는 메시지가 나타납니다.

예제

public void CodeExample(DTE2 dte, AddIn addin)
{
    // INSTRUCTIONS: Run this code, open a solution, start
    // recording a macro, then connect the add-in containing this code.
    try
    {
        Macros mac = dte.Macros;
        if (mac.IsRecording)
        {
            mac.Pause();
            if (!mac.IsRecording)
                mac.Resume();
            mac.EmitMacroCode("rem Code added by the EmitMacroCode method");
            // Demonstrate these two properties return the same reference.
            bool test = mac.DTE.Equals(mac.Parent);
            if (test) MessageBox.Show("The DTE and Parent property refer to the same object.");
            else MessageBox.Show("The DTE and Parent property do not refer to the same object.");
        }
        else MessageBox.Show("Start a macro recording session and reconnect addin");
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

.NET Framework 보안

참고 항목

참조

Macros 인터페이스

EnvDTE 네임스페이스

기타 리소스

Automating Repetitive Actions by Using Macros