// Constructor public MainClass() { // create tray menu trayMenu = new ContextMenu(); trayMenu.MenuItems.Add("Exit", OnExit); trayMenu.MenuItems.Add("Settings", OnSettings); // create tray icon trayIcon = new NotifyIcon(); trayIcon.Text = "org-mode reminder"; trayIcon.Icon = new Icon("app.ico", 40, 40); trayIcon.ContextMenu = trayMenu; //display tray icon trayIcon.Visible = true; InitialzeSnarl(); // if settigs file does not exits then create them. if (!System.IO.File.Exists(Settings.configFile)) { Settings settingForm = new Settings(); settingForm.FormClosed += new FormClosedEventHandler(settingForm_IsClosed); settingForm.Show(); } else { startMainLoop(); } }
// If user click on "Settings" button from context menu private void OnSettings(object sender, EventArgs e) { Settings SettingsForm = new Settings(); SettingsForm.Show(); }
public OrgFile() { Settings s = new Settings(); FilePath = s.getOrgFilesPath(); }