Esempio n. 1
0
        public void Form1_Load(object sender, EventArgs e)
        {
            #region Load interfaces xml
            try
            {
                interfaces.Load(executablePath + "\\" + Settings.Default.XMLFile);
            }

            catch(System.IO.FileNotFoundException)
            {
                XmlTextWriter xmlWriter = new XmlTextWriter(Settings.Default.XMLFile, System.Text.Encoding.UTF8);
                xmlWriter.Formatting = Formatting.Indented;
                xmlWriter.WriteProcessingInstruction("xml", "version='1.0' encoding='UTF-8'");
                xmlWriter.WriteStartElement("applications");
                xmlWriter.Close();
                interfaces.Load(executablePath + "\\" + Settings.Default.XMLFile);
            }
            #endregion

            #region Load configuration xml
            try
            {
                interfaces.Load(executablePath + "\\" + Settings.Default.ConfigXMLFile);
            }

            catch (System.IO.FileNotFoundException)
            {
                XmlTextWriter xmlWriter = new XmlTextWriter(Settings.Default.ConfigXMLFile, System.Text.Encoding.UTF8);
                xmlWriter.Formatting = Formatting.Indented;
                xmlWriter.WriteProcessingInstruction("xml", "version='1.0' encoding='UTF-8'");
                xmlWriter.WriteStartElement("settings");
                xmlWriter.Close();
                interfaces.Load(executablePath + "\\" + Settings.Default.ConfigXMLFile);

                ConfigureEmailForm configureEmail = new ConfigureEmailForm();
                configureEmail.ShowDialog();
            }
            #endregion

            loadComboBox();

            editLabel.Hide();
        }
Esempio n. 2
0
        private void submit_button_Click(object sender, EventArgs e)
        {
            CreateReadMeFile createReadMeDocument = new CreateReadMeFile();
            FileCopy copyBuildFiles = new FileCopy();
            SendEmail email = new SendEmail();

            bool validApplicationSelected = validateApplicationComboBox();
            bool validReleaseNotes = validateReleaseNotesTextbox();

            if (validApplicationSelected && validReleaseNotes)
            {
                application appClass = new application();
                appClass.ComboBoxValue = applicationComboBox.Text;
                appClass.ReleaseNotesText = releaseNotesTextbox.Text;

                #region Create ReadMe
                try
                {
                    createReadMeDocument.createReadMe(appClass);
                    copyBuildFiles.copyFiles(appClass);
                }
                catch//(Exception stuff)
                {
                    //MessageBox.Show(stuff.ToString());
                    MessageBox.Show("The selected application files could not be found");
                }
                #endregion

                #region Send Email Notification
                XmlDocument emailConfig = new XmlDocument();
                emailConfig.Load(executablePath + "\\" + Settings.Default.ConfigXMLFile);

                //check if email has been configured
                XmlNode hostNode = emailConfig.SelectSingleNode("settings/email/host");
                try
                {
                    if (hostNode != null)
                    {
                        email.sendEmailNotification(appClass);
                    }
                    else
                    {
                        if (MessageBox.Show("The email information has not configured and a notification will not be sent.\n\nWould you like to configure it now?", "Configure Email Alert", MessageBoxButtons.YesNo) == DialogResult.Yes)
                        {
                            ConfigureEmailForm configureEmail = new ConfigureEmailForm();
                            configureEmail.ShowDialog();

                            email.sendEmailNotification(appClass);
                        }
                    }
                }

                catch
                {
                    MessageBox.Show("The email information was not configured correctly");
                }
                #endregion

                releaseNotesTextbox.Clear();
                applicationComboBox.ResetText();
            }
        }
Esempio n. 3
0
 private void editEmail_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     ConfigureEmailForm configureEmail = new ConfigureEmailForm();
     configureEmail.loadEmailSettings();
     configureEmail.ShowDialog();
 }