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!");
  }
}


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!");
  }
}


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.");
  }

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