private void ViewCatalogSelection(object sender, RoutedEventArgs e) { if (!_canExecute()) { return; } DssPath dssPath = (DssPath)dataGrid.SelectedItem; DssCatalogTableVM catalog = (DssCatalogTableVM)DataContext; if (dssPath.RecordType == RecordType.RegularTimeSeries || dssPath.RecordType == RecordType.IrregularTimeSeries) { TimeSeries ts = catalog.File.GetTimeSeries(dssPath, compression: catalogProperties.compression); TimeSeriesWindow tsWindow = new TimeSeriesWindow(ts, catalogProperties, dssFile); tsWindow.DisableEditFeatures(); tsWindow.Show(); } else if (dssPath.RecordType == RecordType.PairedData) { PairedData pd = catalog.File.GetPairedData(dssPath); PairedDataWindow pdWindow = new PairedDataWindow(pd, catalogProperties, dssFile); pdWindow.DisableEditFeatures(); pdWindow.Show(); } else if (dssPath.RecordType == RecordType.LocationInfo) { LocationInformation li = catalog.File.GetLocationInformation(dssPath); LocationInfoWindow liWindow = new LocationInfoWindow(li, catalogProperties); liWindow.Show(); } }
private void OpenDssFile(object sender, RoutedEventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); dlg.Filter = "DSS files|*.dss"; if (dlg.ShowDialog() == true) { DssCatalogTableVM catalog = (DssCatalogTableVM)DataContext; catalog.FilePath = dlg.FileName; this.Title = "DSS Explorer: " + dlg.FileName; catalogProperties.File = ((DssCatalogTableVM)DataContext).File; } }
public MainWindow() { catalogProperties = new CatalogProperties(); InitializeComponent(); DataContext = new DssCatalogTableVM(); }