Esempio n. 1
0
        private void dependenciesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.ListView.SelectedItems.Count == 0)
            {
                return;
            }

            object      selectedObject   = this.ListView.SelectedItems[0].Tag;
            IScriptable scriptableObject = selectedObject as IScriptable;

            if (scriptableObject != null &&
                !(selectedObject is Database))
            {
                SqlSmoObject[] smoObjects = new SqlSmoObject[1];
                smoObjects[0] = (SqlSmoObject)selectedObject;

                Scripter         scripter = new Scripter(this.sqlServerSelection);
                DependenciesForm frm      = new DependenciesForm(this.sqlServerSelection,
                                                                 scripter.DiscoverDependencies(smoObjects, DependencyType.Parents));

                frm.ShowDialog(this);
            }
        }
Esempio n. 2
0
        private void dependenciesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.ListView.SelectedItems.Count == 0)
            {
                return;
            }

            object selectedObject = this.ListView.SelectedItems[0].Tag;
            IScriptable scriptableObject = selectedObject as IScriptable;
            if (scriptableObject != null
                && !(selectedObject is Database))
            {
                SqlSmoObject[] smoObjects = new SqlSmoObject[1];
                smoObjects[0] = (SqlSmoObject)selectedObject;

                Scripter scripter = new Scripter(this.sqlServerSelection);
                DependenciesForm frm = new DependenciesForm(this.sqlServerSelection,
                    scripter.DiscoverDependencies(smoObjects, DependencyType.Parents));

                frm.ShowDialog(this);
            }
        }