Exemple #1
0
        public static GraphicsPath PathDataParse(string text, PointInfoCollection pointsInfo)
        {
            PathFunc.startinfo = null;
            int num1 = -1;

            pointsInfo.Clear();
            GraphicsPath         path1     = new GraphicsPath();
            GraphicsPathIterator iterator1 = new GraphicsPathIterator(path1);
            PointF tf1     = PointF.Empty;
            string text1   = "";
            int    nLength = text.Length;
            Regex  regex1  = new Regex("[A-DF-Za-df-z][^A-DF-Za-df-z]*");
            PointF tf2     = PointF.Empty;
            Match  match1  = regex1.Match(text);
            int    num2    = 0;
            //StringBuilder text2 = new StringBuilder();
            //string text3 = text;
            PointF        tf3   = PointF.Empty;
            PointF        tf4   = PointF.Empty;
            PointInfo     info1 = null;
            StringBuilder text4 = new StringBuilder(text);

            while (match1.Success)
            {
                float single1;
                float single2;
                float single3;
                float single4;
                float single5;
                float single6;
                ExtendedGraphicsPath path2;
                int num3 = match1.Index;
                text4.Remove(0, text1.Length);
//                text4 =new StringBuilder(text3.Substring(num3, text3.Length - match1.Index));
                if (info1 != null)
                {
                    //info1.NextString =match1.Value.Trim();// text4.ToString();//match1.Value.Trim();
                }
                text1 = match1.Value.Trim();
                char      ch1          = (char)text1.ToCharArray(0, 1).GetValue(0);
                float[]   singleArray1 = PathFunc.GetCoords(text1);
                PointInfo info2        = null;
                char      ch2          = ch1;
                if (ch2 <= 'Z')
                {
                    if (ch2 <= 'H')
                    {
                        switch (ch2)
                        {
                        case 'A':
                        {
                            path2 = new ExtendedGraphicsPath(path1);
                            if (singleArray1.Length != 7)
                            {
                                throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                            }
                            isArc = true;
                            path2.AddArc(tf2, new PointF(singleArray1[5], singleArray1[6]), singleArray1[0], singleArray1[1], (singleArray1[3] != 0f) && true, (singleArray1[4] != 0f) && true, singleArray1[2]);
                            goto Label_092D;
                        }

                        case 'B':
                        {
                            goto Label_0FEB;
                        }

                        case 'C':
                        {
                            PointF pf1   = tf2;
                            int    num10 = 0;

                            if (singleArray1.Length < 6)
                            {
                                throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                            }

drawArc:
                            path1.AddBezier(pf1.X, pf1.Y, singleArray1[num10], singleArray1[num10 + 1], singleArray1[num10 + 2], singleArray1[num10 + 3], singleArray1[num10 + 4], singleArray1[num10 + 5]);

                            pf1 = new PointF(singleArray1[num10 + 4], singleArray1[num10 + 5]);


                            if ((num10 + 6) < singleArray1.Length)
                            {
//									info2 = new PointInfo(new PointF(singleArray1[num10+4], singleArray1[num10+5]), new PointF(singleArray1[num10+0], singleArray1[num10+1]), new PointF(singleArray1[num10+2], singleArray1[num10+3]), text1);
//									info2.Command="C";
//									pointsInfo.Add(info2);
                                num10 += 6;
                                goto drawArc;
                            }
                            if (num10 > 0)
                            {
                                tf1 = new PointF(singleArray1[num10 + 2], singleArray1[num10 + 3]);
                                tf2 = new PointF(singleArray1[num10 + 4], singleArray1[num10 + 5]);

                                info2         = new PointInfo(new PointF(singleArray1[num10 + 4], singleArray1[num10 + 5]), new PointF(singleArray1[num10 + 0], singleArray1[num10 + 1]), new PointF(singleArray1[num10 + 2], singleArray1[num10 + 3]), text1);
                                info2.Command = "C";
                                goto Label_1001;
                            }

                            goto Label_0872;
                        }

                        case 'H':
                        {
                            goto Label_033D;
                        }
                        }
                        goto Label_0FEB;
                    }
                    switch (ch2)
                    {
                    case 'L':
                    {
//                            if (singleArray1.Length != 2)
//                            {
//                                throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
//                            }
                        //path1.AddLine(tf2, new PointF(singleArray1[0], singleArray1[1]));
                        PointF[] ptfs = new PointF[singleArray1.Length / 2 + 1];
                        ptfs[0] = tf2;
                        int index1 = 0;
                        for (int i = 1; i < singleArray1.Length; i++)
                        {
                            index1++;
                            ptfs[index1] = new PointF(singleArray1[i - 1], singleArray1[i]);
                            i++;
                        }
                        path1.AddLines(ptfs);
                        info2 = new PointInfo(new PointF(singleArray1[0], singleArray1[1]), text1);
                        goto Label_02B5;
                    }

                    case 'M':
                    {
                        path1.StartFigure();
                        if (singleArray1.Length != 2)
                        {
                            throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                        }
                        tf2                = new PointF(singleArray1[0], singleArray1[1]);
                        info2              = new PointInfo(tf2, text1);
                        info2.IsStart      = true;
                        isArc              = false;
                        PathFunc.startinfo = info2;
                        //info2.PreString = text1;//text2.ToString();
                        goto Label_0205;
                    }

                    case 'N':
                    case 'O':
                    case 'P':
                    case 'R':
                    case 'U':
                    {
                        goto Label_0FEB;
                    }

                    case 'Q':
                    {
                        single1 = tf2.X + (((singleArray1[0] - tf2.X) * 2f) / 3f);
                        single2 = tf2.Y + (((singleArray1[1] - tf2.Y) * 2f) / 3f);
                        single3 = singleArray1[0] + ((singleArray1[2] - singleArray1[0]) / 3f);
                        single4 = singleArray1[1] + ((singleArray1[3] - singleArray1[1]) / 3f);
                        if (singleArray1.Length != 4)
                        {
                            throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                        }
                        path1.AddBezier(tf2.X, tf2.Y, single1, single2, single3, single4, singleArray1[2], singleArray1[3]);
                        goto Label_0579;
                    }

                    case 'S':
                    {
                        if (singleArray1.Length != 4)
                        {
                            throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                        }
                        if (!tf1.IsEmpty)
                        {
                            goto Label_0755;
                        }
                        path1.AddBezier(tf2.X, tf2.Y, tf2.X, tf2.Y, singleArray1[0], singleArray1[1], singleArray1[2], singleArray1[3]);
                        pointsInfo.Add(new PointInfo(new PointF(singleArray1[2], singleArray1[3]), tf2, new PointF(singleArray1[0], singleArray1[1]), text1));
                        goto Label_07C4;
                    }

                    case 'T':
                    {
                        if (!tf1.IsEmpty)
                        {
                            goto Label_05D2;
                        }
                        single5 = tf2.X;
                        single6 = tf2.Y;
                        goto Label_0600;
                    }

                    case 'V':
                    {
                        if (singleArray1.Length != 1)
                        {
                            throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                        }
                        path1.AddLine(tf2, new PointF(tf2.X, singleArray1[0]));
                        goto Label_0439;
                    }

                    case 'Z':
                    {
                        goto Label_0F72;
                    }
                    }
                    goto Label_0FEB;
                }
                if (ch2 <= 'h')
                {
                    switch (ch2)
                    {
                    case 'a':
                    {
                        path2 = new ExtendedGraphicsPath(path1);
                        if (singleArray1.Length != 7)
                        {
                            throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                        }
                        path2.AddArc(tf2, new PointF(singleArray1[5] + tf2.X, singleArray1[6] + tf2.Y), singleArray1[0], singleArray1[1], (singleArray1[3] != 0f) && true, (singleArray1[4] != 0f) && true, singleArray1[2]);
                        goto Label_09F7;
                    }

                    case 'b':
                    {
                        goto Label_0FEB;
                    }

                    case 'c':
                    {
                        if (singleArray1.Length != 6)
                        {
                            throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("unnabeparsepath") + text1);
                        }
                        path1.AddBezier(tf2.X, tf2.Y, (float)(singleArray1[0] + tf2.X), (float)(singleArray1[1] + tf2.Y), (float)(singleArray1[2] + tf2.X), (float)(singleArray1[3] + tf2.Y), (float)(singleArray1[4] + tf2.X), (float)(singleArray1[5] + tf2.Y));
                        goto Label_0EF0;
                    }

                    case 'h':
                    {
                        goto Label_0397;
                    }
                    }
                    goto Label_0FEB;
                }
                switch (ch2)
                {
                case 'l':
                {
                    if (singleArray1.Length != 2)
                    {
                        throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                    }
                    path1.AddLine(tf2, new PointF(singleArray1[0] + tf2.X, singleArray1[1] + tf2.Y));
                    goto Label_030E;
                }

                case 'm':
                {
                    path1.StartFigure();
                    if (singleArray1.Length != 2)
                    {
                        throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                    }
                    tf2                = new PointF(singleArray1[0], singleArray1[1]);
                    info2              = new PointInfo(tf2, text1);
                    info2.IsStart      = true;
                    isArc              = false;
                    PathFunc.startinfo = info2;
                    goto Label_025F;
                }

                case 'n':
                case 'o':
                case 'p':
                case 'r':
                case 'u':
                {
                    goto Label_0FEB;
                }

                case 'q':
                {
                    single1 = tf2.X + ((singleArray1[0] * 2f) / 3f);
                    single2 = tf2.Y + ((singleArray1[1] * 2f) / 3f);
                    single3 = (singleArray1[0] + tf2.X) + ((singleArray1[2] - singleArray1[0]) / 3f);
                    single4 = (singleArray1[1] + tf2.Y) + ((singleArray1[3] - singleArray1[1]) / 3f);
                    if (singleArray1.Length != 4)
                    {
                        throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                    }
                    path1.AddBezier(tf2.X, tf2.Y, single1, single2, single3, single4, (float)(singleArray1[2] + tf2.X), (float)(singleArray1[3] + tf2.Y));
                    goto Label_0B0D;
                }

                case 's':
                {
                    if (singleArray1.Length != 4)
                    {
                        throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                    }
                    if (!tf1.IsEmpty)
                    {
                        goto Label_0D63;
                    }
                    path1.AddBezier(tf2.X, tf2.Y, tf2.X, tf2.Y, (float)(singleArray1[0] + tf2.X), (float)(singleArray1[1] + tf2.Y), (float)(singleArray1[2] + tf2.X), (float)(singleArray1[3] + tf2.Y));
                    goto Label_0DF2;
                }

                case 't':
                {
                    if (!tf1.IsEmpty)
                    {
                        goto Label_0B98;
                    }
                    single5 = tf2.X;
                    single6 = tf2.Y;
                    goto Label_0BC6;
                }

                case 'v':
                {
                    if (singleArray1.Length != 1)
                    {
                        throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                    }
                    path1.AddLine(tf2, new PointF(tf2.X, singleArray1[0] + tf2.Y));
                    goto Label_049B;
                }

                case 'z':
                {
                    goto Label_0F72;
                }

                default:
                {
                    goto Label_0FEB;
                }
                }
Label_0205:     //M
                num2++;
                goto Label_1001;
Label_025F:
                num2++;
                goto Label_1001;
Label_02B5:
                tf2 = new PointF(singleArray1[0], singleArray1[1]);
                goto Label_1001;
Label_030E:
                tf2   = new PointF(singleArray1[0] + tf2.X, singleArray1[1] + tf2.Y);
                info2 = new PointInfo(tf2, text1);
                goto Label_1001;
Label_033D:
                if (singleArray1.Length == 1)
                {
                    path1.AddLine(tf2, new PointF(singleArray1[0], tf2.Y));
                }
                else
                {
                    throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                }
                tf2   = new PointF(singleArray1[0], tf2.Y);
                info2 = new PointInfo(tf2, text1);
                goto Label_1001;
Label_0397:
                if (singleArray1.Length == 1)
                {
                    path1.AddLine(tf2, new PointF(singleArray1[0] + tf2.X, tf2.Y));
                }
                else
                {
                    throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                }
                tf2   = new PointF(singleArray1[0] + tf2.X, tf2.Y);
                info2 = new PointInfo(tf2, text1);
                goto Label_1001;
Label_0439:
                tf2   = new PointF(tf2.X, singleArray1[0]);
                info2 = new PointInfo(tf2, text1);
                goto Label_1001;
Label_049B:
                tf2   = new PointF(tf2.X, singleArray1[0] + tf2.Y);
                info2 = new PointInfo(tf2, text1);
                goto Label_1001;
Label_0579:
                tf1   = new PointF(single3, single4);
                tf2   = new PointF(singleArray1[2], singleArray1[3]);
                info2 = new PointInfo(tf2, new PointF(single1, single2), new PointF(single3, single4), text1);
                goto Label_1001;
Label_05D2:
                single5 = (2f * tf2.X) - tf1.X;
                single6 = (2f * tf2.Y) - tf1.Y;
Label_0600:
                single1 = tf2.X + (((single5 - tf2.X) * 2f) / 3f);
                single2 = tf2.Y + (((single6 - tf2.Y) * 2f) / 3f);
                single3 = single5 + ((singleArray1[0] - single5) / 3f);
                single4 = single6 + ((singleArray1[1] - single6) / 3f);
                if (singleArray1.Length != 2)
                {
                    throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                }
                path1.AddBezier(tf2.X, tf2.Y, single1, single2, single3, single4, singleArray1[0], singleArray1[1]);
                tf1   = new PointF(single3, single4);
                tf2   = new PointF(singleArray1[0], singleArray1[1]);
                info2 = new PointInfo(tf2, new PointF(single1, single2), new PointF(single3, single4), text1);
                goto Label_1001;
Label_0755:
                single1 = (2f * tf2.X) - tf1.X;
                single2 = (2f * tf2.Y) - tf1.Y;
                path1.AddBezier(tf2.X, tf2.Y, single1, single2, singleArray1[0], singleArray1[1], singleArray1[2], singleArray1[3]);
Label_07C4:
                tf1   = new PointF(singleArray1[0], singleArray1[1]);
                tf2   = new PointF(singleArray1[2], singleArray1[3]);
                info2 = new PointInfo(path1.GetLastPoint(), path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2], text1);
                goto Label_1001;
