public void Notify(DataChangedNotifyEvent e) { if (Dispatcher == null) { return; } ThreadPool.QueueUserWorkItem(Dispatcher.OnDateChanged, e); }
public void Notify(IEntity item, int dmlType) { if (Dispatcher == null) { return; } DataChangedNotifyEvent e = new DataChangedNotifyEvent() { Entity = item, DMLType = dmlType }; ThreadPool.QueueUserWorkItem(Dispatcher.OnDateChanged, e); }
protected virtual internal void OnDateChanged(object objE) { DataChangedNotifyEvent e = (DataChangedNotifyEvent)objE; if (e.Entity != null || e.Entity.RecordId == null) { return; } lock (this) { int index = changedEvents.FindIndex(x => x.CompareTo(e) == 0); if (index >= 0) { changedEvents[index] = e; } else { changedEvents.Add(e); } } }