public TriggerInfo(FormTrigger obj, String Name, int Type, String Operation) { this.obj = obj; this.Name = Name; this.Type = Type; this.Operation = Operation; }
private void DeleteAllTriggers(object sender, EventArgs e) { //Create a triggerObject array FormTrigger[] allTriggers = new FormTrigger[triggerList.Count]; //get each triggeObject from triggeList (TriggerInfo) and insert it into allTriggers array for (int i = 0; i < triggerList.Count; i++) { allTriggers[i] = triggerList[i].obj; } //Destroy every object in allTrigges Array foreach (FormTrigger x in allTriggers) { //Closes the thread attached to this trigger // x.triggerThread.Abort(); //Closes the trigger itself x.Close(); } triggerList = new List <TriggerInfo>(); createdTriggers = 0; UpdateActiveTriggers(); MessageBox.Show("All existing Triggers are deleted", "All Triggers Deleted", MessageBoxButtons.OK, MessageBoxIcon.Information); }
// NEED TO IMPLEMENT --------------------------------------------------------------------------------- public void HandleRecurringTrigger(float timeDelay, FormTrigger trigger) { if (!trigger.isRecurringActive) { var tOp = new ThreadedOperations((int)Math.Round(timeDelay), Operation.EVENT_KEYPRESS, this); if (this.Type == Operation.TYPE_INPUTKEY) { mythread = new Thread(tOp.RunRecursive); mythread.IsBackground = true; mythread.Start(); } else { mythread = new Thread(tOp.RunThread); mythread.IsBackground = true; mythread.Start(); } trigger.BackColor = System.Drawing.Color.Green; trigger.isRecurringActive = true; } else { var x = new ThreadedOperations((int)Math.Round(timeDelay)); x.SleepOnly(); trigger.BackColor = System.Drawing.Color.Red; if (mythread != null) { mythread.Abort(); } trigger.isRecurringActive = false; } }
private void CreateTriggerObject(int trigType) { this.myTriggerObject = new FormTrigger(trigType); myTriggerObject.Height = 200; myTriggerObject.Width = 300; myTriggerObject.TopMost = true; myTriggerObject.Show(); myTriggerObject.Location = new Point(positionX, positionY); txtbxXposition.Text = myTriggerObject.Location.X.ToString(); txtbxYposition.Text = myTriggerObject.Location.X.ToString(); myTriggerObject.triggerEditor = this; //GET TRIGGER OPERATIONS FROM SOMEWHERE //Or SET the 'triggerType' variable from somewhere }
public TriggerInfo(FormTrigger obj, String Name, int Type) { this.obj = obj; this.Name = Name; this.Type = Type; }
public TriggerInfo(FormTrigger obj) { this.obj = obj; }
public TriggerInfo(FormTrigger obj, String Name) { this.obj = obj; this.Name = Name; }