Exemple #1
0
        private void SettingsButton_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //Fenster öffnen und erst weitermachen wenn wieder geschlossen
            Form_Settings myForm_Settings = new Form_Settings(this);

            myForm_Settings.ShowDialog();
        }
 private void btnSettings_Click(object sender, EventArgs e)
 {
     using (var form = new Form_Settings())
     {
         form.ShowDialog();
     }
 }
Exemple #3
0
 private void ToolStrip_Main_Tools_Settings_Click(object sender, EventArgs e)
 {
     if (setting.IsDisposed)
     {
         setting = new Form_Settings();
         setting.Show();
     }
     else
     {
         setting.Show();
     }
 }
Exemple #4
0
        private void ButtonSettings_Click(object sender, EventArgs e)
        {
            Form_Settings Settings = new Form_Settings();

            SetChildFormCenter(Settings);
            Settings.ShowDialog();

            if (Settings.IsChange && Settings.IsChangeSaved && Settings.IsRestartNeeded)
            {
                MessageBox.Show(
                    International.GetText("Form_Main_Restart_Required_Msg"),
                    International.GetText("Form_Main_Restart_Required_Title"),
                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                Process PHandle = new Process();
                PHandle.StartInfo.FileName = Application.ExecutablePath;
                PHandle.Start();
                Close();
            }
            else if (Settings.IsChange && Settings.IsChangeSaved)
            {
                InitLocalization();
                InitMainConfigGUIData();
            }
        }
Exemple #5
0
        //
        // GET+POST: /Backend/Settings
        public ActionResult Settings()
        {
            Form_Settings form = new Form_Settings(this._app.ListLength, this._app.UnregistredComments);

            if (Request.HttpMethod.ToLower() == form.getMethod().ToString())
            {
                if (form.isValid(Request.Form))
                {
                    if (this._app.saveSettings(form))
                    {
                        _messages.addMessage("Settings have been successfully saved");
                        return Redirect("/backend");
                    }
                    else
                    {
                        _messages.addError("There was an error while saving settings");
                    }
                }
            }

            ViewData["form"] = form.render();
            return View();
        }
Exemple #6
0
        /// <summary>
        /// Saves settings
        /// </summary>
        /// <param name="form">Form instance</param>
        /// <returns>boolean</returns>
        public bool saveSettings(Form_Settings form)
        {
            using (SettingsDataContext s = new SettingsDataContext())
            {
                try
                {
                    setting len = s.settings.Where(x => x.name == "list_length").Single();
                    len.value = form["list_length"].getValue();

                    setting comm = s.settings.Where(x => x.name == "unregistered_comments").Single();
                    comm.value = form["unregistered_comments"].getValue();

                    s.SubmitChanges();
                }
                catch (Exception){
                    return false;
                }

                return true;
            }
        }
Exemple #7
0
        public void ShowFormSettings()
        {
            var fs = new Form_Settings();

            fs.ShowDialog(this);
        }
Exemple #8
0
 private void barButtonItem_ServerSettings_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     frm_Settings = new Form_Settings();
     frm_Settings.ShowDialog();
 }