예제 #1
0
        private void testSettings_Click(object sender, EventArgs e)
        {
            // Validate settings
            if (CheckSettings() == false)
            {
                return;
            }

            GeneralOptions go = _go.Clone(); // Create a temporary object to test with

            WriteSettings(go);               // Update the temp GO object with the test settings, only testing it so we don't need to write main object

            if (MessageBox.Show(Localise.GetPhrase("MCEBuddy will send an eMail to test the server settings.\r\nThis can take upto 60 seconds.\r\nMCEBuddy may be unresponsive during this period."),
                                Localise.GetPhrase("Test eMail"),
                                MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Cancel)
            {
                return;
            }


            // Disable the control except for Ok and Cancel
            foreach (Control ctl in this.Controls)
            {
                ctl.Enabled = false;
            }
            oKcmd.Enabled = cmdCancel.Enabled = true;

            testSettings.Text        = Localise.GetPhrase("Testing");
            _testThread              = new Thread(() => eMail_SendTest(go)); // Send the eMail through a thead
            _testThread.IsBackground = true;                                 // Kill thread when object terminates
            _testThread.Start();
        }
예제 #2
0
        public Options Clone()
        {
            Options clone = new Options();

            clone.GeneralOptions = GeneralOptions != null?GeneralOptions.Clone() : null;

            clone.NuSpecOptions = NuSpecOptions != null?NuSpecOptions.Clone() : null;

            return(clone);
        }
예제 #3
0
        public Options Clone()
        {
            Options clone = new Options();

            clone.Identifier     = Identifier;
            clone.GeneralOptions = GeneralOptions != null?GeneralOptions.Clone() : null;

            clone.MsBuildOptions = MsBuildOptions != null?MsBuildOptions.Clone() : null;

            clone.NuGetOptions = NuGetOptions != null?NuGetOptions.Clone() : null;

            return(clone);
        }
 public void SaveOptions(GeneralOptions options)
 {
     _options = options.Clone();
 }