/// <summary> /// Sets the node as dirty /// </summary> protected void SetDirty() { if (DirtyChanged != null) { DirtyChanged.Invoke(this, new EventArgs()); } }
public void SetDirty(bool isDirty) { if (IsDirty == isDirty) { return; } IsDirty = isDirty; DirtyChanged?.Invoke(this, new EventArgs()); }
private void SetDirty(bool Dirty) { if (this.Dirty != Dirty) { this.Dirty = Dirty; if (DisabledEventCount == 0 && DirtyChanged != null) { DirtyChanged.Invoke(Dirty); } } }
void OnCellValueChanged(object sender, EventArgs e) { bool isDirty = History.CanUndo || Root.Params.Data.IsChanged || Root.Data.DataSet.IsChanged || Root.PageSetting.Data.IsChanged || Root.ViewSetting.Data.IsChanged; if (IsDirty != isDirty) { IsDirty = isDirty; DirtyChanged?.Invoke(this, IsDirty); } }
private void CellEdited(DataGridViewCell cell, IExamCell icell) { DataGridViewCellStyle style = cell.DataGridView.Rows[cell.RowIndex].Cells[0].Style; Color defaultBackColor = style.BackColor; Color defaultForeColor = style.ForeColor; cell.Style.BackColor = defaultBackColor; cell.Style.ForeColor = defaultForeColor; cell.ToolTipText = ""; string value = cell.Value == null ? "" : cell.Value.ToString().Trim(); cell.Value = value; if (icell != null) { icell.SetValue(value); if (icell.IsValid()) { icell.Standard.Judge(cell); if (icell.IsDirty) { cell.Style.BackColor = Color.Yellow; cell.ToolTipText = "此欄位值已變更,其原值為『" + icell.DefaultValue + "』"; } } else { cell.Style.BackColor = Color.Red; cell.Style.ForeColor = defaultForeColor; cell.ToolTipText = "錯誤!!此欄位必須為數字"; } } if (DirtyChanged != null) { DirtyChanged.Invoke(this, new DirtyChangedEventArgs(IsDirty())); } }
/// <summary> /// This raises the <see cref="DirtyChanged"/> event /// </summary> /// <param name="e">The event arguments</param> protected void OnDirtyChanged(EventArgs e) { DirtyChanged?.Invoke(this, e); }
public void FireDirtyChanged() { DirtyChanged?.Invoke(); }
/// <summary> /// Overridable method to handle dirty changing /// </summary> protected virtual void OnDirtyChanged() { DirtyChanged?.Invoke(this, new EventArgs()); }