コード例 #1
0
ファイル: ControlSystem.cs プロジェクト: RBSystems/SIMPLSharp
 public override void InitializeSystem()
 {
     try
     {
         rxHandler = new Thread(Gather, (object)null, Thread.eThreadStartOptions.Running);
     }
     catch (Exception e)
     {
         ErrorLog.Error("Error in InitializeSystem: {0}", e.Message);
     }
     // This statement defines the userobject for this signal as a delegate to run the class method
     // So, when this particular signal is invoked the delegate function invokes the class method
     // I have demonstrated 3 different ways to assign the action with and without parms as well
     // as lambda notation vs simplified - need to test to see whagt does and does not work
     actionBIC = new ButtonInterfaceController();
     myKeypad.Button[1].UserObject = new System.Action<Button>((p) => actionBIC.BPressUp(p));
     myKeypad.Button[2].UserObject = new System.Action<Button>((p) => actionBIC.BPressDn(p));
 }