예제 #1
0
 /// <summary>
 /// Sets the node as dirty
 /// </summary>
 protected void SetDirty()
 {
     if (DirtyChanged != null)
     {
         DirtyChanged.Invoke(this, new EventArgs());
     }
 }
예제 #2
0
파일: PartModel.cs 프로젝트: Dadstart/MOPE2
        public void SetDirty(bool isDirty)
        {
            if (IsDirty == isDirty)
            {
                return;
            }

            IsDirty = isDirty;
            DirtyChanged?.Invoke(this, new EventArgs());
        }
예제 #3
0
 private void SetDirty(bool Dirty)
 {
     if (this.Dirty != Dirty)
     {
         this.Dirty = Dirty;
         if (DisabledEventCount == 0 && DirtyChanged != null)
         {
             DirtyChanged.Invoke(Dirty);
         }
     }
 }
예제 #4
0
        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);
            }
        }
예제 #5
0
        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()));
            }
        }
예제 #6
0
 /// <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();
 }
예제 #8
0
 /// <summary>
 /// Overridable method to handle dirty changing
 /// </summary>
 protected virtual void OnDirtyChanged()
 {
     DirtyChanged?.Invoke(this, new EventArgs());
 }