Label_0872:
                tf1   = new PointF(singleArray1[2], singleArray1[3]);
                tf2   = new PointF(singleArray1[4], singleArray1[5]);
                info2 = new PointInfo(new PointF(singleArray1[4], singleArray1[5]), new PointF(singleArray1[0], singleArray1[1]), new PointF(singleArray1[2], singleArray1[3]), text1);
                goto Label_1001;
Label_092D:                                                 //A
                tf1                 = PointF.Empty;
                tf2                 = path1.GetLastPoint(); //, path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2]
                info2               = new PointInfo(tf2, PointF.Empty, new PointF(tf2.X + singleArray1[0], tf2.Y), text1);
                info2.NextControl   = new PointF(tf2.X, tf2.Y + singleArray1[1]);
                info2.Rx            = singleArray1[0];
                info2.Ry            = singleArray1[1];
                info2.Angle         = singleArray1[2];
                info2.LargeArcFlage = (int)singleArray1[3];
                info2.SweepFlage    = (int)singleArray1[4];
                goto Label_1001;
Label_09F7:
                tf1   = PointF.Empty;
                tf2   = path1.GetLastPoint();
                info2 = new PointInfo(path1.GetLastPoint(), path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2], text1);
                goto Label_1001;
Label_0B0D:
                tf1   = new PointF(single3, single4);
                tf2   = new PointF(singleArray1[2] + tf2.X, tf2.Y + singleArray1[3]);
                info2 = new PointInfo(path1.GetLastPoint(), path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2], text1);
                goto Label_1001;
