Beispiel #1
0
        public static ConfigurationFrame Deserialize(XElement elm)
        {
            ConfigurationFrame frame = new ConfigurationFrame();

            frame.m_nDataIndex               = SerializeToXml.LoadInt(elm, "DataIndex").Value;
            frame.m_nFrameHeight             = SerializeToXml.LoadInt(elm, "FrameHeight").Value;
            frame.m_clrTitle                 = SerializeToXml.LoadColor(elm, "TitleColor").Value;
            frame.m_fontTitle                = SerializeToXml.LoadFont(elm, "TitleFont");
            frame.Name                       = SerializeToXml.LoadText(elm, "Name");
            frame.Visible                    = SerializeToXml.LoadBool(elm, "Visible").Value;
            frame.MinMaxTarget               = (PlotCollection.MINMAX_TARGET)SerializeToXml.LoadInt(elm, "MinMaxTarget");
            frame.ScaleToVisibleWhenRelative = SerializeToXml.LoadBool(elm, "ScaleToVisible").Value;
            frame.m_rgPlots                  = ConfigurationPlot.Deserialize(elm.Descendants());
            frame.m_rgLines                  = ConfigurationTargetLine.Deserialize(elm.Descendants());
            frame.m_configPlotArea           = ConfigurationPlotArea.Deserialize(elm);
            frame.m_configXAxis              = ConfigurationAxis.Deserialize(elm, "X");
            frame.m_configYAxis              = ConfigurationAxis.Deserialize(elm, "Y");

            double?dfVal = SerializeToXml.LoadDouble(elm, "MinYRange");

            if (dfVal.HasValue)
            {
                frame.MinimumYRange = dfVal.Value;
            }

            return(frame);
        }
Beispiel #2
0
        public static List <ConfigurationPlot> Deserialize(IEnumerable <XElement> elms)
        {
            List <ConfigurationPlot> rgPlot = new List <ConfigurationPlot>();
            List <XElement>          rgElm  = SerializeToXml.GetElements(elms, "Plot");

            foreach (XElement elm in rgElm)
            {
                ConfigurationPlot plot = ConfigurationPlot.Deserialize(elm);
                rgPlot.Add(plot);
            }

            return(rgPlot);
        }