Exemple #1
0
        public XbarChartMeasureData Clone()
        {
            XbarChartMeasureData rlt = MemberwiseClone() as XbarChartMeasureData;

            metricQuantity = metricQuantity.Clone();

            return(rlt);
        }
Exemple #2
0
        public List <XbarChartMeasureData> XMLToXBarChartDataList()
        {
            List <XbarChartMeasureData> datas = new List <XbarChartMeasureData>();

            XmlDocument xmlDoc = new XmlDocument();

            try
            {
                xmlDoc.LoadXml(chartDataXML);
                XmlNodeList nodes = xmlDoc.SelectNodes("ChartData/Row");
                foreach (XmlNode node in nodes)
                {
                    XbarChartMeasureData data = new XbarChartMeasureData();
                    if (node.Attributes["Ordinal"] != null)
                    {
                        data.Ordinal = int.Parse(node.Attributes["Ordinal"].Value);
                    }

                    if (node.Attributes["Metric01"] != null)
                    {
                        data.Metric01.IntValue = long.Parse(node.Attributes["Metric01"].Value);
                    }

                    if (node.Attributes["FactID"] != null)
                    {
                        data.FactID = long.Parse(node.Attributes["FactID"].Value);
                    }

                    if (node.Attributes["WFInstanceID"] != null)
                    {
                        data.WFInstanceID = node.Attributes["WFInstanceID"].Value;
                    }

                    if (node.Attributes["BusinessDate"] != null)
                    {
                        data.BusinessDate = node.Attributes["BusinessDate"].Value;
                    }

                    data.Scale         = Scale;
                    data.UnitOfMeasure = UnitOfMeasure;

                    datas.Add(data);
                }
            }
            catch { datas = new List <XbarChartMeasureData>(); }
            finally
            {
                xmlDoc = null;
            }

            return(datas);
        }