public void menuItemAutostart_click(object o, EventArgs e) { if (AutoStart.IsOn()) { AutoStart.SetOff(); } else { AutoStart.SetOn(); } OnStartTextChange(); }
public void OnStartTextChange() { if (AutoStart.IsOn()) { menuItemStartOnOff.Text = Constants.AUTO_START_ON; MenuItemStartOnOff.Checked = true; } else { menuItemStartOnOff.Text = Constants.AUTO_START_OFF; MenuItemStartOnOff.Checked = false; } }
static void Main() { //eyeXHost.Start(); path = Application.StartupPath + "\\" + "Settings.json"; ReadWriteJson(); ReadWriteJson(); onStartUp = AutoStart.IsOn(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); //eyeXHost.Dispose(); }
private void resetSettings() { File.Delete(Program.path); Program.ReadWriteJson(); Settings_Load(this, new System.EventArgs()); AutoStart.SetOff(); Program.onStartUp = !Program.onStartUp; ChangeButtonColor(btnAutoStart, false, false); resetSideBar(); stickyLeft = Program.readSettings.stickyLeftClick; buttonStickyLeftClick.BackColor = Color.Black; selectionFeedback = Program.readSettings.selectionFeedback; btnFeedback.BackColor = Color.White; }
static void Main() { if (mutex.WaitOne(TimeSpan.Zero, true)) { path = Application.StartupPath + "\\" + "Settings.json"; ReadWriteJson(); onStartUp = AutoStart.IsOn(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); mutex.ReleaseMutex(); } else { MessageBox.Show("There is already an instance of Gaze Toolbar running!"); } }
//private void btnChangeSide_Click(object sender, EventArgs e) //{ // if (OnTheRight) // { // changeSide("On left", ApplicationDesktopToolbar.AppBarEdges.Left, false); // ChangeButtonColor(btnChangeSide, true, false); // } // else // { // changeSide("On Right", ApplicationDesktopToolbar.AppBarEdges.Right, true); // ChangeButtonColor(btnChangeSide, false, false); // } //} //private void changeSide(string text, ApplicationDesktopToolbar.AppBarEdges edge, bool flag) //{ // lblIndicationLeftOrRight.Text = text; // form1.Edge = edge; // OnTheRight = flag; //} /// private void btnAutoStart_Click(object sender, EventArgs e) { if (Program.onStartUp) { AutoStart.SetOff(); Program.onStartUp = !Program.onStartUp; ChangeButtonColor(btnAutoStart, false, false); } else { if (AutoStart.SetOn()) { Program.onStartUp = !Program.onStartUp; ChangeButtonColor(btnAutoStart, true, false); } } form1.OnStartTextChange(); }