public manageTargetsDialog(main m,LinkedList<nodeTarget> targets,manageMode mmode,nodeTarget targetToEdit) { InitializeComponent(); this.m = m; this.targets = targets; this.targetToEdit = targetToEdit; setMode(mmode); }
public void loadSettings() { Hashtable saveblock; IFormatter formatter = new BinaryFormatter(); if (File.Exists(Application.StartupPath + "/settings.dat")) { try { Stream st = File.OpenRead(Application.StartupPath + "/settings.dat"); saveblock = (Hashtable)formatter.Deserialize(st); st.Close(); recentFiles = (LinkedList<string>)saveblock["recentFiles"]; serialSettings = (Hashtable)saveblock["serialSettings"]; targets = (LinkedList<nodeTarget>)saveblock["targets"]; currentTarget = (nodeTarget)saveblock["currentTarget"]; currentLoadedFile = (string)saveblock["currentLoadedFile"]; myid = (byte)saveblock["myid"]; } catch (Exception) { } } }
void tidel_Click(object sender, EventArgs e) { targetItemDelete tidel = (targetItemDelete)sender; if (tidel.getTargetItem().getNodeTarget().Equals(currentTarget)) currentTarget = null; targets.Remove(tidel.getTargetItem().getNodeTarget()); refreshTargets(); saveSettings(); }
public targetItem(nodeTarget nt) { this.nt = nt; if (nt == null) nt = new nodeTarget(); }
private void targetItem_Click(object sender, EventArgs e) { targetItem ti = (targetItem)sender; currentTarget = ti.getNodeTarget(); for (int i = 2; i < menu_target.DropDownItems.Count; i++) { ((targetItem)menu_target.DropDownItems[i]).Checked = false; } ti.Checked = true; saveSettings(); }