public BlinkInfo(BlinkState state, int recordIndex, int fieldIndex, int tickCount, ChangedFieldInfo ci) { this.BlinkState = state; this.recordIndex = recordIndex; this.fieldIndex = fieldIndex; this.tickCount = tickCount; this.ci = ci; }
private void dt_ColumnChanging(object sender, DataColumnChangeEventArgs e) { string name = e.Column.ColumnName; ChangedFieldInfo ci = new ChangedFieldInfo(_pdc, name, e.Row[e.Column], e.ProposedValue); AddChangedField(ci); //Console.WriteLine("{0} : {1} -> {2} ({3})", ci.Name, ci.OldValue, ci.NewValue, e.Row[0]); }
/// <summary> /// This virtual method gets called before a row is removed from /// the underlying datasource. /// </summary> /// <param name="row"></param> protected virtual void OnPrepareRemoving(object row) { for (int n = 0; n < _pdc.Count; n++) { PropertyDescriptor pd = _pdc[n]; if (pd.PropertyType == typeof(double)) { object value = GetValue(row, pd); ChangedFieldInfo ci = new ChangedFieldInfo(_pdc, pd.Name, value, null); this.AddChangedField(ci); } } }
/// <summary> /// Call this method to add ChangedFieldInfo /// objects with information about the new and old value of the column. The /// ChangedFieldInfo objects will then be checked in the LIstChanged event handler. /// </summary> public void AddChangedField(ChangedFieldInfo ci) { if (!_changedFields.Contains(ci.FieldIndex)) { _changedFields[ci.FieldIndex] = ci; _changedFieldsArray.Add(ci); //foreach (int dependantIndex in GetDependantFields(ci.FieldIndex)) //{ // if (!changedFields.Contains(dependantIndex)) // AddChangedField(new ChangedFieldInfo(properties, properties[dependantIndex].Name)); //} } else { // Combine ChangeField ChangedFieldInfo ci0 = (ChangedFieldInfo)_changedFields[ci.FieldIndex]; ci0.NewValue = ci.NewValue; } }