static void Main() { Common.InitializeSettings(); // Load properties Common.LoadSettings(); // Create Database if needed CallLog.CreateDatabase(); bool exists = System.Diagnostics.Process.GetProcessesByName(System.IO.Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetEntryAssembly().Location)).Length > 1; if (exists) { FrmTimerMsgBox msg = new FrmTimerMsgBox("App Already Opened", "ELPoup 5 Already Running in System Tray", 4000); msg.ShowDialog(); Application.Exit(); return; } // Setup styles and rendering Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // Create main form fMain = new FrmMain(); // Launch main form Application.Run(fMain); }
public void CopyTextboxText(object sender, EventArgs e) { if (sender is TextBox) { TextBox tb = (TextBox)sender; if (string.IsNullOrEmpty(tb.Text)) { return; } Clipboard.SetText(tb.Text); string type = (tb.Name.ToLower().Contains("number")) ? "Number" : "Name"; FrmTimerMsgBox msg = new FrmTimerMsgBox("Copied " + type, "Copied " + type + " to Clipboard.", 1000); msg.ShowDialog(); } }
private void CopyCallLogMenu(object sender, EventArgs e) { FrmTimerMsgBox msg; switch (LastRowCell[1]) { case DGV_LOG_NUMBER: Clipboard.SetText(dgvCallLog.Rows[LastRowCell[0]].Cells[LastRowCell[1]].Value.ToString()); msg = new FrmTimerMsgBox("Copied", "Copied Number to Clipboard.", 1000); msg.ShowDialog(); break; case DGV_LOG_NAME: Clipboard.SetText(dgvCallLog.Rows[LastRowCell[0]].Cells[LastRowCell[1]].Value.ToString()); msg = new FrmTimerMsgBox("Copied", "Copied Name to Clipboard.", 1000); msg.ShowDialog(); break; } }
private void btnImportOldDatabase_Click(object sender, EventArgs e) { if (Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\CallerID.com\ELPopup\")) { OpenFileDialog ofd = new OpenFileDialog(); ofd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\CallerID.com\ELPopup\"; DialogResult r = ofd.ShowDialog(); if (r != DialogResult.OK && r != DialogResult.Yes) { return; } string filename = ofd.FileName; ImportOldDatabase(filename); } else { FrmTimerMsgBox msg = new FrmTimerMsgBox("No Old Database", "Could not find old ELPopup database.", 1500); msg.ShowDialog(); } }