Aracılığıyla paylaş


Macros.Pause Yöntem

Makro kaydedici kod şu anda kaydedilen makro yazılır duraklatır.Bu yöntem gelen bir makro içinden kullanılmamalıdır.

Ad alanı:  EnvDTE
Derleme:  EnvDTE (EnvDTE.dll içinde)

Sözdizimi

'Bildirim
Sub Pause
void Pause()
void Pause()
abstract Pause : unit -> unit 
function Pause()

Notlar

Pausebaşka görevini gerçekleştirmesi için bir makro komutu çağırır, ancak ilk komut gerektirmez veya makroda kaydedilmesi için ikinci komut istediğiniz zaman yararlı olabilir.Bu durumda, ilk komut tüm komutunun davranış yakalayan kodunu gösterir.

Makro duraklattıktan sonra devam etmek için kullanmak Resume.Pauseyalnızca gelen eklentileri içinde kullanılmalıdır.

Çağırmayı, Pause bir eklenti makro kaydetme modunda yöntemi hiçbir şey yok, ancak herhangi bir hata oluşmaz, içinde.

Örnekler

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 Güvenliği

Ayrıca bkz.

Başvuru

Macros Arabirim

EnvDTE Ad Alanı

Diğer Kaynaklar

Automating Repetitive Actions by Using Macros