Exemplo n.º 1
0
        public static string GetDatabaseName(this ITreeNode node)
        {
            IDatabaseTreeNode dbnode = GetDatabaseNode(node);

            if (dbnode != null)
            {
                return(dbnode.DatabaseConnection.DatabaseName);
            }
            return(null);
        }
Exemplo n.º 2
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;
        }
Exemplo n.º 3
0
        public static string ExtractRepresentativeName(this IDatabaseTreeNode node)
        {
            var    db     = node.DatabaseConnection;
            string dbname = null;

            if (db != null)
            {
                dbname = db.DatabaseName;
            }
            if (dbname == null && db.Connection != null && db.Connection.StoredConnection != null)
            {
                dbname = db.Connection.StoredConnection.ExplicitDatabaseName;
                if (dbname == null)
                {
                    try
                    {
                        dbname = System.IO.Path.GetFileNameWithoutExtension(node.Title);
                    }
                    catch { }
                }
            }
            return(dbname);
        }