Exemplo n.º 1
0
        private Dot GetDot(int page, int density, string cell, string tag)
        {
            int cellIdx = ConvertCellIdx(cell);

            if (cellIdx == -1)
            {
                //MessageBox.Show(string.Format("Invalid {0} Cell", tag));
                return(null);
            }

            //int idx = Constants.CellsPerPage * (page - 1) + cellIdx;

            GenerateCartesian(page, density);

            if (Cartesian.Count() <= cellIdx)
            {
                //MessageBox.Show(string.Format("Invalid {0} parameters, please retry", tag));
                return(null);
            }
            Dot d = Cartesian.ElementAt(cellIdx);

            d.RenderAndFill();

            return(d);
        }
Exemplo n.º 2
0
        private Dot GetDot(string page, string cell, string tag)
        {
            int cellIdx = ConvertCellIdx(cell);

            if (cellIdx == -1)
            {
                lblStatus.Text = string.Format("Invalid {0} Cell", tag);
                return(null);
            }

            int pageNum = 0;

            if (!int.TryParse(page, out pageNum))
            {
                lblStatus.Text = string.Format("Invalid {0} Page #", tag);
                return(null);
            }

            int idx = Constants.CellsPerPage * (pageNum - 1) + cellIdx;

            if (Cartesian == null)
            {
                GenerateCartesian();
            }

            if (Cartesian.Count() <= idx)
            {
                lblStatus.Text = string.Format("Invalid {0} parameters, please retry", tag);
                return(null);
            }
            Dot d = Cartesian.ElementAt(idx);

            d.RenderAndFill();

            return(d);
        }