Share via


Macros.IsRecording 속성

현재 매크로 레코더가 동작을 기록하고 있는지 여부를 반환합니다. 매크로 내에서는 이 속성을 사용할 수 없습니다.

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

구문

‘선언
ReadOnly Property IsRecording As Boolean
bool IsRecording { get; }
property bool IsRecording {
    bool get ();
}
abstract IsRecording : bool with get
function get IsRecording () : boolean

속성 값

형식: Boolean
매크로 레코더에서 현재 작업을 기록하고 있는 경우 true를 나타내고 그렇지 않은 경우에는 false를 나타내는 부울 값입니다.

설명

IsRecording은 추가 기능에서만 사용해야 하고 매크로에서는 사용할 수 없습니다.

예제

public void CodeExample(DTE2 dte, AddIn addin)
{
    // INSTRUCTIONS: Run this code, open a solution, start
    // recording a macro, then connect the addin 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