Example #1
0
        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
            }
        }
Example #2
0
 private void SetIsDirty()
 {
     if (IsDirty != null)
     {
         IsDirty.Invoke(this, true);
     }
 }
Example #3
0
        /// <summary>
        /// Returns the hash code for this instance.
        /// </summary>
        /// <returns>A hash code for the current <see cref="ORMEntity"/></returns>
        public override int GetHashCode()
        {
            var hashCode = new HashCode();

            for (int i = 0; i < MutableTableScheme.Count; i++)
            {
                hashCode.Add(this[MutableTableScheme[i]]?.GetHashCode());
            }

            hashCode.Add(IsDirty.GetHashCode());
            hashCode.Add(PrimaryKey.GetHashCode());

            return(hashCode.ToHashCode());
        }
Example #4
0
        public override int GetHashCode()
        {
            var hashCode = 310520135;

            hashCode = hashCode * -1521134295 + IsDirty.GetHashCode();
            hashCode = hashCode * -1521134295 + IsOpen.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(WorkItemName);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(WorkItemID);

            hashCode = hashCode * -1521134295 + ((ISupportsFocus)this).IsFocused.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <IWorkItem> .Default.GetHashCode(Parent);

            hashCode = hashCode * -1521134295 + IsModal.GetHashCode();
            return(hashCode);
        }
Example #5
0
        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);
                }
            }
        }
Example #6
0
 public override string ToString()
 {
     return("Target=" + Target + ", IsValid=" + IsValid +
            ", IsDirty=" + (IsDirtyTrackingStarted ? IsDirty.ToString() : "not started"));
 }