Example #1
0
        // resets expanded rows also
        void ConstructDisplayGraph()
        {
            displayGraph.Clear();

            foreach (var type in Dependencies.DependencyGraph.Keys)
            {
                GraphRow row = new GraphRow();
                row.type  = type;
                row.fader = new AnimBool(false, window.Repaint);

                // @Hack, Dependencies can return duplicates
                List <Type> subTypes = null;
                subTypes = new List <Type>();
                foreach (var item in Dependencies.DependencyGraph[type])
                {
                    if (subTypes.Contains(item))
                    {
                        continue;
                    }
                    subTypes.Add(item);
                }

                row.subTypes = subTypes;
                displayGraph.Add(row);
            }
        }
Example #2
0
        /// <summary>
        /// Saves Time Series Data Set to xml file.
        /// Set SaveEveryting to true to save everything
        /// inculding the time series data loaded from the database.
        /// Otherwise the time series data tables are not saved.
        /// </summary>
        public void Save(string filename, bool SaveEverything)
        {
            this.FileName = filename;
            if (this.Graph.Rows.Count > 0)
            {
                //this.Graph[0].FileName = filename;
            }

            if (SaveEverything)
            {
                WriteXml(filename);
            }
            else
            {//
                TimeSeriesDataSet ds = new TimeSeriesDataSet();
                for (int i = 0; i < Series.Count; i++)
                {
                    SeriesRow r = ds.Series.NewSeriesRow();
                    ds.Series.AddSeriesRow(r);
                    for (int c = 0; c < Series.Columns.Count; c++)
                    {
                        r[c] = Series[i][c];
                    }
                }
                for (int i = 0; i < Graph.Count; i++)
                {
                    GraphRow r = ds.Graph.NewGraphRow();
                    ds.Graph.AddGraphRow(r);
                    for (int c = 0; c < Graph.Columns.Count; c++)
                    {
                        r[c] = Graph[i][c];
                    }
                }

                ds.WriteXml(filename);
            }
        }