/// <summary>
        /// Creates a new ReportExplorer object
        /// </summary>
        public DatabasesTreeViewPad() : base()
        {
            WorkbenchSingleton.Workbench.ActiveViewContentChanged += ActiveViewContentChanged;
            WorkbenchSingleton.Workbench.ViewClosed += ActiveViewClosed;

            _control           = new DatabasesTreeViewUserControl();
            _databasesTreeView = new DatabasesTreeView();
            _databasesTreeView.AdditionalNodes.Add(CSDLDatabaseTreeViewAdditionalNode.Instance);
            DockPanel.SetDock(_databasesTreeView, Dock.Top);
            _control.Content.Children.Add(_databasesTreeView);

            _instance = this;
        }
        public PullModelPanel()
        {
            InitializeComponent();

            base.EnableFinish         = false;
            base.EnableNext           = false;
            base.EnableCancel         = true;
            this.firstDrag            = true;
            base.IsLastPanel          = false;
            this.txtSqlString.Enabled = false;

            this.databasesTreeHost = new ElementHost()
            {
                Dock = DockStyle.Fill
            };
            this.databasesTree = new DatabasesTreeView();
            this.databasesTree.SelectedItemChanged += new System.Windows.RoutedPropertyChangedEventHandler <object>(databasesTree_SelectedItemChanged);
            this.databasesTreeHost.Child            = this.databasesTree;
            this.label2.Controls.Add(databasesTreeHost);

            Localize();
        }
Beispiel #3
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            var serverTasks = new List <Task>();

            Settings.Servers.AsParallel().ForAll(AddNodesForServer);
            databaseTreeModel.Sort(new Comparison <TreeViewModel <DatabaseTreeNode> >((i, j) => i.Value.ServerDefinition.DisplayName.CompareTo(j.Value.ServerDefinition.DisplayName)));

            DatabasesTreeView.ItemsSource = databaseTreeModel;
            DatabasesTreeView.KeyDown    += (o, ev) =>
            {
                if (ev.Key == Key.Space)
                {
                    if (o is TreeView treeView && treeView.SelectedItem is TreeViewModel <DatabaseTreeNode> selectedItem)
                    {
                        selectedItem.IsChecked ^= true;
                        ev.Handled              = true;
                    }
                }
            };
            DatabasesTreeView.Focus();
            // TODO look at adding code completion based on
            // https://www.codeproject.com/Articles/42490/Using-AvalonEdit-WPF-Text-Editor
            // https://stackoverflow.com/questions/13263046/sql-intellisense-in-wpf-textbox
        }