Пример #1
0
 public DbDefChooseSpecObjectsTreeNode(DbDefChooseTreeNode parent, string objtype)
     : base(parent, objtype + "_list")
 {
     m_repr    = SpecificRepresentationAddonType.Instance.FindRepresentation(objtype);
     m_objtype = objtype;
     m_db      = parent.m_db;
 }
Пример #2
0
        //private void selectTemplateComboFrame1_ChangedSelectedItem(object sender, EventArgs e)
        //{
        //    RecreateBackupFormat();
        //}

        //private void RecreateBackupFormat()
        //{
        //    AddonHolder item = selectTemplateComboFrame1.SelectedAddonHolder;
        //    if (item != null) m_format = (IBackupFormat)item.CreateInstance();
        //    else m_format = new DataArchiveBackupFormat();
        //    propertyFrame1.SelectedObject = m_format;
        //}

        private void InitPropertiesPage()
        {
            try
            {
                Async.SafeOpen(m_source.Connection);
                DatabaseStructureMembers dbmem = new DatabaseStructureMembers
                {
                    TableList           = true,
                    SpecificObjectList  = true,
                    SchemaList          = true,
                    IgnoreSystemObjects = true,
                };
                IDatabaseStructure dbs = m_source.InvokeLoadStructure(dbmem, null);
                if (m_chooseNode == null)
                {
                    m_chooseNode    = new DbDefChooseTreeNode(dbs);
                    treObjects.Root = m_chooseNode;
                }
            }
            catch (Exception err)
            {
                Errors.Report(err);
                wizard1.Back();
            }
        }
Пример #3
0
        private void InitStructPage()
        {
            try
            {
                WantStructure();
                chbCopyStructure.Enabled = m_target.WriterCaps.AllowDataOnly;
                if (m_chooseNode == null)
                {
                    m_chooseNode    = new DbDefChooseTreeNode(m_structure);
                    treObjects.Root = m_chooseNode;
                }
                if (m_target.WriterCaps.MultipleSchema)
                {
                    // originalni schemata muzeme udrzet jen v pripade, ze nejaka existuji
                    rbOriginalSchema.Enabled = m_chooseNode.m_db.Schemata.Count > 0;

                    if (m_target.WriterCaps.HasStructure)
                    {
                        rbExplicitSchema.Enabled = true;
                        cbxExplicitSchema.Items.Clear();
                        m_target.OpenConnection();
                        foreach (var name in StructLoader.SchemaNames(mem2 => m_target.InvokeLoadStructure(mem2, null)))
                        {
                            cbxExplicitSchema.Items.Add(name);
                        }
                        if (cbxExplicitSchema.Items.Count > 0)
                        {
                            cbxExplicitSchema.SelectedIndex = 0;
                        }
                    }
                    else
                    {
                        rbExplicitSchema.Enabled = false;
                    }
                }
                else
                {
                    rbExplicitSchema.Enabled = rbOriginalSchema.Enabled = false;
                }
                if (!rbOriginalSchema.Enabled && rbOriginalSchema.Checked)
                {
                    rbDefaultSchema.Checked = true;
                }
                if (!rbExplicitSchema.Enabled && rbExplicitSchema.Checked)
                {
                    rbDefaultSchema.Checked = true;
                }
                cbxExplicitSchema.Enabled = rbExplicitSchema.Checked;
            }
            catch (Exception err)
            {
                Errors.Report(err);
                wizard1.Back();
            }
        }
Пример #4
0
        //public static bool Run(CopyDbJobCommand command)
        //{
        //    CopyDbWizard wizard = new CopyDbWizard(command);
        //    return wizard.ShowDialogEx() == DialogResult.OK;
        //}

        private void wpSource_CloseFromNext(object sender, Gui.Wizard.PageEventArgs e)
        {
            IDatabaseTreeNode node = treSource.Selected as IDatabaseTreeNode;

            if (node == null)
            {
                StdDialog.ShowError("s_please_select_database");
                e.Page = wpSource;
                return;
            }
            m_source = node.DatabaseConnection.CloneSource();
            if (m_source.Connection != null)
            {
                m_source.Connection.Owner = this;
            }
            m_chooseNode          = null;
            m_structure           = null;
            m_dataPageInitialized = false;
        }
Пример #5
0
 public DbDefChooseTablesTreeNode(DbDefChooseTreeNode parent)
     : base(parent, "tables")
 {
     m_db = parent.m_db;
 }
Пример #6
0
 public DbDefChooseDomainsTreeNode(DbDefChooseTreeNode parent)
     : base(parent, "domains")
 {
     m_db = parent.m_db;
 }