public AppForm() { // // Required for Windows Form Designer support // InitializeComponent(); FormStats formStats = new FormStats(); bool jsonExsists = false; try { formStats = JsonConvert.DeserializeObject <FormStats>(File.ReadAllText(@"C:\Users\Zvone\Desktop\Lab\C# vjezbe\Lab10\formStats.json")); jsonExsists = true; } catch (Exception) { Console.WriteLine("Problem with reading the JSON file!"); } if (jsonExsists) { Width = formStats._Width; Height = formStats._Height; Location = formStats._Location; } APP_FORM = this; PERSONS_ROOT_NODE = new TreeNode("Persons"); treeView1.Nodes.Add(PERSONS_ROOT_NODE); _cmdProcessor = new CommandProcessor(); _cmdProcessor.setUnReButtonState(); }
public override void undo() { AppForm.PERSONS_ROOT_NODE.Nodes.Add(_personForDel); AppForm.PERSONS_ROOT_NODE.Expand(); AppForm.getAppForm().MyTreeView.SelectedNode = _personForDel; }
public override void doit() { AppForm.PERSONS_ROOT_NODE.Nodes.Remove(_personForDel); AppForm.getAppForm().MyTreeView.SelectedNode = AppForm.PERSONS_ROOT_NODE; }
public override void undo() { AppForm.PERSONS_ROOT_NODE.Nodes.Remove(_newPerson); AppForm.getAppForm().MyTreeView.SelectedNode = AppForm.PERSONS_ROOT_NODE; }
public override void doit() { AppForm.PERSONS_ROOT_NODE.Nodes.Add(_newPerson); AppForm.PERSONS_ROOT_NODE.Expand(); AppForm.getAppForm().MyTreeView.SelectedNode = _newPerson; }