Exemplo n.º 1
0
        private void expertSettingsBtn_Click(object sender, EventArgs e)
        {
            // First get the latest settings
            WriteSettings(_mjo, false); // Only temp

            MonitorTaskExpertSettingsForm expertSettings = new MonitorTaskExpertSettingsForm(_mjo);

            expertSettings.ShowDialog();

            // Now read the new settings and update
            ReadSettings(ref _mjo);
        }
Exemplo n.º 2
0
        private void oKcmd_Click(object sender, EventArgs e)
        {
            //Not required, since it interfers with UNC paths with Username and Passwords, either way paths can be invalidated on the fly

            /*if (!System.IO.Directory.Exists(searchPathTxt.Text))
             * {
             *  MessageBox.Show("Path " + searchPathTxt.Text + " is invalid", "Invalid Path", MessageBoxButtons.OK,
             *                  MessageBoxIcon.Error);
             *  return;
             * }*/

            string sourceName = sourceNameTxt.Text.Trim();

            if (String.IsNullOrWhiteSpace(sourceName))
            {
                MessageBox.Show(Localise.GetPhrase("Please supply a source name"), Localise.GetPhrase("No name supplied"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            searchPathTxt.Text = searchPathTxt.Text.Trim();
            if (String.IsNullOrWhiteSpace(searchPathTxt.Text))
            {
                MessageBox.Show(Localise.GetPhrase("Please supply a search path name"), Localise.GetPhrase("No name supplied"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (_newTask)
            {
                if ((_mceOptions.AllMonitorTasks.FindIndex(item => item.taskName.ToLower() == sourceName.ToLower()) >= 0) || (_mceOptions.AllConversionTasks.FindIndex(item => item.taskName.ToLower() == sourceName.ToLower()) >= 0)) // check both monitor and conversion task name otherwise they may overwrite the same section in the ini file
                {
                    MessageBox.Show(Localise.GetPhrase("A source name or section") + " " + sourceNameTxt.Text + " " + Localise.GetPhrase("already exists. Please use another name"), Localise.GetPhrase("Duplicate Name"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }

            CheckNetDrive(true);

            // Quick validate the remaining settings with the ExpertForm
            MonitorTaskExpertSettingsForm expertSettings = new MonitorTaskExpertSettingsForm(_mjo);

            expertSettings.WriteAndValidateSettings(); // Clean up expert settings to avoid conflicts

            // Now write the settings
            WriteSettings(_mjo, true);

            this.Close();
        }
Exemplo n.º 3
0
        private void expertSettingsBtn_Click(object sender, EventArgs e)
        {
            // First get the latest settings
            WriteSettings(_mjo, false); // Only temp

            MonitorTaskExpertSettingsForm expertSettings = new MonitorTaskExpertSettingsForm(_mjo);
            expertSettings.ShowDialog();

            // Now read the new settings and update
            ReadSettings(ref _mjo);
        }
Exemplo n.º 4
0
        private void oKcmd_Click(object sender, EventArgs e)
        {
            //Not required, since it interfers with UNC paths with Username and Passwords, either way paths can be invalidated on the fly
            /*if (!System.IO.Directory.Exists(searchPathTxt.Text))
            {
                MessageBox.Show("Path " + searchPathTxt.Text + " is invalid", "Invalid Path", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }*/

            string sourceName = sourceNameTxt.Text.Trim();
            if (String.IsNullOrWhiteSpace(sourceName))
            {
                MessageBox.Show(Localise.GetPhrase("Please supply a source name"), Localise.GetPhrase("No name supplied"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            searchPathTxt.Text = searchPathTxt.Text.Trim();
            if (String.IsNullOrWhiteSpace(searchPathTxt.Text))
            {
                MessageBox.Show(Localise.GetPhrase("Please supply a search path name"), Localise.GetPhrase("No name supplied"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (_newTask)
            {
                if ((_mceOptions.AllMonitorTasks.FindIndex(item => item.taskName.ToLower() == sourceName.ToLower()) >= 0) || (_mceOptions.AllConversionTasks.FindIndex(item => item.taskName.ToLower() == sourceName.ToLower()) >= 0)) // check both monitor and conversion task name otherwise they may overwrite the same section in the ini file
                {
                    MessageBox.Show(Localise.GetPhrase("A source name or section") + " " + sourceNameTxt.Text + " " + Localise.GetPhrase("already exists. Please use another name"), Localise.GetPhrase("Duplicate Name"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }

            CheckNetDrive(true);

            // Quick validate the remaining settings with the ExpertForm
            MonitorTaskExpertSettingsForm expertSettings = new MonitorTaskExpertSettingsForm(_mjo);
            expertSettings.WriteAndValidateSettings(); // Clean up expert settings to avoid conflicts

            // Now write the settings
            WriteSettings(_mjo, true);

            this.Close();
        }