Label_0B98:
                single5 = (2f * tf2.X) - tf1.X;
                single6 = (2f * tf2.Y) - tf1.Y;
Label_0BC6:
                single1 = tf2.X + (((single5 - tf2.X) * 2f) / 3f);
                single2 = tf2.Y + (((single6 - tf2.Y) * 2f) / 3f);
                single3 = single5 + (((singleArray1[0] + tf2.X) - single5) / 3f);
                single4 = single6 + (((singleArray1[1] + tf2.Y) - single6) / 3f);
                if (singleArray1.Length != 2)
                {
                    throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                }
                path1.AddBezier(tf2.X, tf2.Y, single1, single2, single3, single4, (float)(singleArray1[0] + tf2.X), (float)(singleArray1[1] + tf2.Y));
                tf1   = new PointF(single3, single4);
                tf2   = new PointF(singleArray1[0] + tf2.X, tf2.Y + singleArray1[1]);
                info2 = new PointInfo(path1.GetLastPoint(), path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2], text1);
                goto Label_1001;
Label_0D63:
                single1 = (2f * tf2.X) - tf1.X;
                single2 = (2f * tf2.Y) - tf1.Y;
                path1.AddBezier(tf2.X, tf2.Y, single1, single2, (float)(singleArray1[0] + tf2.X), (float)(singleArray1[1] + tf2.Y), (float)(singleArray1[2] + tf2.X), (float)(singleArray1[3] + tf2.Y));
