//saving of all CAs public void SaveApplicationSettings() { string aPath = @".\CAExplorerApplicationSettings.xml"; CAMainWindowRW.WriteCAMainWindowData(aPath, this); CAMainWindowRW.WriteAllAvailableCAs(this); }
//deleting selected CA from list and if file exists, then deleting file as well. public void DeleteSelectedCA(object messageIn) { if (mySelectedCAGrid2DViewModel != null) { mySelectedCAGrid2DViewModel.StopTimer(); MessageBoxResult aMBR; aMBR = DialogMediator.ShowMessageBox(null, "Delete CA", "Do you really want to delete the selected CA", MessageBoxButton.YesNo, MessageBoxImage.Warning); if (aMBR == MessageBoxResult.Yes) { for (int i = 0; i < myGrid2DViewModelList.Count; i++) { if (myGrid2DViewModelList[i] == mySelectedCAGrid2DViewModel) { CAMainWindowRW.DeleteSpecificCA(mySelectedCAGrid2DViewModel); mySelectedCAGrid2DViewModel.Dispose(); int aNewSelectedCAIndex = i + 1; // selected will be next CA after deleted if (i == (myGrid2DViewModelList.Count - 1)) { aNewSelectedCAIndex = (myGrid2DViewModelList.Count - 2); } if (i >= 1) { SelectedCAGrid2DViewModel = myGrid2DViewModelList[aNewSelectedCAIndex]; } else { SelectedCAGrid2DViewModel = null; } myGrid2DViewModelList.RemoveAt(i); break; } } } } }
//loading of all CAs public void LoadAllAvailableCAs() { CAMainWindowRW.ReadAllAvailableCAs(this); }
//loading application settings - default colors are defined there public void LoadApplicationSettings() { string aPath = @".\CAExplorerApplicationSettings.xml"; CAMainWindowRW.ReadCAMainWindowData(aPath, this); }