Esempio n. 1
0
        public void LoadFromXML(XmlElement Node)
        {
            try
            {
                //iElementOrder = Convert.ToInt32(CBaseNode.GetAttribute("iElementOrder"));
                //GLayerName = CBaseNode.GetAttribute("GLayerName");
                XmlElement CBaseNode = (XmlElement)(Node.SelectSingleNode("Misc"));
                //Name = CBaseNode.GetAttribute("Name");

                CBaseNode = (XmlElement)(Node.SelectSingleNode("Appearance"));
                TitleText = CBaseNode.GetAttribute("Caption");

                if (CBaseNode.HasAttribute("iSelTeamIndex"))
                {
                    iSelTeamIndex = Convert.ToInt32(CBaseNode.GetAttribute("iSelTeamIndex"));
                }
                if (CBaseNode.HasAttribute("XAxisTitleShow"))
                {
                    XAxisTitle     = CBaseNode.GetAttribute("XAxisTitle");
                    XAxisFormat    = CBaseNode.GetAttribute("XAxisFormat");
                    XAxisTitleShow = Convert.ToBoolean(CBaseNode.GetAttribute("XAxisTitleShow"));
                }
                if (CBaseNode.HasAttribute("LegendFill"))
                {
                    LegendFill    = ColorTranslator.FromHtml(CBaseNode.GetAttribute("LegendFill"));
                    GridColor     = ColorTranslator.FromHtml(CBaseNode.GetAttribute("GridColor"));
                    PaneFill      = ColorTranslator.FromHtml(CBaseNode.GetAttribute("PaneFill"));
                    ChartFill     = ColorTranslator.FromHtml(CBaseNode.GetAttribute("ChartFill"));
                    CurveLineWith = Convert.ToInt32(CBaseNode.GetAttribute("CurveLineWith"));
                }

                ListCurF.Clear();
                foreach (XmlElement node in CBaseNode.ChildNodes)
                {
                    LoadFontFromXML(node);
                }

                CBaseNode = (XmlElement)(Node.SelectSingleNode("Behavior"));

                bXMajorGridVis = Convert.ToBoolean(CBaseNode.GetAttribute("bXMajorGridVis"));
                bYMajorGridVis = Convert.ToBoolean(CBaseNode.GetAttribute("bYMajorGridVis"));

                foreach (XmlElement node in CBaseNode.ChildNodes)
                {
                    CLSTeamCurve nTream = new CLSTeamCurve();
                    nTream.LoadFromXML(node);
                    ListTream.Add(nTream);
                }
                if (ListTream.Count > 0)
                {
                    SelTream = ListTream[0];
                    //DrawChart();
                }
            }
            catch (Exception e)
            {
            }
        }