private void propertiesToolStripMenuItem_Click(object sender, EventArgs e) { //.SeriesInfo si = tree1.SelectedSiteInfo; Series s = DB.GetSeries(tree1.SelectedID); SeriesProperties pf = new SeriesProperties(s, DB.GetUniqueUnits()); if (pf.ShowDialog() == DialogResult.OK) { DB.UpdateSeriesProperties(s, tree1.SelectedID); tree1.RefreshTree(); } }
/// <summary> /// Propertie can be selected for a single object /// </summary> private void Properties(object sender, EventArgs e) { try { PiscesObject v = tree1.SelectedObject; if (v is Series) { Series s = v as Series; string tmpExp = s.Expression; SeriesProperties p = new SeriesProperties(s, DB); if (p.ShowDialog() == DialogResult.OK) { DB.SaveProperties(s); if (s is CalculationSeries && tmpExp != s.Expression && s.Expression.Trim() != "") { // ShowAsBusy("calculating " + s.Expression); //(s as CalculationSeries).Calculate(); } //tree1_SelectionChanged(this, EventArgs.Empty); DrawBasedOnTreeSelection(); } } else if (v is PiscesFolder) { PiscesFolder f = v as PiscesFolder; FolderProperties p = new FolderProperties(f); if (p.ShowDialog() == DialogResult.OK) { DB.SaveProperties(f); } } } catch (Exception propEx) { MessageBox.Show(propEx.Message); } }