private void OperationView_MouseDoubleClick(object sender, MouseEventArgs e) { ListViewHitTestInfo hit = operationView.HitTest(e.Location); if (hit.Item != null && hit.Item.Text != null && hit.Item.Text != "") { String operationName = hit.Item.Text; ListView.SelectedIndexCollection selected = operationView.SelectedIndices; if (selected.Count > 0) { int index = selected[0]; new OperationVigoForm(sequence.GetOperations()[index], (prevName, newOperation) => { if (prevName != newOperation.GetName()) { JSONHandler.Operations.RenameOperation(prevName, newOperation.GetName()); } sequence.RemoveFromList(index); sequence.AddToList(newOperation, index); JSONHandler.Sequences.SaveSequence(sequence); callback(this.index, sequence); RefreshList(); }).ShowDialog(); } } }
public static void TestReport() { //Set up Operations Operation operation = new Operation("Test Operation", "Test.com", "123"); operation.RunOperation(); Operation operation2 = new Operation("OpTest2", "ASd", "False"); operation2.RunOperation(); Operation operation3 = new Operation("Last Operation", "Commander6:Master_Box_1.Pacific.Pacific_127.MIB_05", "1"); operation3.RunOperation(); //Set up sequence Sequence seq = new Sequence("Test Sequence", 500, true); seq.AddToList(operation); seq.AddToList(operation2); Sequence seq2 = new Sequence("Second Sequence", -500, false); seq2.AddToList(operation); seq2.AddToList(operation3); Sequence seq3 = new Sequence("Lasst Sequence", 0, false); seq3.AddToList(operation2); seq3.AddToList(operation3); //Set up test Test test = new Test("Experimental Test 1"); test.AddToList(seq); test.AddToList(seq2); Test test2 = new Test("Temperature Test"); test2.AddToList(seq3); //Set up Test List TestList testList = new TestList("First List"); testList.AddToList(test); testList.AddToList(test2); //Create Report Report report = new Report(testList); JSONHandler.Reports.SaveReport(report); }