コード例 #1
0
ファイル: ExplorerForm.cs プロジェクト: woohn/Pisces
        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();
            }
        }
コード例 #2
0
ファイル: PiscesForm.cs プロジェクト: govtmirror/Pisces
        /// <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);
            }
        }
コード例 #3
0
ファイル: PiscesForm.cs プロジェクト: usbr/Pisces
        /// <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);
            }
        }