Пример #1
0
        //private void OnServerDetailButton(object sender, RoutedEventArgs e)
        //{
        //    Detail3DManager.ShowDetailBack();
        //    List3DOverlay.Visibility = Visibility.Visible;
        //}

        //private void Overview3D_FlipCompleted(object sender, EventArgs e)
        //{
        //    double angleTo = (double)Rotater3DTransition.GetValue(XamlTransitions.Rotate3D.AngleRotateToProperty);
        //    double angleFrom = (double)Rotater3DTransition.GetValue(XamlTransitions.Rotate3D.AngleRotateFromProperty);
        //    Overview3D.Visibility = Visibility.Collapsed;
        //}

        //private void OnBackToServerOverview(object sender, RoutedEventArgs e)
        //{
        //    Detail3DManager.ShowDetailFront();
        //    List3DOverlay.Visibility = Visibility.Collapsed;
        //}

        private void OnWindowLoaded(object sender, RoutedEventArgs e)
        {
            // Do not load your data at design time.
            if (!System.ComponentModel.DesignerProperties.GetIsInDesignMode(this))
            {
                // Pretend we are in the EAC
                using (StreamReader reader = new StreamReader(@"Test Data\TestWindowConsoleParameter.xml"))
                {
                    ConfigData.RawXML = reader.ReadToEnd();
                }

                //Load your data here and assign the result to the CollectionViewSource.
                System.Windows.Data.CollectionViewSource myCollectionViewSource = (System.Windows.Data.CollectionViewSource) this.Resources["serversViewSource"];
                //myCollectionViewSource.Source = Common.ApplicationDataSet.Servers;

                SQLInformation.Data.ApplicationDataSetTableAdapters.ServersTableAdapter   serversTableAdapter;
                SQLInformation.Data.ApplicationDataSetTableAdapters.InstancesTableAdapter instancesTableAdapter;
                SQLInformation.Data.ApplicationDataSetTableAdapters.DatabasesTableAdapter databasesTableAdapter;

                SQLInformation.Data.ApplicationDataSetTableAdapters.TableAdapterManager tableAdapterManager;

                serversTableAdapter   = new SQLInformation.Data.ApplicationDataSetTableAdapters.ServersTableAdapter();
                instancesTableAdapter = new SQLInformation.Data.ApplicationDataSetTableAdapters.InstancesTableAdapter();
                databasesTableAdapter = new SQLInformation.Data.ApplicationDataSetTableAdapters.DatabasesTableAdapter();

                tableAdapterManager = new SQLInformation.Data.ApplicationDataSetTableAdapters.TableAdapterManager();

                // Must have to do more work before can do this.  Connection is null
                //tableAdapterManager.Connection.ConnectionString = SQLInformation.Data.Config.SQLMonitorDBConnection;\

                // DO this instead for now.
                serversTableAdapter.Connection.ConnectionString   = SQLInformation.Data.Config.SQLMonitorDBConnection;
                instancesTableAdapter.Connection.ConnectionString = SQLInformation.Data.Config.SQLMonitorDBConnection;
                databasesTableAdapter.Connection.ConnectionString = SQLInformation.Data.Config.SQLMonitorDBConnection;

                try
                {
                    serversTableAdapter.Fill(Common.ApplicationDataSet.Servers);
                    instancesTableAdapter.Fill(Common.ApplicationDataSet.Instances);
                    databasesTableAdapter.Fill(Common.ApplicationDataSet.Databases);
                    //serversListView.ItemsSource = Common.ApplicationDataSet.Servers;
                    //serversBindingSource.DataSource = Common.ApplicationDS.Servers;
                }
                catch (Exception ex)
                {
                    System.Windows.Forms.MessageBox.Show(text: "Initial Load Error: " + ex.ToString(), caption: "Error", buttons: System.Windows.Forms.MessageBoxButtons.OK);
                }
            }
        }
        private void saveButton_Click(object sender, RoutedEventArgs e)
        {
            SQLInformation.Data.ApplicationDataSetTableAdapters.InstancesTableAdapter ta = new SQLInformation.Data.ApplicationDataSetTableAdapters.InstancesTableAdapter();

            ta.Connection.ConnectionString = SQLInformation.Data.Config.SQLMonitorDBConnection;

            ta.Update(Common.ApplicationDataSet.Instances);
        }
        private static void UpdateDatabase()
        {
            SQLInformation.Data.ApplicationDataSetTableAdapters.InstancesTableAdapter ta = new SQLInformation.Data.ApplicationDataSetTableAdapters.InstancesTableAdapter();

            ta.Connection.ConnectionString = SQLInformation.Data.Config.SQLMonitorDBConnection;

            ta.Update(Common.ApplicationDataSet.Instances);
        }
Пример #4
0
 private void Window_Loaded_1(object sender, RoutedEventArgs e)
 {
     SQLInformation.Data.ApplicationDataSet applicationDataSet = ((SQLInformation.Data.ApplicationDataSet)(this.FindResource("applicationDataSet")));
     // Load data into the table Servers. You can modify this code as needed.
     SQLInformation.Data.ApplicationDataSetTableAdapters.ServersTableAdapter applicationDataSetServersTableAdapter = new SQLInformation.Data.ApplicationDataSetTableAdapters.ServersTableAdapter();
     applicationDataSetServersTableAdapter.Fill(applicationDataSet.Servers);
     System.Windows.Data.CollectionViewSource serversViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("serversViewSource")));
     serversViewSource.View.MoveCurrentToFirst();
     // Load data into the table Instances. You can modify this code as needed.
     SQLInformation.Data.ApplicationDataSetTableAdapters.InstancesTableAdapter applicationDataSetInstancesTableAdapter = new SQLInformation.Data.ApplicationDataSetTableAdapters.InstancesTableAdapter();
     applicationDataSetInstancesTableAdapter.Fill(applicationDataSet.Instances);
     System.Windows.Data.CollectionViewSource serversInstancesViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("serversInstancesViewSource")));
     serversInstancesViewSource.View.MoveCurrentToFirst();
     // Load data into the table Databases. You can modify this code as needed.
     SQLInformation.Data.ApplicationDataSetTableAdapters.DatabasesTableAdapter applicationDataSetDatabasesTableAdapter = new SQLInformation.Data.ApplicationDataSetTableAdapters.DatabasesTableAdapter();
     applicationDataSetDatabasesTableAdapter.Fill(applicationDataSet.Databases);
     System.Windows.Data.CollectionViewSource serversInstancesDatabasesViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("serversInstancesDatabasesViewSource")));
     serversInstancesDatabasesViewSource.View.MoveCurrentToFirst();
     // Load data into the table DBTables. You can modify this code as needed.
     SQLInformation.Data.ApplicationDataSetTableAdapters.DBTablesTableAdapter applicationDataSetDBTablesTableAdapter = new SQLInformation.Data.ApplicationDataSetTableAdapters.DBTablesTableAdapter();
     applicationDataSetDBTablesTableAdapter.Fill(applicationDataSet.DBTables);
     System.Windows.Data.CollectionViewSource serversInstancesDatabasesDBTablesViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("serversInstancesDatabasesDBTablesViewSource")));
     serversInstancesDatabasesDBTablesViewSource.View.MoveCurrentToFirst();
 }