Beispiel #1
0
        public int addSynchObject(object obj, SynchType type)
        {
            int         key = System.Guid.NewGuid().ToString().GetHashCode();
            SynchObject so  = new SynchObject(obj, type, key);

            m_SynchObjectList[key] = so;
            return(key);
        }
Beispiel #2
0
 private void OnElapsed(object obj, ElapsedEventArgs args)
 {
     m_Timer.Enabled = false;
     foreach (int key in m_SynchObjectList.Keys)
     {
         SynchObject o = m_SynchObjectList[key];
         if (o.SynchronizationType == SynchType.SELECT)
         {
             select(o.SynchronizationObject as object);
         }
         else
         {
             update(obj);
         }
         if (OnSynchronized != null)
         {
             OnSynchronized.Invoke(o);
         }
     }
     m_Timer.Enabled = true;
 }