private void btnSave_Click(object sender, EventArgs e) { if (General.cfg == null) { General.cfg = new ConfigApp(); } General.cfg.g = new GeneralSettings() { noproxyserver = chkProxy.Checked, disablegpu = chkGPU.Checked, disablecanvas = chkCanvas.Checked, disablewebgl = chkWebGL.Checked, enableWebRTC = chkWebRTC.Checked, externalbrowser = txtExternalBrowser.Text, agent = txtAgent.Text, cookies = txtCookies.Text }; //save XmlHelper.ToXmlFile(General.cfg, General.configPath); if (!this.isNew) { IsDirty.Invoke(this, true); } else { MessageBox.Show("Please proceed at tray icon icon, right click it, select 'settings' and set the needed websites. Keep in mind on any setting change application restart required.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information); this.Parent.Parent.Parent.Dispose(); //close parent form } }
private void SetIsDirty() { if (IsDirty != null) { IsDirty.Invoke(this, true); } }
private void setDirty(int i, bool val) { if (_Dirty == null) { return; } if (i < 0) { i = 0; } else if (i >= _Dirty.Length) { i = _Dirty.Length - 1; } if (_Dirty[i] != val) { _Dirty[i] = val; if (_Dirty[i]) { IsDirty?.Invoke(this, i); } } }