Example #1
0
 public override void LoadFromXml(XmlElement xml)
 {
     base.LoadFromXml(xml);
     m_src     = (IDatabaseSource)DatabaseSourceAddonType.Instance.LoadAddon(xml.FindElement("Source"));
     m_dst     = (IDatabaseSource)DatabaseSourceAddonType.Instance.LoadAddon(xml.FindElement("Target"));
     m_datasyn = new DataSynDef();
     m_datasyn.LoadFromXml(xml.FindElement("Options"));
 }
Example #2
0
 public DataSynDefItem(DataSynDef syndef)
 {
     ColMode        = ColumnMode.All;
     CompareColMode = ColumnMode.All;
     Options        = new DataSynOptions();
     IsChecked      = true;
     m_syndef       = syndef;
 }
Example #3
0
 private void LoadFromJob(JobConnection jobconn, DataSynJobCommand cmd)
 {
     m_datasyn  = cmd.DataSyn;
     m_source   = cmd.Source;
     m_target   = cmd.Target;
     m_jobconn  = jobconn;
     m_cmd      = cmd;
     m_srcModel = null;
     m_dstModel = null;
     DownloadWhenNeededAndRefresh();
 }
Example #4
0
 public DataSynJobCommand(IDatabaseSource src, IDatabaseSource dst, DataSynDef datasyn, string outFile, List <IJobReportConfiguration> reports, DataSynGuiEnv guienv)
 {
     m_src     = src;
     m_dst     = dst;
     m_datasyn = datasyn;
     m_outFile = outFile;
     m_guienv  = guienv;
     if (reports != null)
     {
         ReportConfigs.AddRange(reports);
     }
 }
Example #5
0
 public void DragDrop_SynchronizeData(AppObject appobj)
 {
     if (appobj is DatabaseAppObject)
     {
         try
         {
             IDatabaseSource dsource = ((DatabaseAppObject)appobj).FindDatabaseConnection(m_appobj.ConnPack);
             DataSynForm.Run(DataSynDef.CreateEmpty(), dsource.CloneSource(), m_appobj.CreateDatabaseConnection());
         }
         catch (Exception e)
         {
             Errors.Report(e);
         }
     }
 }
Example #6
0
 public Synchronizer(IDatabaseSource src, IDatabaseSource dst, IProgressInfo progress, DataSynDef datasyn, DataSynReportEnv repenv, string outFile, DataSynGuiEnv guienv)
 {
     m_source       = src;
     m_target       = dst;
     m_progress     = progress;
     m_datasyn      = datasyn;
     m_outFile      = outFile;
     m_srcSada      = m_source.Dialect.CreateDataSynAdapter();
     m_dstSada      = m_target.Dialect.CreateDataSynAdapter();
     m_dstDDA       = m_target.GetAnyDDA();
     m_reportEnvObj = repenv;
     m_reportEnv    = repenv;
     m_guienv       = guienv;
     if (m_reportEnv == null)
     {
         m_reportEnv = new DummyDataSynReportEnv();
     }
 }
Example #7
0
        public DataSynForm(DataSynDef datasyn, IDatabaseSource src, IDatabaseSource dst)
        {
            Initialize();
            m_datasyn = datasyn;
            SetSource(src);
            SetTarget(dst);
            DownloadWhenNeededAndRefresh();
            Disposed += new EventHandler(DataSynForm_Disposed);
            OnlineHelpManager.RegisterHelpButton(btnOnlineHelp, "datasyn", true);
            UpdateEnabling();
            m_imgCache = new ImageCache(imageList1, Color.White);

            colSource.ImageGetter = row =>
            {
                if (row is ItemWrapper)
                {
                    var ds = ((ItemWrapper)row).m_item;
                    if (ds.Source is DataSynTableSource)
                    {
                        return(m_imgCache.GetImageIndex(CoreIcons.table));
                    }
                    if (ds.Source is DataSynViewSource)
                    {
                        return(m_imgCache.GetImageIndex(CoreIcons.view));
                    }
                    if (ds.Source is DataSynQuerySource)
                    {
                        return(m_imgCache.GetImageIndex(CoreIcons.sql));
                    }
                    return(-1);
                }
                return(m_imgCache.GetImageIndex(CoreIcons.cancel));
            };
            colTarget.ImageIndex = m_imgCache.GetImageIndex(CoreIcons.table);
            colState.ImageGetter = row =>
            {
                var wrap = row as ItemWrapper;
                if (wrap != null && wrap.StateImage != null)
                {
                    return(m_imgCache.GetImageIndex(wrap.StateImage));
                }
                return(-1);
            };
        }
Example #8
0
        public static void Synchronize(IDatabaseSource src, IDatabaseSource dst, IProgressInfo progress, DataSynDef datasyn, DataSynReportEnv repenv, string outFile, DataSynGuiEnv guienv)
        {
            Synchronizer syn = new Synchronizer(src, dst, progress, datasyn, repenv, outFile, guienv);

            syn.Progress = progress;
            syn.Run();
        }
Example #9
0
 public static Job CreateJob(IDatabaseSource src, IDatabaseSource dst, DataSynDef datasyn, string outFile, List <IJobReportConfiguration> reports, JobProperties jobProps, DataSynGuiEnv guienv)
 {
     //UsageStats.Usage("datasyn_job", "src", src.ToString(), "dst", dst.ToString());
     return(Job.FromCommand(new DataSynJobCommand(src, dst, datasyn, outFile, reports, guienv), jobProps));
 }
Example #10
0
 private static void ShowDataSynWindow()
 {
     DataSynForm.Run(DataSynDef.CreateEmpty(), null, null);
 }
Example #11
0
 public void SynchronizeData()
 {
     DataSynForm.Run(DataSynDef.CreateEmpty(), m_appobj.CreateDatabaseConnection(), null);
 }
Example #12
0
        public static void Run(DataSynDef datasyn, IDatabaseSource src, IDatabaseSource dst)
        {
            var win = new DataSynForm(datasyn, src, dst);

            win.Show();
        }