Exemplo n.º 1
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();
            }
        }