Beispiel #1
0
        private TreeNode FillObject(string parentCaption, string key, SchemaCollectionBase collection)
        {
            TreeNode node = null;

            parentNode = this.ParentNode(parentCaption, key);
            this.FillNewButton(parentCaption, key);

            //ScriptSchemaObjectBase
            foreach (NamedSmoObject item in collection)
            {
                node = this.AddNode(item.Name, key);
            }

            return(node);
        }
Beispiel #2
0
        /// <summary>
        /// Carga el arbol con todas las tablas .-
        /// </summary>
        /// <param name="pTreeView">Nodo</param>
        /// <param name="pTables">Tablas</param>
        public static void LoadTreeView(TreeView pTreeView, SchemaCollectionBase pTables)
        {
            TreeNode wTreeNode;

            pTreeView.Nodes.Clear();
            foreach (TableViewBase wTable in pTables)
            {
                wTreeNode         = new TreeNode();
                wTreeNode.Checked = false;

                wTreeNode.Text = wTable.Name;
                wTreeNode.Tag  = wTable;
                pTreeView.Nodes.Add(wTreeNode);
                //LoadColumnsNodes(wTreeNode, wTable);
            }
        }
Beispiel #3
0
        private static List <DatabaseObject> GetDatabaseObjects(
            SchemaCollectionBase collection,
            DatabaseObjectType databaseObjectType
            )
        {
            var returnList = new List <DatabaseObject>();

            foreach (ScriptSchemaObjectBase item in collection)
            {
                if (!(bool)item.Properties["IsSystemObject"].Value)
                {
                    returnList.Add(new DatabaseObject(databaseObjectType, item.Schema, item.Name, item.Properties["Text"].Value.ToString().Trim()));
                }
            }

            return(returnList);
        }
Beispiel #4
0
        /// <summary>
        /// Carga el arbol con todas las tablas .- 
        /// </summary>
        /// <param name="pTreeView">Nodo</param>
        /// <param name="pTables">Tablas</param>
        public static void LoadTreeView(TreeView pTreeView, SchemaCollectionBase pTables)
        {
            TreeNode wTreeNode;
            pTreeView.Nodes.Clear();    
            foreach (TableViewBase wTable in pTables)
            {
                wTreeNode = new TreeNode();
                wTreeNode.Checked = false;
                
                wTreeNode.Text = wTable.Name;
                wTreeNode.Tag = wTable;
                pTreeView.Nodes.Add(wTreeNode);
                //LoadColumnsNodes(wTreeNode, wTable);

                
            }
           
        }
Beispiel #5
0
        static void add_urns_from_collection(SchemaCollectionBase coll, UrnCollection urns, bool progress = true)
        {
            var dt = DateTime.UtcNow;

            Console.WriteLine("PROCESSING {0}", coll.GetType().Name);

            int count = coll.Count;
            int idx   = 0;

            foreach (SqlSmoObject ob in coll)
            {
                if (progress)
                {
                    util.drawTextProgressBar(++idx, count, NormalizeUrn(ob.Urn));
                }

                if (ob is StoredProcedure)
                {
                    if (!((StoredProcedure)ob).IsSystemObject)
                    {
                        urns.Add(ob.Urn);
                    }
                }
                else
                {
                    PropertyInfo isSystem = ob.GetType().GetProperty("IsSystemObject");

                    if (null == isSystem ||
                        (!(bool)isSystem.GetValue(ob))
                        )
                    {
                        urns.Add(ob.Urn);
                    }
                }
            }

            Console.WriteLine("PROCESSED {0} {1}ms", coll.GetType().Name, DateTime.UtcNow.Subtract(dt).TotalMilliseconds);
        }
Beispiel #6
0
        private TreeNode FillObject(string parentCaption, string key, SchemaCollectionBase collection)
        {
            TreeNode node = null;
            parentNode = this.ParentNode(parentCaption, key);
            this.FillNewButton(parentCaption, key);

            //ScriptSchemaObjectBase
            foreach (NamedSmoObject item in collection)
            {
                node = this.AddNode(item.Name, key);
            }

            return node;
        }