Example #1
0
        public static UIElement ReplaceMark(Glyphs gps, List <ListValue> dicVal)
        {
            StructMark Mk        = DrawItems.ExplodeMark(gps);
            double     fontSize  = Mk.fontSize;
            double     orgX      = Mk.x;
            double     y         = Mk.y;
            UIElement  result    = new UIElement();
            ListValue  listValue = new ListValue();

            listValue = (
                from m in dicVal
                where m.strMark == Mk.val.Trim()
                select m).FirstOrDefault <ListValue>();
            if (listValue == null)
            {
                listValue         = new ListValue();
                listValue.strMark = Mk.val;
                listValue.strVal  = "";
            }
            else
            {
                if (listValue.strVal == null)
                {
                    listValue.strVal = "";
                }
            }
            if (Mk.val.Contains("archiveid"))
            {
                if (listValue.strType == "1")
                {
                    result = DrawItems.CreatArchiveid(listValue.strVal, orgX, y, fontSize);
                }
                else
                {
                    result = DrawItems.CreatShortArchiveid(listValue.strVal, orgX, y, fontSize);
                }
            }
            else
            {
                if (Mk.type == "#")
                {
                    result = DrawItems.CreatCheck(listValue.strVal, orgX, y, fontSize, Mk.len);
                }
                else
                {
                    if (Mk.type == "!")
                    {
                        result = DrawItems.CreatDate(listValue.strVal, orgX, y, fontSize);
                    }
                    else
                    {
                        if (Mk.type == "%")
                        {
                            result = DrawItems.CreatGlyphs(listValue.strVal, orgX, y, fontSize, Mk.width, Mk.height);
                        }
                        else if (Mk.type == "^")
                        {
                            result = DrawItems.CreatTitleGlyphs(listValue.strVal, orgX, y, fontSize);
                        }
                        else
                        {
                            if (Mk.type == "@")
                            {
                                if (listValue.strVal == "1")
                                {
                                    result = DrawItems.DrawCheck(orgX, y, 20.0);
                                }
                            }
                            else if (Mk.type == "&")
                            {
                                if (Mk.val.Contains("photo"))
                                {
                                    result = DrawItems.DrawImagePhoto(listValue.strVal, orgX, y);
                                }
                                else if (Mk.val.Contains("bchao"))
                                {
                                    result = DrawItems.DrawImageBChao(listValue.strVal, orgX, y);
                                }
                                else if (Mk.val.Contains("ecg"))
                                {
                                    result = DrawItems.DrawImageEcg(listValue.strVal, orgX, y);
                                }
                                else
                                {
                                    result = DrawItems.DrawImage(listValue.strVal, orgX, y);
                                }
                            }
                            else
                            {
                                if (Mk.locat == "E")
                                {
                                    int length = listValue.strVal.Length;
                                    orgX = Mk.x - (double)length * fontSize / 2.0;
                                }
                                //result = DrawItems.CreatGlyphs(listValue.strVal, orgX, y, fontSize, false, Mk.len, false);
                                result = DrawItems.CreatGlyphs(listValue.strVal, orgX, y, fontSize, false, listValue.strVal.Length, false);
                            }
                        }
                    }
                }
            }
            return(result);
        }
Example #2
0
 public static TextBlock CreatGlyphs(string strVal, double orgX, double orgY, double fontSize)
 {
     return(DrawItems.CreatGlyphs(strVal, orgX, orgY, fontSize, false, 30, false));
 }