Label_0DF2:
                tf1   = new PointF(singleArray1[0] + tf2.X, tf2.Y + singleArray1[1]);
                tf2   = new PointF(singleArray1[2] + tf2.X, tf2.Y + singleArray1[3]);
                info2 = new PointInfo(path1.GetLastPoint(), path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2], text1);
                goto Label_1001;
Label_0EF0:
                tf1   = new PointF(singleArray1[2] + tf2.X, tf2.Y + singleArray1[3]);
                tf2   = new PointF(singleArray1[4] + tf2.X, tf2.Y + singleArray1[5]);
                info2 = new PointInfo(path1.GetLastPoint(), path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2], text1);
                goto Label_1001;
Label_0F72:     //Z
                path1.CloseFigure();
                if (pointsInfo.Count > 0)
                {
                    PointInfo info3 = pointsInfo[pointsInfo.Count - 1];
                    if ((PathFunc.startinfo != null) && (info3 != PathFunc.startinfo))
                    {
                        PathFunc.startinfo.PreInfo = info3;
                        info3.NextInfo             = PathFunc.startinfo;
                        if (!isArc)
                        {
                            PathFunc.startinfo.SecondControl = info3.SecondControl;
                        }
//                        info3.NextControl = PathFunc.startinfo.NextControl;
                        info3.IsEnd = true;
                    }
                }
                num2++;
                goto Label_1001;
Label_0FEB:     //error
                throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("unnabeparsepath") + text);
Label_1001:
                if (info2 != null)
                {
                    info2.Command = ch1.ToString();
                    pointsInfo.Add(info2);
                    //info2.PreString = text1;//text2.ToString();
                    info2.SubPath = num2;
                    info2.Index   = num3;
                }

                info1 = info2;
                //text2.Append(match1.Value);
                match1 = match1.NextMatch();
                num1++;
            }
            return(path1);
        }
