/// <summary> /// Saves the cube of the specified <see cref="TOLAPAnalysis"/> as /// </summary> /// <param name="tolapAnalysis">The <see cref="TOLAPAnalysis"/> whose cube to save as</param> private void DoSaveCubeAs(TOLAPAnalysis tolapAnalysis) { var dlg = new SaveFileDialog { FileName = "CubeConfig", DefaultExt = ".xml", Filter = "XML documents (.xml)|*.xml" }; if (dlg.ShowDialog() != true) { return; } _currentCubeConfig = new CubeConfigurationFile("New cube config", dlg.FileName); _currentDataSetConfig.CubeFiles.Add(_currentCubeConfig); UiAction(() => { // TODO: request display name tolapAnalysis.SaveUncompressed(_currentCubeConfig.FilePath, TStreamContent.GridState); }); _userConfiguration.Save(Settings.Default.UserConfigurationFile); DoLoadDataSetMenu(); }
/// <summary> /// Deletes the cube of the specified <see cref="TOLAPAnalysis"/> /// </summary> /// <param name="tolapAnalysis">The <see cref="TOLAPAnalysis"/> whose cube to delete</param> private void DoDeleteCube(TOLAPAnalysis tolapAnalysis) { _currentDataSetConfig.CubeFiles.Remove(_currentCubeConfig); _userConfiguration.Save(Settings.Default.UserConfigurationFile); UiAction(() => { if (tolapAnalysis.Cube == null) { return; } tolapAnalysis.Cube.Active = false; }); _isCubeLoaded = false; _currentCubeConfig = null; DoLoadDataSetMenu(); }
/// <summary> /// Loads the cube into the specified <see cref="TOLAPAnalysis"/> /// </summary> /// <param name="dataSetConfigurationFile">The data set config file</param> /// <param name="cubeConfigurationFile">The cube config file (can be null)</param> /// <param name="tolapAnalysis">The <see cref="TOLAPAnalysis"/> to load the cube into</param> private void DoLoadCube( DataSetConfigurationFile dataSetConfigurationFile, CubeConfigurationFile cubeConfigurationFile, TOLAPAnalysis tolapAnalysis) { _currentDataSetConfig = dataSetConfigurationFile; _currentCubeConfig = cubeConfigurationFile; var contents = File.ReadAllText(_currentDataSetConfig.FilePath); var dataSetDesc = DataSetDescriptorBuilder.Build(contents); var dataSet = DataSetBuilder.BuilDataSet(dataSetDesc, _dbBridge); var doc = XElement.Parse(contents); UiAction(() => { var cube = OlapCubeBuilder.BuildCube(doc, dataSetDesc, dataSet); if (tolapAnalysis.Cube != null) { tolapAnalysis.Cube.Active = false; } tolapAnalysis.Cube = cube; tolapAnalysis.Cube.Active = true; if (_currentCubeConfig != null) { tolapAnalysis.Load(_currentCubeConfig.FilePath); } }); _isCubeLoaded = true; }