Esempio n. 1
0
 public void DrawChart(bool showUrl = false)
 {
     foreach (var s in TABLE_STRINGS)
     {
         DrawTo.AppendLine(s);
     }
 }
Esempio n. 2
0
 public void FillStyle()
 {
     // Style for this table. names cannot conflict with other styles.
     foreach (var s in STYLE_STRINGS)
     {
         DrawTo.AppendLine(s);
     }
 }
Esempio n. 3
0
        public void DrawChart(bool showUrl = false)
        {
            int i      = 1; // map entries are 1-based
            int mapdex = 0;

            foreach (var s in TABLE_STRINGS)
            {
                while (mapdex < TABLE_MAP.Length) // Find the row in the map for this table row (if it exists)
                {
                    var tup = TABLE_MAP[mapdex];
                    if (i <= tup.Item1)
                    {
                        break;
                    }
                    mapdex++;
                }

                if (mapdex >= TABLE_MAP.Length || TABLE_MAP[mapdex].Item1 != i) // didn't find row in map
                {
                    DrawTo.AppendLine(s);
                }
                else
                {
                    var    tup2 = TABLE_MAP[mapdex];
                    string val;
                    if (Ancestors == null)
                    {
                        val = string.Format("{0}({1})", tup2.Item3 ? "Name" : "Data", tup2.Item2);
                    }
                    else
                    {
                        val = HtmlText("");
                        // NOTE tup2.Item2 is 1-based, ancestors list is  1-based
                        Person p = Ancestors[tup2.Item2];
                        if (p != null)
                        {
                            if (tup2.Item3)
                            {
                                val = HtmlText(p.Name);
                            }
                            else
                            {
                                var bd = HtmlText(p.GetDate("BIRT"));
                                var bp = HtmlText(p.GetPlace("BIRT"));
                                var dd = HtmlText(p.GetDate("DEAT"));
                                var dp = HtmlText(p.GetPlace("DEAT"));
                                val = string.Format("Born:{0}<br>Place:{1}<br>Died:{2}<br>Place:{3}", bd, bp, dd, dp);
                            }
                        }
                    }


                    DrawTo.AppendFormat(s, val).AppendLine();
                }
                i++;
            }
        }
Esempio n. 4
0
 public void FillStyle()
 {
     // Style for this table. names cannot conflict with other styles.
     foreach (var s in STYLE_STRINGS)
     {
         var s2 = s;
         s2 = s.Replace("<font>", string.Format("font-size:{0}px;", FontSize));
         DrawTo.AppendLine(s2);
     }
 }
Esempio n. 5
0
        public void FillStyle()
        {
            int i = 0;

            foreach (var tuple in STYLE_STRINGS2)
            {
                var outStr = tuple.Item1;
                if (tuple.Item2) // color
                {
                    var cStr = getColorString(i);
                    outStr = outStr.Replace("<color>", cStr);
                }

                if (tuple.Item3) // font
                {
                    var fStr = getFontString(tuple.Item4);
                    outStr = outStr.Replace("<font>", fStr);
                }
                DrawTo.AppendLine(outStr);
                i++;
            }
        }