Exemple #2
0
        public static GraphicsPath PathDataParse(string text, PointInfoCollection pointsInfo)
        {
            PathFunc.startinfo = null;
            int num1 = -1;
            pointsInfo.Clear();
            GraphicsPath path1 = new GraphicsPath();
            GraphicsPathIterator iterator1 = new GraphicsPathIterator(path1);
            PointF tf1 = PointF.Empty;
            string text1 = "";
            int nLength=text.Length;
            Regex regex1 = new Regex("[A-DF-Za-df-z][^A-DF-Za-df-z]*");
            PointF tf2 = PointF.Empty;
            Match match1 = regex1.Match(text);
            int num2 = 0;
            //StringBuilder text2 = new StringBuilder();
            //string text3 = text;
            PointF tf3 = PointF.Empty;
            PointF tf4 = PointF.Empty;
            PointInfo info1 = null;
            StringBuilder text4=new StringBuilder(text);
            while (match1.Success)
            {
                float single1;
                float single2;
                float single3;
                float single4;
                float single5;
                float single6;
                ExtendedGraphicsPath path2;
                int num3 = match1.Index;
                text4.Remove(0,text1.Length);
            //                text4 =new StringBuilder(text3.Substring(num3, text3.Length - match1.Index));
                if (info1 != null)
                {
                    //info1.NextString =match1.Value.Trim();// text4.ToString();//match1.Value.Trim();
                }
                text1 = match1.Value.Trim();
                char ch1 = (char) text1.ToCharArray(0, 1).GetValue(0);
                float[] singleArray1 = PathFunc.GetCoords(text1);
                PointInfo info2 = null;
                char ch2 = ch1;
                if (ch2 <= 'Z')
                {
                    if (ch2 <= 'H')
                    {
                        switch (ch2)
                        {
                            case 'A':
                            {
                                path2 = new ExtendedGraphicsPath(path1);
                                if (singleArray1.Length != 7)
                                {
                                    throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                                }
                                isArc=true;
                                path2.AddArc(tf2, new PointF(singleArray1[5], singleArray1[6]), singleArray1[0], singleArray1[1], (singleArray1[3] != 0f) && true, (singleArray1[4] != 0f) && true, singleArray1[2]);
                                goto Label_092D;
                            }
                            case 'B':
                            {
                                goto Label_0FEB;
                            }
                            case 'C':
                            {
                                PointF pf1=tf2;
                                int num10=0;

                                if (singleArray1.Length < 6)
                                {
                                    throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                                }

                                drawArc:
                                path1.AddBezier(pf1.X, pf1.Y, singleArray1[num10], singleArray1[num10+1], singleArray1[num10+2], singleArray1[num10+3], singleArray1[num10+4], singleArray1[num10+5]);

                                pf1=new PointF(singleArray1[num10+4],singleArray1[num10+5]);

                                if((num10+6)<singleArray1.Length)
                                {

            //									info2 = new PointInfo(new PointF(singleArray1[num10+4], singleArray1[num10+5]), new PointF(singleArray1[num10+0], singleArray1[num10+1]), new PointF(singleArray1[num10+2], singleArray1[num10+3]), text1);
            //									info2.Command="C";
            //									pointsInfo.Add(info2);
                                    num10+=6;
                                    goto drawArc;

                                }
                                if (num10>0)
                                {
                                    tf1 = new PointF(singleArray1[num10+2], singleArray1[num10+3]);
                                    tf2 = new PointF(singleArray1[num10+4], singleArray1[num10+5]);

                                    info2 = new PointInfo(new PointF(singleArray1[num10+4], singleArray1[num10+5]), new PointF(singleArray1[num10+0], singleArray1[num10+1]), new PointF(singleArray1[num10+2], singleArray1[num10+3]), text1);
                                    info2.Command="C";
                                    goto Label_1001;
                                }

                                goto Label_0872;
                            }
                            case 'H':
                            {
                                goto Label_033D;
                            }
                        }
                        goto Label_0FEB;
                    }
                    switch (ch2)
                    {
                        case 'L':
                        {
            //                            if (singleArray1.Length != 2)
            //                            {
            //                                throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
            //                            }
                            //path1.AddLine(tf2, new PointF(singleArray1[0], singleArray1[1]));
                            PointF[] ptfs=new PointF[singleArray1.Length/2+1];
                            ptfs[0]=tf2;
                            int index1=0;
                            for (int i = 1; i < singleArray1.Length; i++)
                            {
                                index1++;
                                ptfs[index1]=new PointF(singleArray1[i-1],singleArray1[i]);
                                i++;
                            }
                            path1.AddLines(ptfs);
                            info2 = new PointInfo(new PointF(singleArray1[0], singleArray1[1]), text1);
                            goto Label_02B5;
                        }
                        case 'M':
                        {
                            path1.StartFigure();
                            if (singleArray1.Length != 2)
                            {
                                throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                            }
                            tf2 = new PointF(singleArray1[0], singleArray1[1]);
                            info2 = new PointInfo(tf2, text1);
                            info2.IsStart = true;
                            isArc=false;
                            PathFunc.startinfo = info2;
                            //info2.PreString = text1;//text2.ToString();
                            goto Label_0205;
                        }
                        case 'N':
                        case 'O':
                        case 'P':
                        case 'R':
                        case 'U':
                        {
                            goto Label_0FEB;
                        }
                        case 'Q':
                        {
                            single1 = tf2.X + (((singleArray1[0] - tf2.X) * 2f) / 3f);
                            single2 = tf2.Y + (((singleArray1[1] - tf2.Y) * 2f) / 3f);
                            single3 = singleArray1[0] + ((singleArray1[2] - singleArray1[0]) / 3f);
                            single4 = singleArray1[1] + ((singleArray1[3] - singleArray1[1]) / 3f);
                            if (singleArray1.Length != 4)
                            {
                                throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                            }
                            path1.AddBezier(tf2.X, tf2.Y, single1, single2, single3, single4, singleArray1[2], singleArray1[3]);
                            goto Label_0579;
                        }
                        case 'S':
                        {
                            if (singleArray1.Length != 4)
                            {
                                throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                            }
                            if (!tf1.IsEmpty)
                            {
                                goto Label_0755;
                            }
                            path1.AddBezier(tf2.X, tf2.Y, tf2.X, tf2.Y, singleArray1[0], singleArray1[1], singleArray1[2], singleArray1[3]);
                            pointsInfo.Add(new PointInfo(new PointF(singleArray1[2], singleArray1[3]), tf2, new PointF(singleArray1[0], singleArray1[1]), text1));
                            goto Label_07C4;
                        }
                        case 'T':
                        {
                            if (!tf1.IsEmpty)
                            {
                                goto Label_05D2;
                            }
                            single5 = tf2.X;
                            single6 = tf2.Y;
                            goto Label_0600;
                        }
                        case 'V':
                        {
                            if (singleArray1.Length != 1)
                            {
                                throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                            }
                            path1.AddLine(tf2, new PointF(tf2.X, singleArray1[0]));
                            goto Label_0439;
                        }
                        case 'Z':
                        {
                            goto Label_0F72;
                        }
                    }
                    goto Label_0FEB;
                }
                if (ch2 <= 'h')
                {
                    switch (ch2)
                    {
                        case 'a':
                        {
                            path2 = new ExtendedGraphicsPath(path1);
                            if (singleArray1.Length != 7)
                            {
                                throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                            }
                            path2.AddArc(tf2, new PointF(singleArray1[5] + tf2.X, singleArray1[6] + tf2.Y), singleArray1[0], singleArray1[1], (singleArray1[3] != 0f) && true, (singleArray1[4] != 0f) && true, singleArray1[2]);
                            goto Label_09F7;
                        }
                        case 'b':
                        {
                            goto Label_0FEB;
                        }
                        case 'c':
                        {
                            if (singleArray1.Length != 6)
                            {
                                throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("unnabeparsepath") + text1);
                            }
                            path1.AddBezier(tf2.X, tf2.Y, (float) (singleArray1[0] + tf2.X), (float) (singleArray1[1] + tf2.Y), (float) (singleArray1[2] + tf2.X), (float) (singleArray1[3] + tf2.Y), (float) (singleArray1[4] + tf2.X), (float) (singleArray1[5] + tf2.Y));
                            goto Label_0EF0;
                        }
                        case 'h':
                        {
                            goto Label_0397;
                        }
                    }
                    goto Label_0FEB;
                }
                switch (ch2)
                {
                    case 'l':
                    {
                        if (singleArray1.Length != 2)
                        {
                            throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                        }
                        path1.AddLine(tf2, new PointF(singleArray1[0] + tf2.X, singleArray1[1] + tf2.Y));
                        goto Label_030E;
                    }
                    case 'm':
                    {
                        path1.StartFigure();
                        if (singleArray1.Length != 2)
                        {
                            throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                        }
                        tf2 = new PointF(singleArray1[0], singleArray1[1]);
                        info2 = new PointInfo(tf2, text1);
                        info2.IsStart = true;
                        isArc=false;
                        PathFunc.startinfo = info2;
                        goto Label_025F;
                    }
                    case 'n':
                    case 'o':
                    case 'p':
                    case 'r':
                    case 'u':
                    {
                        goto Label_0FEB;
                    }
                    case 'q':
                    {
                        single1 = tf2.X + ((singleArray1[0] * 2f) / 3f);
                        single2 = tf2.Y + ((singleArray1[1] * 2f) / 3f);
                        single3 = (singleArray1[0] + tf2.X) + ((singleArray1[2] - singleArray1[0]) / 3f);
                        single4 = (singleArray1[1] + tf2.Y) + ((singleArray1[3] - singleArray1[1]) / 3f);
                        if (singleArray1.Length != 4)
                        {
                            throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                        }
                        path1.AddBezier(tf2.X, tf2.Y, single1, single2, single3, single4, (float) (singleArray1[2] + tf2.X), (float) (singleArray1[3] + tf2.Y));
                        goto Label_0B0D;
                    }
                    case 's':
                    {
                        if (singleArray1.Length != 4)
                        {
                            throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                        }
                        if (!tf1.IsEmpty)
                        {
                            goto Label_0D63;
                        }
                        path1.AddBezier(tf2.X, tf2.Y, tf2.X, tf2.Y, (float) (singleArray1[0] + tf2.X), (float) (singleArray1[1] + tf2.Y), (float) (singleArray1[2] + tf2.X), (float) (singleArray1[3] + tf2.Y));
                        goto Label_0DF2;
                    }
                    case 't':
                    {
                        if (!tf1.IsEmpty)
                        {
                            goto Label_0B98;
                        }
                        single5 = tf2.X;
                        single6 = tf2.Y;
                        goto Label_0BC6;
                    }
                    case 'v':
                    {
                        if (singleArray1.Length != 1)
                        {
                            throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                        }
                        path1.AddLine(tf2, new PointF(tf2.X, singleArray1[0] + tf2.Y));
                        goto Label_049B;
                    }
                    case 'z':
                    {
                        goto Label_0F72;
                    }
                    default:
                    {
                        goto Label_0FEB;
                    }
                }
            Label_0205://M
                num2++;
                goto Label_1001;
            Label_025F:
                num2++;
                goto Label_1001;
            Label_02B5:
                tf2 = new PointF(singleArray1[0], singleArray1[1]);
                goto Label_1001;
            Label_030E:
                tf2 = new PointF(singleArray1[0] + tf2.X, singleArray1[1] + tf2.Y);
                info2 = new PointInfo(tf2, text1);
                goto Label_1001;
            Label_033D:
                if (singleArray1.Length == 1)
                {
                    path1.AddLine(tf2, new PointF(singleArray1[0], tf2.Y));
                }
                else
                {
                    throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                }
                tf2 = new PointF(singleArray1[0], tf2.Y);
                info2 = new PointInfo(tf2, text1);
                goto Label_1001;
            Label_0397:
                if (singleArray1.Length == 1)
                {
                    path1.AddLine(tf2, new PointF(singleArray1[0] + tf2.X, tf2.Y));
                }
                else
                {
                    throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                }
                tf2 = new PointF(singleArray1[0] + tf2.X, tf2.Y);
                info2 = new PointInfo(tf2, text1);
                goto Label_1001;
            Label_0439:
                tf2 = new PointF(tf2.X, singleArray1[0]);
                info2 = new PointInfo(tf2, text1);
                goto Label_1001;
            Label_049B:
                tf2 = new PointF(tf2.X, singleArray1[0] + tf2.Y);
                info2 = new PointInfo(tf2, text1);
                goto Label_1001;
            Label_0579:
                tf1 = new PointF(single3, single4);
                tf2 = new PointF(singleArray1[2], singleArray1[3]);
                info2 = new PointInfo(tf2, new PointF(single1, single2), new PointF(single3, single4), text1);
                goto Label_1001;
            Label_05D2:
                single5 = (2f * tf2.X) - tf1.X;
                single6 = (2f * tf2.Y) - tf1.Y;
            Label_0600:
                single1 = tf2.X + (((single5 - tf2.X) * 2f) / 3f);
                single2 = tf2.Y + (((single6 - tf2.Y) * 2f) / 3f);
                single3 = single5 + ((singleArray1[0] - single5) / 3f);
                single4 = single6 + ((singleArray1[1] - single6) / 3f);
                if (singleArray1.Length != 2)
                {
                    throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                }
                path1.AddBezier(tf2.X, tf2.Y, single1, single2, single3, single4, singleArray1[0], singleArray1[1]);
                tf1 = new PointF(single3, single4);
                tf2 = new PointF(singleArray1[0], singleArray1[1]);
                info2 = new PointInfo(tf2, new PointF(single1, single2), new PointF(single3, single4), text1);
                goto Label_1001;
            Label_0755:
                single1 = (2f * tf2.X) - tf1.X;
                single2 = (2f * tf2.Y) - tf1.Y;
                path1.AddBezier(tf2.X, tf2.Y, single1, single2, singleArray1[0], singleArray1[1], singleArray1[2], singleArray1[3]);
            Label_07C4:
                tf1 = new PointF(singleArray1[0], singleArray1[1]);
                tf2 = new PointF(singleArray1[2], singleArray1[3]);
                info2 = new PointInfo(path1.GetLastPoint(), path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2], text1);
                goto Label_1001;
            Label_0872:
                tf1 = new PointF(singleArray1[2], singleArray1[3]);
                tf2 = new PointF(singleArray1[4], singleArray1[5]);
                info2 = new PointInfo(new PointF(singleArray1[4], singleArray1[5]), new PointF(singleArray1[0], singleArray1[1]), new PointF(singleArray1[2], singleArray1[3]), text1);
                goto Label_1001;
            Label_092D://A
                tf1 = PointF.Empty;
                tf2 = path1.GetLastPoint();//, path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2]
                info2 = new PointInfo(tf2,PointF.Empty,new PointF(tf2.X+singleArray1[0],tf2.Y), text1);
                info2.NextControl=new PointF(tf2.X,tf2.Y+singleArray1[1]);
                info2.Rx=singleArray1[0];
                info2.Ry=singleArray1[1];
                info2.Angle=singleArray1[2];
                info2.LargeArcFlage=(int)singleArray1[3];
                info2.SweepFlage=(int)singleArray1[4];
                goto Label_1001;
            Label_09F7:
                tf1 = PointF.Empty;
                tf2 = path1.GetLastPoint();
                info2 = new PointInfo(path1.GetLastPoint(), path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2], text1);
                goto Label_1001;
            Label_0B0D:
                tf1 = new PointF(single3, single4);
                tf2 = new PointF(singleArray1[2] + tf2.X, tf2.Y + singleArray1[3]);
                info2 = new PointInfo(path1.GetLastPoint(), path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2], text1);
                goto Label_1001;
            Label_0B98:
                single5 = (2f * tf2.X) - tf1.X;
                single6 = (2f * tf2.Y) - tf1.Y;
            Label_0BC6:
                single1 = tf2.X + (((single5 - tf2.X) * 2f) / 3f);
                single2 = tf2.Y + (((single6 - tf2.Y) * 2f) / 3f);
                single3 = single5 + (((singleArray1[0] + tf2.X) - single5) / 3f);
                single4 = single6 + (((singleArray1[1] + tf2.Y) - single6) / 3f);
                if (singleArray1.Length != 2)
                {
                    throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("invalidpathformat") + text1);
                }
                path1.AddBezier(tf2.X, tf2.Y, single1, single2, single3, single4, (float) (singleArray1[0] + tf2.X), (float) (singleArray1[1] + tf2.Y));
                tf1 = new PointF(single3, single4);
                tf2 = new PointF(singleArray1[0] + tf2.X, tf2.Y + singleArray1[1]);
                info2 = new PointInfo(path1.GetLastPoint(), path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2], text1);
                goto Label_1001;
            Label_0D63:
                single1 = (2f * tf2.X) - tf1.X;
                single2 = (2f * tf2.Y) - tf1.Y;
                path1.AddBezier(tf2.X, tf2.Y, single1, single2, (float) (singleArray1[0] + tf2.X), (float) (singleArray1[1] + tf2.Y), (float) (singleArray1[2] + tf2.X), (float) (singleArray1[3] + tf2.Y));
            Label_0DF2:
                tf1 = new PointF(singleArray1[0] + tf2.X, tf2.Y + singleArray1[1]);
                tf2 = new PointF(singleArray1[2] + tf2.X, tf2.Y + singleArray1[3]);
                info2 = new PointInfo(path1.GetLastPoint(), path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2], text1);
                goto Label_1001;
            Label_0EF0:
                tf1 = new PointF(singleArray1[2] + tf2.X, tf2.Y + singleArray1[3]);
                tf2 = new PointF(singleArray1[4] + tf2.X, tf2.Y + singleArray1[5]);
                info2 = new PointInfo(path1.GetLastPoint(), path1.PathPoints[path1.PointCount - 3], path1.PathPoints[path1.PointCount - 2], text1);
                goto Label_1001;
            Label_0F72://Z
                path1.CloseFigure();
                if (pointsInfo.Count > 0)
                {
                    PointInfo info3 = pointsInfo[pointsInfo.Count - 1];
                    if ((PathFunc.startinfo != null) && (info3 != PathFunc.startinfo))
                    {   PathFunc.startinfo.PreInfo = info3;
                        info3.NextInfo = PathFunc.startinfo;
                        if(!isArc)
                        {
                            PathFunc.startinfo.SecondControl = info3.SecondControl;
                        }
            //                        info3.NextControl = PathFunc.startinfo.NextControl;
                        info3.IsEnd = true;
                    }
                }
                num2++;
                goto Label_1001;
            Label_0FEB://error
                throw new Exception(ItopVector.Core.Config.Config.GetLabelForName("unnabeparsepath") + text);
            Label_1001:
                if (info2 != null)
                {
                    info2.Command = ch1.ToString();
                    pointsInfo.Add(info2);
                    //info2.PreString = text1;//text2.ToString();
                    info2.SubPath = num2;
                    info2.Index=num3;
                }

                info1 = info2;
                //text2.Append(match1.Value);
                match1 = match1.NextMatch();
                num1++;
            }
            return path1;
        }