01 Erste Schritte


01 Start
using Eplan.EplApi.Scripting;
using System.Windows.Forms;

namespace Namespace
{
  public class Class
  {
    [Start]
    public void Function()
    {
      MessageBox.Show("Ich kann scripten!"); // Kommentar
      return;
    }
  }
}


02 DeclareAction
using System.Windows.Forms;
using Eplan.EplApi.Scripting;

public class _01_Erste_Schritte_02_DeclareAction
{
  [DeclareAction("Actionname")]
  public void Function()
  {
    MessageBox.Show("Ich kann scripten!");
    return;
  }
}


03 DeclareEventHandler
using System.Windows.Forms;
using Eplan.EplApi.Scripting;

public class _01_Erste_Schritte_03_DeclareEventHandler
{
  [DeclareEventHandler("onActionStart.String.XPrjActionProjectClose")]
  public void Function()
  {
    MessageBox.Show("Ich kann scripten!");
    return;
  }
}


04 DeclareRegisterUnregister
using System.Windows.Forms;
using Eplan.EplApi.Scripting;

public class _01_Erste_Schritte_04_DeclareRegisterUnregister
{
  [DeclareRegister]
  public void Register()
  {
    MessageBox.Show("Script geladen.");
    return;
  }

  [DeclareUnregister]
  public void UnRegister()
  {
    MessageBox.Show("Script entladen.");
    return;
  }
}