예제 #1
0
        private static bool DisplayTableSubNodes(TreeNode <IDataPath> pt, ApplicationCommand cmd)
        {
            if (!(pt.Item is TableName))
            {
                return(false);
            }

            TableName tname = (TableName)pt.Item;

            bool flag = false;

            if (cmd.HasDefinition)
            {
                if (tname.Type == TableNameType.View)
                {
                    cout.WriteLine("cannot display view structure");
                    return(false);
                }

                _DisplayColumnNodes(cmd, tname);
                return(true);
            }

            if (cmd.HasPrimaryKey)
            {
                displayTable(tname.PrimaryKeySchema(), "Primary Key(s)");
                flag = true;
            }

            if (cmd.HasForeignKey)
            {
                displayTable(tname.ForeignKeySchema(), "Foreign Key(s)");
                flag = true;
            }

            if (cmd.HasDependency)
            {
                displayTable(tname.DependenySchema(), "Dependencies");
                flag = true;
            }

            if (cmd.HasIdentityKey)
            {
                displayTable(tname.IdentityKeySchema(), "Identity Key(s)");
                flag = true;
            }

            if (cmd.HasIndex)
            {
                displayTable(tname.IndexSchema(), "Indices");
                flag = true;
            }


            if (cmd.HasStorage)
            {
                displayTable(tname.StorageSchema(), "Storage");
                flag = true;
            }


            if (flag)
            {
                return(true);
            }

            _DisplayLocatorNodes(pt, cmd);
            return(true);
        }