예제 #1
0
        public void Notify(DataChangedNotifyEvent e)
        {
            if (Dispatcher == null)
            {
                return;
            }

            ThreadPool.QueueUserWorkItem(Dispatcher.OnDateChanged, e);
        }
예제 #2
0
        public void Notify(IEntity item, int dmlType)
        {
            if (Dispatcher == null)
            {
                return;
            }

            DataChangedNotifyEvent e = new DataChangedNotifyEvent()
            {
                Entity  = item,
                DMLType = dmlType
            };

            ThreadPool.QueueUserWorkItem(Dispatcher.OnDateChanged, e);
        }
예제 #3
0
        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);
                }
            }
        }