private void FormEditHeader_Load(object sender, EventArgs e)
        {
            //Form loading
            bool bAddNew = hdrType.xmlNode == null;

            //Set min size
            this.MinimumSize = this.Size;

            if (bAddNew)
            {
                Text          = "Add New Mail Header";
                buttonOK.Text = "&Add";
            }
            else
            {
                Text          = "Edit Mail Header";
                buttonOK.Text = "&Save";

                //Get values from XML node
                FormDefineHeaders.ItemInfo ii = FormDefineHeaders.getHeaderInfoFromNode(hdrType.xmlNode);
                if (ii != null)
                {
                    textBoxName.Text  = ii.strName.Trim();
                    textBoxValue.Text = ii.strVal.Trim();
                }
                else
                {
                    //Error
                    ThisAddIn.LogDiagnosticSpecError(1040);
                    SystemSounds.Exclamation.Play();
                }
            }
        }
Example #2
0
        private void FormAbout_Load(object sender, EventArgs e)
        {
            //First loading

            //Get app installer type
            ThisAddIn.InstallerType instType = ThisAddIn.getCurrentInstallerType();
            string strInst;

            switch (instType)
            {
            case ThisAddIn.InstallerType.INST_PerUser:
                strInst = "Per-User";
                break;

            case ThisAddIn.InstallerType.INST_AllUsers:
                strInst = "All-Users";
                break;

            case ThisAddIn.InstallerType.INST_Bundled:
                strInst = "Bundled";
                break;

            case ThisAddIn.InstallerType.INST_Unknown:
                strInst = "?";
                break;

            default:
                ThisAddIn.LogDiagnosticSpecError(1158, "v=" + instType.ToString());
                strInst = instType.ToString();
                break;
            }

            labelAppName.Text = GlobalDefs.GlobDefs.gkstrAppNameFull + " v." + ThisAddIn.gAppVersion.getVersion() + " (" + strInst + ")";

            //Copyright
            int nYear = DateTime.Now.Year;

            labelCpyrght.Text = "Copyright (C) 2020" + (nYear > 2020 ? "-" + nYear.ToString() : "");


            //Get path for settings
            string strSettingsPath = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal).FilePath;


            textBoxOutput.Text = "ConfigFilePath=\"" + strSettingsPath + "\"\r\n" +
                                 "ExecFldr=\"" + AppDomain.CurrentDomain.BaseDirectory + "\"";

            textBoxOutput.ForeColor = SystemColors.GrayText;
            textBoxOutput.BackColor = SystemColors.ButtonFace;                          //I'm not sure why we need to do this?

            //Set checkbox for logging sent emails
            checkBoxLog.Checked = Properties.Settings.Default.OutlookHdrsLogWhenSending;
        }
Example #3
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            //Save any changes
            try
            {
                Properties.Settings.Default.OutlookHdrsLogWhenSending = checkBoxLog.Checked;

                //And save them
                Properties.Settings.Default.Save();
            }
            catch (Exception ex)
            {
                //Failed
                ThisAddIn.LogDiagnosticSpecError(1041, ex);
                MessageBox.Show("ERROR: Failed to save changes: " + ex.ToString(), GlobalDefs.GlobDefs.gkstrAppNameFull, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            //Close this window
            this.Close();
        }
Example #4
0
 private void linkLabelDB_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     //Redirect to the website of the developer
     ThisAddIn.openWebPage("https://dennisbabkin.com/");
 }