Ejemplo n.º 1
0
        public ResultViewModel(tableViewModel TVM, bool getResultByTreeView)
        {
            _getResultByTreeView = getResultByTreeView;
            if (getResultByTreeView)
            {
                isNew      = true;
                isModified = true;
            }
            _getResultByQuery = true;
            _TableViewModel   = TVM;

            simpleCommand = new RelayCommand(new Action <object>(DoSimpleCommand));

            RefreshResult();
        }
Ejemplo n.º 2
0
 public columnViewModel(Column Column, tableViewModel parentTable)
     : base(parentTable, false)
 {
     _column = Column;
 }
Ejemplo n.º 3
0
 public columnViewModel(Column Column, tableViewModel parentTable)
     : base(parentTable, false)
 {
     _column = Column;
 }
Ejemplo n.º 4
0
        private void MainTreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
        {
            TreeView tv = (TreeView)sender;
            count = 0;                      //zahed          

            if (tv.SelectedItem.GetType().Name == "tableViewModel")
            {

                tableViewModel tvm = (tableViewModel)tv.SelectedItem;

                currentTableViewModel = tvm;
                CurrentDatabaseName = tvm._ParentSchemaName;
                // display path at the top of the screen
                //txtBlockDisplayPath.Text = "All Databases/" + ((schemaViewModel)tvm.Parent).schemaName + "/" + tvm.tableName;
                int tabNumber = this.tabControl1.Items.Count + 1;
                CloseableTabItem tabItem = new CloseableTabItem();
                tabItem.Name = tvm.tableName + tabNumber;
                nameOfTabitemAssoWithCustomQuery = tabItem.Name;                
                tabItem.Header = GetTabHeaderName(tvm.tableName, tabNumber);                                

                //add ResultViewerControl
                Mouse.OverrideCursor = Cursors.Wait;
                try
                {
                    Control.ResultViewControl resultControl = new Control.ResultViewControl(tvm, true);

                    ResultViewModel rv = (ResultViewModel)resultControl.DataContext;
                    if (rv.Results.Count != 0)
                    {
                        rv.isNew = true;
                        rv.isModified = true;
                        tabItem.Part_Label_Content = "*";
                    }

                    tabItem.Content = resultControl;
                    /******************************/
                    this.Logo.Visibility = Visibility.Hidden;
                    this.LogoTxt.Visibility = Visibility.Hidden;
                    this.tabControl1.Visibility = Visibility.Visible;
                    /******************************/
                }
                catch (MySql.Data.MySqlClient.MySqlException ex)
                {
                    if (isErrorLoggingOn)
                    {
                        LogError.Log_Err("MainTreeView_SelectedItemChanged", ex);
                        DisplayErrorMessage();
                    }
                }
                catch (Exception ex)
                {
                    if (isErrorLoggingOn)
                    {
                        LogError.Log_Err("MainTreeView_SelectedItemChanged", ex);
                        DisplayErrorMessage();
                    }
                }
                Mouse.OverrideCursor = null;
                //add tab to tabcontrol
                this.tabControl1.Items.Add(tabItem);
                //Get focus on new tab
                ((TabItem)(this.tabControl1.Items[tabNumber - 1])).Focus();


                this.adornedControl.IsAdornerVisible = false;
                //this.BtnHideCustomQueryWindow.Visibility = System.Windows.Visibility.Visible;



            }

        }
Ejemplo n.º 5
0
        private void New_Click()
        {
            /******************************/
            this.Logo.Visibility = Visibility.Hidden;
            this.LogoTxt.Visibility = Visibility.Hidden;
            this.tabControl1.Visibility = Visibility.Visible;
            /******************************/

            count = 0;
            //addd new tab
            CloseableTabItem tabItem = new CloseableTabItem();
            tabItem.Name = "CustomQuery" + (this.tabControl1.Items.Count + 1).ToString();
            tabItem.Header = "SQLQuery" + (this.tabControl1.Items.Count + 1).ToString();
            tabItem.Part_Label_Content = "";
            //tableViewModel tvm = null;
            currentTableViewModel = null;
            Control.ResultViewControl rvCntrl = new ResultViewControl(currentTableViewModel, false);
            tabItem.Content = rvCntrl;

            //add tab to tabcontrol
            this.tabControl1.Items.Add(tabItem);
            //Clear Custom QueryTabs

            //ClearAllCustomeQueryTabs();

            //Get focus on new tab
            ((TabItem)(this.tabControl1.Items[this.tabControl1.Items.Count - 1])).Focus();

            //this.adornedControl.IsAdornerVisible = true;

            //Display Custom query window
            //DocPanelCustomQuery.HorizontalAlignment = HorizontalAlignment.Right;
            //DocPanelCustomQuery.HorizontalAlignment = HorizontalAlignment.Stretch;
            //DocPanelCustomQuery.Margin = new Thickness(0, 60, 0, 0);
            //DocPanelCustomQuery.Width = Double.NaN;
            //this.BtnHideCustomQueryWindow.Visibility = System.Windows.Visibility.Hidden;
            //Hide if tree view window open
            //if (this.TreeViewDocPanel.Width != 0)
            //{
            //    this.TreeViewDocPanel.Width = 0;
            //    TreeViewHideStackPanel.Width = 20;
            //}
        }
Ejemplo n.º 6
0
        public ResultViewModel(tableViewModel TVM, bool getResultByTreeView)
        {
            _getResultByTreeView = getResultByTreeView;
            if (getResultByTreeView)
            {
                isNew = true;
                isModified = true;
            }
            _getResultByQuery = true;
            _TableViewModel = TVM;

            simpleCommand = new RelayCommand(new Action<object>(DoSimpleCommand));

            RefreshResult();
        }