private void Load(string filepath) { if (!File.Exists(filepath)) { return; //skip loading } StreamReader sr = new StreamReader(filepath); string line = ""; while ((line = sr.ReadLine()) != null) { if (line.StartsWith("#") || line == "") { continue; } string[] split = line.Split('\t', ','); Ctrls ctrls = (Ctrls)Enum.Parse(typeof(Ctrls), split[0]); controls.Add(ctrls, new Keys[split.Count() - 1]); for (int i = 0; i < split.Count() - 1; i++) { controls[ctrls][i] = (Keys)Enum.Parse(typeof(Keys), split[i + 1].Trim()); } } sr.Close(); }
public void LoadPoses() { Ctrls.Clear(); categories.Clear(); int count = CategDropDownButton.DropDownItems.Count; while (count > 5) { count--; CategDropDownButton.DropDownItems.RemoveAt(count); } foreach (TK_Action action in library.Actions) { ActionCtrl ctrl = new ActionCtrl(this, action); ctrl.MouseClick += new MouseEventHandler(ctrl_MouseClick); ctrl.MouseDoubleClick += new MouseEventHandler(ctrl_MouseDoubleClick); Ctrls.Add(ctrl); if (!categories.ContainsKey(action.Category)) { ToolStripMenuItem item = CategDropDownButton.DropDownItems.Add(action.Category) as ToolStripMenuItem; item.CheckOnClick = true; item.Checked = true; item.CheckedChanged += new EventHandler(item_CheckedChanged); categories.Add(action.Category, true); } } SortControls(); ResetVisibilities(); UpdateDisplays(); SetDisplayStates(); }
private void SortControls() { Ctrls.Sort(sorter); ActionsFlow.Controls.Clear(); foreach (ActionCtrl action in Ctrls) { ActionsFlow.Controls.Add(action); } }
private void ExitProgram() { if (Ctrls.ExitCheck()) { System.Windows.Application.Current.Shutdown(); } else { System.Windows.Forms.MessageBox.Show("Cant exit right now"); } }
public bool IsPressed(Ctrls control, bool kbp_check = false) { foreach (Keys key in controls[control]) { if ((kb.IsKeyDown(key) && !kbp_check) || kb.IsKeyDown(key) && kb != kbp) { return(true); } } return(false); }
public void TestMethod1() { StringAssert.StartsWith("ABC012", Ctrls.Transform("XYZ789", true)); }
public Keys[] GetKey(Ctrls control) { return(controls[control]); }
private void SetKeyValue(int value) { Ctrls.SetKeyValue(value); }
private void SetAppOptionsCryptingMethod(int newValue) { Ctrls.SetAppOptionsCryptingMethod(LbKey, NudKey, newValue); }
//executive methods private void Cipher(Boolean cipherDirection) { TbResult.Text = Ctrls.Transform(TbInput.Text, cipherDirection); }