示例#1
0
        private void RunItem(DataSynDefItem item)
        {
            if (m_guienv != null)
            {
                if (m_guienv.Filter != null && !m_guienv.Filter.Contains(item.Target.Table))
                {
                    return;
                }

                var it = new SynItem(this, item);
                SetItemState(it, SynItemState.Start);
                it.InitAndLoadFootprints();
                it.ProcessFootprints();
                if (m_guienv.CompareOnly)
                {
                    SetItemState(it, SynItemState.Compared);
                }
                else
                {
                    SetItemState(it, SynItemState.Synchronized);
                }
                it.DetachFromSynchronizer();
            }
            else
            {
                using (var it = new SynItem(this, item))
                {
                    it.Run();
                }
            }
        }
示例#2
0
 private void SetItemState(SynItem item, SynItemState state)
 {
     item.State = state;
     if (m_guienv != null)
     {
         m_guienv.OnItemEvent(item, state);
     }
 }
示例#3
0
            SynItem GetItem()
            {
                var     key = m_item.Target.Table;
                SynItem res = null;

                m_form.m_items.TryGetValue(key, out res);
                return(res);
            }
示例#4
0
 public void OnItemEvent(SynItem it, SynItemState ev)
 {
     MainWindow.Instance.RunInMainWindow(() =>
     {
         if (ItemEvent != null)
         {
             ItemEvent(this, new SynItemEventArgs {
                 State = ev, Item = it
             });
         }
     });
 }
示例#5
0
 public void SetItem(DataSynDefItem item, SynItem synitem)
 {
     m_item       = item;
     m_sourceHint = null;
     m_targetHint = null;
     if (m_item != null && !m_itemCache.ContainsKey(m_item))
     {
         m_itemCache[m_item] = new CacheItem();
     }
     m_synItem = synitem;
     RefreshData();
 }