Exemplo n.º 1
0
        public void Display()
        {
            TreeView.Items.Clear();

            var repository = ModelRepository.GetRepository();

            _model = repository.GetModel();

            var propertiesPageBuilder = new PropertiesPageBuilder();

            var dacpacNode = AddRootTreeItem("Dacpac Properties");

            dacpacNode.Tag = new CachedObjectDisplay
            {
                Properties = propertiesPageBuilder.GetPropertiesDisplayForDacpac(_model),
                Script     = ""
            };

            if (repository.ValidateModel())
            {
                var messages     = _model.Validate();
                var messagesNode = AddTreeItem("Validation Result", dacpacNode, _defaultForeground);
                messagesNode.Tag = new CachedObjectDisplay
                {
                    Properties = propertiesPageBuilder.GetPropertiesDisplayForValidationMessages(messages),
                    Script     = ""
                };
            }


            DisplayTopLevelNode("Tables", ModelSchema.Table);
            DisplayTopLevelNode("Views", ModelSchema.View);

            var programabililtyNode = AddRootTreeItem("Programmability");

            DisplayTopLevelNode(programabililtyNode, "Procedures", ModelSchema.Procedure);
            DisplayTopLevelNode(programabililtyNode, "Scalar Functions", ModelSchema.ScalarFunction);
            DisplayTopLevelNode(programabililtyNode, "Table-Valued Functions", ModelSchema.TableValuedFunction);
            DisplayTopLevelNode(programabililtyNode, "Database Triggers", ModelSchema.DatabaseDdlTrigger);
            DisplayTopLevelNode(programabililtyNode, "Server Triggers", ModelSchema.ServerDdlTrigger);
            DisplayTopLevelNode(programabililtyNode, "Assemblies", ModelSchema.Assembly);

            var securityNode = AddRootTreeItem("Security");

            DisplayTopLevelNode(securityNode, "Server Logins", ModelSchema.Login);
            DisplayTopLevelNode(securityNode, "Database Users", ModelSchema.User);
            DisplayTopLevelNode(securityNode, "Schemas", ModelSchema.Schema);
            DisplayTopLevelNode(securityNode, "Roles", ModelSchema.Role);

            Cursor = Cursors.Arrow;
        }
Exemplo n.º 2
0
        public void Display()
        {
            TreeView.Items.Clear();

            var repository = ModelRepository.GetRepository();
            _model = repository.GetModel();

            var propertiesPageBuilder = new PropertiesPageBuilder();

            var dacpacNode = AddRootTreeItem("Dacpac Properties");
            dacpacNode.Tag = new CachedObjectDisplay
            {
                Properties = propertiesPageBuilder.GetPropertiesDisplayForDacpac(_model),
                Script = ""
            };

            if (repository.ValidateModel())
            {
                var messages = _model.Validate();
                var messagesNode = AddTreeItem("Validation Result", dacpacNode, _defaultForeground);
                messagesNode.Tag = new CachedObjectDisplay
                {
                    Properties = propertiesPageBuilder.GetPropertiesDisplayForValidationMessages(messages),
                    Script = ""
                };
            }


            DisplayTopLevelNode("Tables", ModelSchema.Table);
            DisplayTopLevelNode("Views", ModelSchema.View);

            var programabililtyNode = AddRootTreeItem("Programmability");
            DisplayTopLevelNode(programabililtyNode, "Procedures", ModelSchema.Procedure);
            DisplayTopLevelNode(programabililtyNode, "Scalar Functions", ModelSchema.ScalarFunction);
            DisplayTopLevelNode(programabililtyNode, "Table-Valued Functions", ModelSchema.TableValuedFunction);
            DisplayTopLevelNode(programabililtyNode, "Database Triggers", ModelSchema.DatabaseDdlTrigger);
            DisplayTopLevelNode(programabililtyNode, "Server Triggers", ModelSchema.ServerDdlTrigger);
            DisplayTopLevelNode(programabililtyNode, "Assemblies", ModelSchema.Assembly);

            var securityNode = AddRootTreeItem("Security");
            DisplayTopLevelNode(securityNode, "Server Logins", ModelSchema.Login);
            DisplayTopLevelNode(securityNode, "Database Users", ModelSchema.User);
            DisplayTopLevelNode(securityNode, "Schemas", ModelSchema.Schema);
            DisplayTopLevelNode(securityNode, "Roles", ModelSchema.Role);

            Cursor = Cursors.Arrow;
        }
Exemplo n.º 3
0
        private void DisplayObject(string rootNodeHeader, TSqlObject currentObject,
                                   TreeViewItem currentObjectTreeViewItem)
        {
            var propertiesPageBuilder = new PropertiesPageBuilder();
            var properties            = propertiesPageBuilder.GetPropertiesDisplay(currentObject);
            var script = GetScript(currentObject);

            currentObjectTreeViewItem.Tag = new CachedObjectDisplay
            {
                Properties = properties,
                Script     = script
            };

            var childObjectTypes = new Dictionary <string, TreeViewItem>();

            DisplyChildObjects(rootNodeHeader, currentObjectTreeViewItem, currentObject, childObjectTypes);
        }
Exemplo n.º 4
0
        private void DisplayObject(string rootNodeHeader, TSqlObject currentObject,
            TreeViewItem currentObjectTreeViewItem)
        {
            var propertiesPageBuilder = new PropertiesPageBuilder();
            var properties = propertiesPageBuilder.GetPropertiesDisplay(currentObject);
            var script = GetScript(currentObject);

            currentObjectTreeViewItem.Tag = new CachedObjectDisplay
            {
                Properties = properties,
                Script = script
            };

            var childObjectTypes = new Dictionary<string, TreeViewItem>();

            DisplyChildObjects(rootNodeHeader, currentObjectTreeViewItem, currentObject, childObjectTypes);
        }