private void Window_Loaded(object sender, RoutedEventArgs e) { this.initializing = false; // get the buttons install location this.labelAppData.Tag = string.Format(CultureInfo.InvariantCulture, @"{0}\Controlled Vocabulary", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)); this.GetButtons(); try { Process[] processes = Process.GetProcessesByName("OUTLOOK"); if (processes.Length > 0) { this.labelOutlookRunning.Visibility = System.Windows.Visibility.Visible; } } catch { // Do Nothing } this.checkBoxCallMailto.IsChecked = Convert.ToBoolean(StaticHelper.GetApplicationSetting("CallMailtoProtocol")); this.checkBoxCopySubject.IsChecked = Convert.ToBoolean(StaticHelper.GetApplicationSetting("CopySubjectToClipboard")); this.textBoxMasterEmailAccount.Text = StaticHelper.GetApplicationSetting("MasterEmailAccount"); }
private void Window_Loaded(object sender, RoutedEventArgs e) { // check for updates if (Convert.ToBoolean(StaticHelper.GetApplicationSetting("AutoUpdate"))) { if (string.IsNullOrEmpty(StaticHelper.GetApplicationSetting("LastUpdateCheckDate"))) { StaticHelper.CheckForMenuXmlUpdates(); } else { DateTime lastcheck = Convert.ToDateTime(StaticHelper.GetApplicationSetting("LastUpdateCheckDate")); TimeSpan t = DateTime.Now - lastcheck; if (t.Days >= Convert.ToInt32(StaticHelper.GetApplicationSetting("UpdateCheckFrequency"))) { StaticHelper.CheckForMenuXmlUpdates(); } } } // get the buttons StaticHelper.LogMessage(MessageType.Info, "Getting buttons"); menu[] buttons = StaticHelper.GetControlledVocabularyMenus(); // build the buttons StaticHelper.LogMessage(MessageType.Info, "Building menu"); this.BuildMenu(buttons); if (this.menu1.Items.Count == 0) { this.ShowManager(); } }
private void label2_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { string mailto = "mailto:" + StaticHelper.GetApplicationSetting("ErrorEmail"); mailto += "?subject=" + this.exception.Message; string inner = string.Empty; if (this.exception.InnerException != null) { inner = " --- " + this.exception.InnerException; } mailto += "&body=" + this.exception.Message + " ---- " + this.exception.StackTrace + inner; if (Convert.ToBoolean(StaticHelper.GetApplicationSetting("CallMailtoProtocol"))) { Process.Start(mailto); } this.Close(); }
private static void Send(object sender, RoutedEventArgs e) { MenuItem m = (MenuItem)sender; try { string[] idParts = m.Uid.Split(new[] { StaticHelper.SplitSequence }, StringSplitOptions.RemoveEmptyEntries); // Get the recipients string[] recipients = StaticHelper.GetRecipients(idParts[0], m.Uid); string mailto = "mailto:" + recipients[0]; mailto += "?subject=" + m.Tag; if (!string.IsNullOrEmpty(recipients[1])) { mailto += "&cc=" + recipients[1]; } if (!string.IsNullOrEmpty(recipients[2])) { mailto += "&bcc=" + recipients[2]; } if (Convert.ToBoolean(StaticHelper.GetApplicationSetting("CopySubjectToClipboard"))) { Clipboard.SetText(m.Tag.ToString()); } if (Convert.ToBoolean(StaticHelper.GetApplicationSetting("CallMailtoProtocol"))) { Process.Start(mailto); } } catch (System.Exception ex) { StaticHelper.LogMessage(MessageType.Error, ex.ToString()); throw; } }
/// <summary> /// Initializes a new instance of the Manager class /// </summary> public Manager() { InitializeComponent(); this.checkBoxAutoUpdate.IsChecked = Convert.ToBoolean(StaticHelper.GetApplicationSetting("AutoUpdate")); }