Example #1
0
        public override IMigrationProfile CreateMigrationProfile()
        {
            MySqlMigrationProfile cfg = GlobalSettings.Pages.PageByName("mysql_migration") as MySqlMigrationProfile;
            MySqlMigrationProfile res = new MySqlMigrationProfile();

            SettingsTool.CopySettingsPage(cfg, res);
            return(res);
        }
Example #2
0
        public void WriteStart(StreamWriter fw, ITableStructure table, ref object manager)
        {
            var fmtset = new DataFormatSettings();

            SettingsTool.CopySettingsPage(FormatSettings, fmtset);
            fmtset.DateTimeFormat = "s";
            fw.Write(IoRes.excelxml_start.Replace("#HDRCOLOR#", m_headerColor.ToWebName()));
            WriteHeaders(fw, table, m_sheetName);
            manager = new Manager {
                formatter = new BedValueFormatter(fmtset)
            };
        }
        public SynchronizeStructureForm(IDatabaseSource src, IDatabaseSource dst, SynchronizeExtData extInfo)
        {
            m_synExtData = extInfo;
            InitializeComponent();
            m_imgCache = new ImageCache(imageList1, Color.White);
            //btnUncheckAll.Image = ImageTool.CombineImages(CoreIcons.check, CoreIcons.delete_overlay);
            ConnPack.Cache = new CachePack
            {
                ReuseAnalyserCache = true
            };
            //m_srcData = new TreeStructureData(treeSource, Color.Green, this, src, true);
            //m_dstData = new TreeStructureData(treeTarget, Color.Red, this, dst, false);
            //m_srcData.OtherTree = m_dstData;
            //m_dstData.OtherTree = m_srcData;
            Disposed += new EventHandler(SynchronizeStructureForm_Disposed);
            m_srcDb   = src;
            m_dstDb   = dst;
            if (m_srcDb != null)
            {
                m_srcDb.ChangeConnection(ConnPack);
            }
            if (m_dstDb != null)
            {
                m_dstDb.ChangeConnection(ConnPack);
            }
            //m_invoker = new ControlInvoker(this);
            m_settings = new SynchronizeSettings();
            SettingsTool.CopySettingsPage((SynchronizeSettings)GlobalSettings.Pages.PageByName("synchronize"), m_settings);
            //m_trace = new TraceVisibilityHandler(btnTrace);

            UpdateTitles();
            DownloadWhenNeededAndRefresh();

            colObjectType.ImageGetter         = row => ((DbDiffAction)row).GetObjectTypeImage(m_imgCache);
            colRelation.ImageGetter           = row => ((DbDiffAction)row).GetRelationImage(m_imgCache);
            colColumnRelation.ImageGetter     = row => ((DbDiffAction)row).GetRelationImage(m_imgCache);
            colConstraintRelation.ImageGetter = row => ((DbDiffAction)row).GetRelationImage(m_imgCache);
            colConstraintType.ImageGetter     = row => ((DbDiffAction)row).GetObjectTypeImage(m_imgCache);
            colObjType.ImageGetter            = row => ((DbDiffAction)row).GetObjectTypeImage(m_imgCache);

            if (extInfo != null && extInfo.Dbs != null)
            {
                FillDbs(btnSelectSourceDb, cbxSelectSource);
                if (extInfo.SelectedSource != null)
                {
                    cbxSelectSource.SelectedIndex = cbxSelectSource.Items.IndexOf(extInfo.SelectedSource);
                }

                FillDbs(btnSelectTargetDb, cbxSelectTarget);
                if (extInfo.SelectedTarget != null)
                {
                    cbxSelectTarget.SelectedIndex = cbxSelectTarget.Items.IndexOf(extInfo.SelectedTarget);
                }
            }
            else
            {
                cbxSelectSource.Visible = false;
                cbxSelectTarget.Visible = false;
            }

            m_initialized = true;
        }