private void checkBox1_CheckedChanged(object sender, EventArgs e) { if (checkBox1.Checked) { AppStartup.CreateStartupFolderShortcut(); } else { AppStartup.DeleteStartupFolderShortcuts(Path.GetFileName(Application.ExecutablePath)); } }
private void Form1_Load(object sender, EventArgs e) { textBox1.MaxLength = CommonClasses.DefaultSettings.MaxPasswordLength; toolTip1.SetToolTip(textBox1, "Password must be " + CommonClasses.DefaultSettings.MinPasswordLength + "-" + CommonClasses.DefaultSettings.MaxPasswordLength + " characters long"); toolTip1.SetToolTip(maskedTextBox1, "The port number is an integer value between 0-" + UInt16.MaxValue); // HideSlaveOptions(); UpdateTarget(false); UpdateControls(); AppStartup.CreateStartupFolderShortcut(); setStatusGUI(TypeIcon.begin); // socketThreadFunc(); timerTimeout = new System.Threading.Timer((ee) => { bool ok = true; if (isConnectedMaster) { try { ok = ok && CommonClasses.SocketMessages.TcpUtilities.isTcpActive(SlaveSocket.master); ok = ok && CommonClasses.SocketMessages.TcpUtilities.isTcpActive(SlaveSocket.clipCli); } catch (Exception exp) { ok = false; } if (!ok) { isConnectedMaster = false; } } }, null, 0, 20 * 1000); }