private void bgThread_GetLogonSessionsCompleted(object sender, RunWorkerCompletedEventArgs e) { // Hide loading animations. gridLoading.Visibility = Visibility.Collapsed; // If everything succeeded, bind the results to the DataGrid. Otherwise, display an error. if (RemoteLogonSession.Result != null && RemoteLogonSession.Result.DidTaskSucceed) { // Bind the results to the DataGrid and sort the list. dgUsers.ItemsSource = e.Result as List <RemoteLogonSession>; RemoteAdmin.SortDataGrid(dgUsers); // If no logon sessions were found, display the No Sessions overlay. if (dgUsers.Items.Count == 0) { gridNoSessions.Visibility = Visibility.Visible; tbTargetComputer.Text = RemoteLogonSession.ComputerName; } else { gridNoSessions.Visibility = Visibility.Collapsed; } } else { // If there was an error, display error overlay. gridError.Visibility = Visibility.Visible; } }
private void bgThread_GetUpdatesCompleted(object sender, RunWorkerCompletedEventArgs e) { if (RemoteUpdate.Result != null && RemoteUpdate.Result.DidTaskSucceed) { // Retrieve and display the current Microsoft update configuration from the registry. DisplayUpdateConfiguration(RemoteUpdateConfiguration.GetUpdateConfiguration()); if (RemoteUpdate.GetRebootState()) { RebootRequired.Text = "* This computer has a pending required reboot."; RebootRequired.Visibility = Visibility.Visible; } else { RebootRequired.Text = string.Empty; RebootRequired.Visibility = Visibility.Collapsed; } // Bind the returned list of installed updates to the DataGrid. dgUpdates.ItemsSource = e.Result as List <RemoteUpdate>; RemoteAdmin.SortDataGrid(dgUpdates); gridLoading.Visibility = Visibility.Collapsed; } else { // Something went wrong while retrieving updates. Display an error overlay. gridLoading.Visibility = Visibility.Collapsed; gridError.Visibility = Visibility.Visible; } }
private void cboOdbcDsn_SelectionChanged(object sender, SelectionChangedEventArgs e) { var entry = (RemoteOdbc)cboOdbcDsn.SelectedItem; if (entry == null) { return; } dgOdbcDsnSelected.ItemsSource = entry.Values; RemoteAdmin.SortDataGrid(dgOdbcDsnSelected); }
private void bgThread_GetProcessesCompleted(object sender, RunWorkerCompletedEventArgs e) { // Hide loading animations. gridLoading.Visibility = Visibility.Collapsed; // If everything succeeded, bind the results to the DataGrid. Otherwise, display an error. if (RemoteProcess.Result != null && RemoteProcess.Result.DidTaskSucceed) { // Bind the results to the DataGrid and sort the list. dgProcesses.ItemsSource = e.Result as List <RemoteProcess>; RemoteAdmin.SortDataGrid(dgProcesses); } else { // If there was an error, display error overlay. gridError.Visibility = Visibility.Visible; } }
private void bgThread_GetServicesCompleted(object sender, RunWorkerCompletedEventArgs e) { // Hide loading animations. gridLoading.Visibility = Visibility.Collapsed; // If everything succeeded, bind the results to the DataGrid. Otherwise, display an error. if (RemoteService.Result != null && RemoteService.Result.DidTaskSucceed) { // Success. Display the results. dgServices.ItemsSource = e.Result as List <RemoteService>; _ServicesCollection = CollectionViewSource.GetDefaultView(e.Result as List <RemoteService>); _ServicesCollection.Filter = ServiceFilter; RemoteAdmin.SortDataGrid(dgServices); } else { // Error. Display error overlay. gridError.Visibility = Visibility.Visible; } }
private void bgThread_GetApplicationsCompleted(object sender, RunWorkerCompletedEventArgs e) { // Hide loading animations. gridLoading.Visibility = Visibility.Collapsed; // If everything succeeded, bind the results to the DataGrid. Otherwise, display an error. if (RemoteApplication.Result != null && RemoteApplication.Result.DidTaskSucceed) { // Bind the results to the DataGrid and sort the list. dgApps.ItemsSource = e.Result as List <RemoteApplication>; _ApplicationsCollection = CollectionViewSource.GetDefaultView(e.Result as List <RemoteApplication>); _ApplicationsCollection.Filter = ApplicationFilter; RemoteAdmin.SortDataGrid(dgApps); } else { // If there was an error, display error overlay. gridError.Visibility = Visibility.Visible; } }
private void bgThread_GetLogonHistoryCompleted(object sender, RunWorkerCompletedEventArgs e) { // Hide loading animations. gridHistoryLoading.Visibility = Visibility.Collapsed; // If everything succeeded, bind the results to the DataGrid. Otherwise, display an error. if (RemoteLogonHistory.Result != null && RemoteLogonHistory.Result.DidTaskSucceed) { // Bind the results to the DataGrid and sort the list. dgHistory.ItemsSource = e.Result as List <RemoteLogonHistory>; RemoteAdmin.SortDataGrid(dgHistory, 1, ListSortDirection.Descending); // If no logon history was found, display the No History Sessions overlay. if (dgHistory.Items.Count == 0) { gridNoHistory.Visibility = Visibility.Visible; tbHistoryNoSessions.Text = RemoteLogonSession.ComputerName; } else { gridNoHistory.Visibility = Visibility.Collapsed; } } else { // If there was an error, display error overlay. if (RemoteLogonHistory.Result != null && !string.IsNullOrEmpty(RemoteLogonHistory.Result.MessageBody)) { tbHistoryError.Text = RemoteLogonHistory.Result.MessageBody; } else { tbHistoryError.Text = "Could not retrieve data."; } gridHistoryError.Visibility = Visibility.Visible; } }