public override void InitializeSystem() { LoadAssembly(@"\NVRAM\ReflectionLib1.dll"); // Load this assembly by default // ********************************************************************************************* // Below defines the userobject for this signal as a delegate to run the class method. // Currently its reponsibilty is to be the interface between the TP and the system // 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 // NOTE: If you have multiple parameters in action specify in "(": // Action<Button, int>((p,i) => actionBIC.BReadFile(p,i)); // NOTE: Also, the full lambda does _not_ need specifying at all - its handled automatically // Action<Button, int>(actionBIC.BGetHTTPFile); // ********************************************************************************************* actionBIC = new ButtonInterfaceController(); myKeypad.Button[1].UserObject = new System.Action <Button>(p => actionBIC.BReadFile(p)); myKeypad.Button[2].UserObject = new System.Action <Button>(actionBIC.BGetHTTPFile); myKeypad.Button[3].UserObject = new System.Action(actionBIC.GetSFTPFile); return; }
public override void InitializeSystem() { LoadAssembly(@"\NVRAM\ReflectionLib1.dll"); // Load this assembly by default // ********************************************************************************************* // Below defines the userobject for this signal as a delegate to run the class method. // Currently its reponsibilty is to be the interface between the TP and the system // 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 // NOTE: If you have multiple parameters in action specify in "(": // Action<Button, int>((p,i) => actionBIC.BReadFile(p,i)); // NOTE: Also, the full lambda does _not_ need specifying at all - its handled automatically // Action<Button, int>(actionBIC.BGetHTTPFile); // ********************************************************************************************* actionBIC = new ButtonInterfaceController(); myKeypad.Button[1].UserObject = new System.Action<Button>(p => actionBIC.BReadFile(p)); myKeypad.Button[2].UserObject = new System.Action<Button>(actionBIC.BGetHTTPFile); myKeypad.Button[3].UserObject = new System.Action(actionBIC.GetSFTPFile); return; }