//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 OnLoaded(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 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 databasesViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("databasesViewSource"))); databasesViewSource.View.MoveCurrentToFirst(); // Load data into the table DatabaseInfo. You can modify this code as needed. SQLInformation.Data.ApplicationDataSetTableAdapters.DatabaseInfoTableAdapter applicationDataSetDatabaseInfoTableAdapter = new SQLInformation.Data.ApplicationDataSetTableAdapters.DatabaseInfoTableAdapter(); applicationDataSetDatabaseInfoTableAdapter.Fill(applicationDataSet.DatabaseInfo); System.Windows.Data.CollectionViewSource databasesDatabaseInfoViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("databasesDatabaseInfoViewSource"))); databasesDatabaseInfoViewSource.View.MoveCurrentToFirst(); }