コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UPChartInfo"/> class.
        /// </summary>
        /// <param name="jsonDictionary">The json dictionary.</param>
        public UPChartInfo(Dictionary <string, object> jsonDictionary)
        {
            if (jsonDictionary != null)
            {
                if (jsonDictionary.ContainsKey("Sectors"))
                {
                    List <Dictionary <string, object> > sectors = jsonDictionary.ValueOrDefault("Sectors") as List <Dictionary <string, object> >;
                    if (sectors != null && sectors.Count > 0)
                    {
                        List <UPPortfolioCell> sectorArray = new List <UPPortfolioCell>(sectors.Count);
                        foreach (Dictionary <string, object> bla in sectors)
                        {
                            UPPortfolioCell cell = new UPPortfolioCell(bla);
                            sectorArray.Add(cell);
                        }

                        this.Cells = sectorArray;
                    }
                }

                this.LabelXAxis = jsonDictionary.ValueOrDefault("LabelXAxis") as string;
                this.LabelYAxis = jsonDictionary.ValueOrDefault("LabelYAxis") as string;
                if (jsonDictionary.ContainsKey("PercentagesColumns"))
                {
                    this.PercentageColumns = jsonDictionary["PercentagesColumns"] as List <object>;
                }

                if (jsonDictionary.ContainsKey("PercentagesRows"))
                {
                    this.PercentageRows = jsonDictionary["PercentagesRows"] as List <object>;
                }
            }
        }
コード例 #2
0
        private UPPortfolioCell FindSectorForRowColumns(int rowNumber, int columnNumber)
        {
            UPPortfolioCell foundCell = null;

            if (this.Cells != null)
            {
                foreach (UPPortfolioCell cell in this.Cells)
                {
                    if (cell.RowNumber == rowNumber && cell.ColumnNumber == columnNumber)
                    {
                        foundCell = cell;
                        break;
                    }
                }
            }

            return(foundCell);
        }