Пример #1
0
 void SelectOperation_OnElementMove(object sender, MoveEventArgs e)
 {
     if (OnElementMove!=null)
     {
         OnElementMove(sender, e);
     }
 }
Пример #2
0
 void DrawArea_OnElementMove(object sender, MoveEventArgs e)
 {
     //string a = tlVectorControl1.SVGDocument.CurrentLayer.ID;
     //MessageBox.Show(a);
 }
Пример #3
0
        void DrawArea_OnElementMove(object sender, MoveEventArgs e)
        {
            SvgElementCollection list = tlVectorControl1.SVGDocument.SelectCollection;
            ISvgElement element = e.SvgElement;
            PointF beforeMove = e.BeforeMove;
            PointF afterMove = e.AfterMove;
            XmlNodeList listFirstNode = tlVectorControl1.SVGDocument.SelectNodes("svg/*[@FirstNode='" + element.ID + "']");
            RectangleF t = ((IGraph)element).GetBounds();
            PointF[] ptt = new PointF[] { beforeMove, afterMove };
            Transf tran = (element as Graph).Transform;
            tran.Matrix.TransformPoints(ptt);
            beforeMove = ptt[0];
            afterMove = ptt[1];
            foreach (XmlNode node in listFirstNode)
            {
                if (list.Contains((ISvgElement)(node as XmlElement)))
                {
                    continue;
                }
                PointF[] first = (node as Polyline).Points;
                XmlElement line = node as XmlElement;
                PointF pt1 = new PointF(first[0].X, first[0].Y);
                first[0].X = first[0].X + afterMove.X - beforeMove.X;
                first[0].Y = first[0].Y + afterMove.Y - beforeMove.Y;
                string temp = null;
                (node as Polyline).GPath.Reset();
                (node as Polyline).GPath.AddLines(first);
                foreach (PointF pt in first)
                {
                    if (temp == null)
                    {
                        temp += pt.X + " " + pt.Y;
                    }
                    else
                    {
                        temp += "," + pt.X + " " + pt.Y;
                    }
                }
                if (first[0] != pt1)
                {
                    (node as XmlElement).SetAttribute("points", temp);
                }
            }

            XmlNodeList listLastNode = tlVectorControl1.SVGDocument.SelectNodes("svg/*[@LastNode='" + element.ID + "']");
            foreach (XmlNode node in listLastNode)
            {
                if (list.Contains((ISvgElement)(node as XmlElement)))
                {
                    continue;
                }
                PointF[] first = (node as Polyline).Points;
                XmlElement line = node as XmlElement;
                PointF pt1 = new PointF(first[first.Length - 1].X, first[first.Length - 1].Y);
                first[first.Length - 1].X = first[first.Length - 1].X + afterMove.X - beforeMove.X;
                first[first.Length - 1].Y = first[first.Length - 1].Y + afterMove.Y - beforeMove.Y;
                string temp = null;
                (node as Polyline).GPath.Reset();
                (node as Polyline).GPath.AddLines(first);
                foreach (PointF pt in first)
                {
                    if (temp == null)
                    {
                        temp += pt.X + " " + pt.Y;
                    }
                    else
                    {
                        temp += "," + pt.X + " " + pt.Y;
                    }
                }
                if (first[first.Length - 1] != pt1)
                {
                    (node as XmlElement).SetAttribute("points", temp);
                }
            }

            XmlNode listText = tlVectorControl1.SVGDocument.SelectSingleNode("svg/*[@ParentID='" + element.ID + "']");
            (listText as Text).SetAttribute("x", (Convert.ToDouble((listText as Text).GetAttribute("x")) + afterMove.X - beforeMove.X).ToString());
            (listText as Text).SetAttribute("y", (Convert.ToDouble((listText as Text).GetAttribute("y")) + afterMove.Y - beforeMove.Y).ToString());
        }
Пример #4
0
        void DrawArea_OnElementMove(object sender, MoveEventArgs e)
        {
            //string a = tlVectorControl1.SVGDocument.CurrentLayer.ID;
            //MessageBox.Show(a);
            //变电站选址移动时起相关的辐射线也跟着移动
            try {
                ISvgElement element = e.SvgElement;
                XmlElement el = (XmlElement)tlVectorControl1.SVGDocument.SelectSingleNode("svg/use [@id='" + element.ID + "']");
                if (!string.IsNullOrEmpty(el.GetAttribute("xzflag").ToString()) && el.GetAttribute("xzflag").ToString() == "1") {
                    SvgElementCollection list = tlVectorControl1.SVGDocument.SelectCollection;
                    PointF beforeMove = e.BeforeMove;
                    PointF afterMove = e.AfterMove;
                    XmlNodeList listFirstNode = tlVectorControl1.SVGDocument.SelectNodes("svg/polyline[@FirstNode='" + element.ID + "']");
                    RectangleF t = ((IGraph)element).GetBounds();
                    PointF[] ptt = new PointF[] { beforeMove, afterMove };
                    Transf tran = (element as Graph).Transform;
                    tran.Matrix.TransformPoints(ptt);
                    beforeMove = ptt[0];
                    afterMove = ptt[1];
                    foreach (XmlNode node in listFirstNode) {
                        if (list.Contains((ISvgElement)(node as XmlElement))) {
                            continue;
                        }
                        PointF[] first = (node as Polyline).Points;
                        XmlElement line = node as XmlElement;
                        PointF pt1 = new PointF(first[0].X, first[0].Y);
                        first[0].X = first[0].X + afterMove.X - beforeMove.X;
                        first[0].Y = first[0].Y + afterMove.Y - beforeMove.Y;
                        string temp = null;
                        (node as Polyline).GPath.Reset();
                        (node as Polyline).GPath.AddLines(first);
                        temp = first[0].X + " " + first[0].Y + "," + first[1].X + " " + first[1].Y;
                        //foreach (PointF pt in first) {
                        //    if (temp == null) {
                        //        temp += pt.X + " " + pt.Y;
                        //    } else {
                        //        temp += "," + pt.X + " " + pt.Y;
                        //    }
                        //}
                        //if (first[0] != pt1) {
                        (node as XmlElement).SetAttribute("points", temp);
                        // }
                    }

                    //XmlNode listText = tlVectorControl1.SVGDocument.SelectSingleNode("svg/*[@ParentID='" + element.ID + "']");
                    //(listText as Text).SetAttribute("x", (Convert.ToDouble((listText as Text).GetAttribute("x")) + afterMove.X - beforeMove.X).ToString());
                    //(listText as Text).SetAttribute("y", (Convert.ToDouble((listText as Text).GetAttribute("y")) + afterMove.Y - beforeMove.Y).ToString());
                }
            }
            catch(Exception e1)
            {

            }
        }
Пример #5
0
 void mouseAreaControl_OnElementMove(object sender, MoveEventArgs e)
 {
     if (OnElementMove!=null)
        {
        OnElementMove(sender, e);
        }
 }
Пример #6
0
        public void OnMouseUp(MouseEventArgs e)
        {
            ToolOperation operation1 = this.mouseAreaControl.CurrentOperation;
            if (e.Button != MouseButtons.None)
            {
                if (e.Button == MouseButtons.Left )
                {
                    if(operation1 ==ToolOperation.WindowZoom)
                    {

                        ItopVector.DrawArea.DrawArea area1 = this.mouseAreaControl.PicturePanel;
                        PointF tf13 = this.mouseAreaControl.PicturePanel.PointToSystem(startpoint);
                        if((int)tf13.X==e.X && (int)tf13.Y==e.Y){return;}
                        PointF Vstartpoint=this.startpoint;//this.mouseAreaControl.PicturePanel.PointToView(startpoint);
                        PointF Vendpoint=this.mouseAreaControl.PicturePanel.PointToView(new PointF(e.X,e.Y));
                        float a1=820/Math.Abs(tf13.X-e.X);
                        float a2=570/Math.Abs(tf13.Y-e.Y);
                        //float a1=(area1.DocumentSizeEx.Width/Math.Abs(Vstartpoint.X-Vendpoint.X));
                        //						float a2=(area1.DocumentSizeEx.Height/Math.Abs(Vstartpoint.Y-Vendpoint.Y));
                        //						area1.VirtualLeft=(startpoint.X+e.X)/2;
                        //						area1.VirtualTop=(startpoint.Y+e.Y)/2;
                        area1.VirtualLeft=(Vstartpoint.X+Vendpoint.X)/2;
                        area1.VirtualTop=(Vstartpoint.Y+Vendpoint.Y)/2;
                        float scale=area1.ScaleUnit;
                        float vLeft=area1.VirtualLeft;
                        float vTop=area1.VirtualTop;
                        float XMove=vLeft-(tf13.X+e.X)/2;
                        float YMove=vTop-(tf13.Y+e.Y)/2;
                        float mx=((tf13.X+e.X)/2)/(area1.hScrollBar1.Maximum);
                        float my=((tf13.Y+e.Y)/2)/(area1.vScrollBar1.Maximum);
                        if(a1<a2)
                        {
                            area1.ScaleUnit *= a1;
                            area1.VirtualLeft=area1.hScrollBar1.Maximum*mx;// +20*(area1.ScaleUnit-1);//+Math.Abs(Math.Abs(Vstartpoint.X)-Math.Abs(Vendpoint.X))/2;
                            area1.VirtualTop=area1.vScrollBar1.Maximum*my+330;//+330*(area1.ScaleUnit-1);//+Math.Abs(Math.Abs(Vstartpoint.Y)-Math.Abs(Vendpoint.Y))/2;

                        }
                        else
                        {
                            area1.ScaleUnit *= a2;
                            area1.VirtualLeft=area1.hScrollBar1.Maximum*mx;// +20*(area1.ScaleUnit-1);//+Math.Abs(Math.Abs(Vstartpoint.X)-Math.Abs(Vendpoint.X))/2;
                            area1.VirtualTop=area1.vScrollBar1.Maximum*my+330;//+330*(area1.ScaleUnit-1);//+Math.Abs(Math.Abs(Vstartpoint.Y)-Math.Abs(Vendpoint.Y))/2;

                        }

                        goto Lable_MoveIn;
                    }
                    if (operation1 == ToolOperation.AreaSelect)
                    {
                        this.AreaPoints.Add(new PointF((float) e.X, (float) e.Y));
                        PointF[] tfArray1 = new PointF[this.AreaPoints.Count];
                        this.AreaPoints.CopyTo(tfArray1, 0);
                        this.AreaPoints.Clear();
                        Matrix matrix1 = new Matrix();
                        this.selectAreaPath = new GraphicsPath();
                        this.selectAreaPath.AddLines(tfArray1);

                        this.selectAreaPath.CloseFigure();
                        Region region1 = new Region(this.selectAreaPath);
                        this.mouseAreaControl.SVGDocument.ClearSelects();

                        SvgElementCollection collection1 =new SvgElementCollection();
                        if (freeSelect)
                        {
                            foreach(Layer layer in this.mouseAreaControl.SVGDocument.Layers)
                            {
                                if(layer.Visible)
                                {
                                    collection1.AddRange(layer.GraphList);
                                }
                            }
                        }
                        else
                        {
                            collection1 = this.mouseAreaControl.SVGDocument.CurrentLayer.GraphList;
                        }

                        SvgElementCollection.ISvgElementEnumerator enumerator1 = collection1.GetEnumerator();

                        while (enumerator1.MoveNext())
                        {
                            IGraph graph1 = (IGraph) enumerator1.Current;

                            GraphicsPath path1 = (GraphicsPath) graph1.GPath.Clone();
                            path1.Transform(graph1.GraphTransform.Matrix);
                            RectangleF ef1 = PathFunc.GetBounds(path1);
                            if ((region1.IsVisible(ef1/*new System.Drawing.Rectangle((int) ef1.X, (int) ef1.Y, (int) ef1.Width, (int) ef1.Height)*/) && !graph1.IsLock) && (graph1.DrawVisible /*&& (AnimFunc.GetKeyIndex((SvgElement) graph1, this.mouseAreaControl.SVGDocument.ControlTime, true) >= 0)*/))
                            {
                                this.mouseAreaControl.SVGDocument.AddSelectElement(graph1);
                            }
                        }

                        GraphicsPath path2 = new GraphicsPath();
                        path2.AddLines(tfArray1);
                        RectangleF ef2 = path2.GetBounds();
                        this.mouseAreaControl.Invalidate(new System.Drawing.Rectangle(((int) ef2.X) - 10, ((int) ef2.Y) - 10, ((int) ef2.Width) + 20, ((int) ef2.Height) + 20));
                        return;
                    }
                    if (this.currentMousePoint == MousePoint.CenterPoint && (((XmlElement)selectCollection[0]).GetAttribute("layer").ToString()==SvgDocument.currentLayer||freeSelect))
                    {
                        PointF tf1 = this.mouseAreaControl.PicturePanel.PointToView(this.mouseAreaControl.CenterPoint);
                        PointF tf2 = this.mouseAreaControl.CenterPoint;
                        this.mouseAreaControl.PicturePanel.Invalidate(new System.Drawing.Rectangle(((int) tf2.X) - 6, ((int) tf2.Y) - 6, 12, 12));
                        SizeF ef3 = this.mouseAreaControl.PicturePanel.GridSize;
                        float single1 = ef3.Height;
                        float single2 = ef3.Width;
                        PointF tf3 = startpoint;//this.mouseAreaControl.PicturePanel.PointToView(this.);
                        PointF tf4 = this.mouseAreaControl.PicturePanel.PointToView(new PointF((float) e.X, (float) e.Y));
                        if (this.mouseAreaControl.PicturePanel.SnapToGrid)
                        {
                            int num1 = (int) ((tf3.X + (single2 / 2f)) / single2);
                            int num2 = (int) ((tf3.Y + (single1 / 2f)) / single1);
                            tf3 = (PointF) new Point((int) (num1 * single2), (int) (num2 * single1));
                            num1 = (int) ((tf4.X + (single2 / 2f)) / single2);
                            num2 = (int) ((tf4.Y + (single1 / 2f)) / single1);
                            tf4 = (PointF) new Point((int) (num1 * single2), (int) (single1 * num2));
                        }
                        tf3 = this.mouseAreaControl.PicturePanel.PointToSystem(tf3);
                        tf4 = this.mouseAreaControl.PicturePanel.PointToSystem(tf4);
                        this.mouseAreaControl.PicturePanel.CenterPoint = tf4;
                    }
                    else if ((this.currentMousePoint != MousePoint.None) && (this.toBeSelectedPath != null))
                    {
                        if ((((Control.ModifierKeys != Keys.Control) && (Control.ModifierKeys != Keys.Shift) && (this.toBeSelectedGraph != null)) && (!this.mouseAreaControl.SVGDocument.SelectCollection.Contains(this.toBeSelectedGraph) /*&& !this.toBeSelectedGraph.IsLock*/)) && this.toBeSelectedGraph.DrawVisible)// && ((XmlElement)selectCollection[0]).GetAttribute("layer").ToString()==SvgDocument.currentLayer)
                        {
                            this.mouseAreaControl.SVGDocument.ClearSelects();
                            this.mouseAreaControl.SVGDocument.AddSelectElement(this.toBeSelectedGraph);

                        }
                        if(mouseAreaControl.CanEdit==false || (((XmlElement)selectCollection[0]).GetAttribute("layer").ToString()!=SvgDocument.currentLayer&&!freeSelect)||(this.toBeSelectedGraph!=null && this.toBeSelectedGraph.IsLock))
                        {
                            goto Lable_MoveIn;
                        }
                        this.win32.hdc = this.win32.W32GetDC(this.mouseAreaControl.Handle);
                        this.win32.W32SetROP2(7);
                        this.win32.W32PolyDraw(this.reversePath);
                        this.win32.ReleaseDC();
                        PointF tf5 = this.mouseAreaControl.PicturePanel.PointToView(this.mouseAreaControl.CenterPoint);
                        float single3 = 0f;
                        float single4 = 0f;
                        PointF tf6 =startpoint;// this.mouseAreaControl.PicturePanel.PointToView(this.);
                        PointF tf7 = this.mouseAreaControl.PicturePanel.PointToView(new PointF((float) e.X, (float) e.Y));
                        SizeF ef4 = this.mouseAreaControl.PicturePanel.GridSize;
                        float single5 = ef4.Height;
                        float single6 = ef4.Width;
                        if (this.mouseAreaControl.PicturePanel.SnapToGrid)
                        {
                            int num3 = (int) ((tf6.X + (single6 / 2f)) / single6);
                            int num4 = (int) ((tf6.Y + (single5 / 2f)) / single5);
                            tf6 = (PointF) new Point((int) (num3 * single6), (int) (num4 * single5));
                            num3 = (int) ((tf7.X + (single6 / 2f)) / single6);
                            num4 = (int) ((tf7.Y + (single5 / 2f)) / single5);
                            tf7 = (PointF) new Point((int) (num3 * single6), (int) (single5 * num4));
                        }
                        PointF tf8 = this.mouseAreaControl.PicturePanel.PointToSystem(tf6);
                        PointF tf9 = this.mouseAreaControl.PicturePanel.PointToSystem(tf7);
                        PointF tf10 = tf6;
                        PointF tf11 = tf7;
                        PointF tf12 = tf5;
                        SvgDocument document1 = this.mouseAreaControl.SVGDocument;

                        bool flag1 = this.mouseAreaControl.PicturePanel.SVGDocument.AcceptChanges;
                        this.mouseAreaControl.PicturePanel.SVGDocument.AcceptChanges = true;
                        SvgDocument document2 = this.mouseAreaControl.SVGDocument;
                        document2.NumberOfUndoOperations += (this.mouseAreaControl.SVGDocument.SelectCollection.Count + 0x7d0);
                        SvgElementCollection.ISvgElementEnumerator enumerator2 = this.mouseAreaControl.SVGDocument.SelectCollection.GetEnumerator();
                        while (enumerator2.MoveNext())
                        {
                            float single10;
                            SvgElement element1 = (SvgElement) enumerator2.Current;
                            if (!(element1 is IGraph))
                            {
                                continue;
                            }
                            if (element1 is Use && (element1 as Use).LimitSize && currentMousePoint!=MousePoint.Translate)continue;
                            Matrix matrix2 = ((IGraph) element1).GraphTransform.Matrix.Clone();
                            Matrix matrix3 = this.mouseAreaControl.PicturePanel.CoordTransform.Clone();
                            matrix3.Invert();
                            matrix2.Multiply(matrix3, MatrixOrder.Append);
                            PointF tf13 = PointF.Empty;
                            GraphicsPath path3 = (GraphicsPath) ((IGraph) element1).GPath.Clone();
                            RectangleF ef5 = PathFunc.GetBounds(path3);
                            PointF[] tfArray6 = new PointF[9] { new PointF(ef5.X, ef5.Y), new PointF(ef5.X, ef5.Y + (ef5.Height / 2f)), new PointF(ef5.X, ef5.Bottom), new PointF(ef5.X + (ef5.Width / 2f), ef5.Y), new PointF(ef5.Right, ef5.Y), new PointF(ef5.Right, ef5.Y + (ef5.Height / 2f)), new PointF(ef5.Right, ef5.Bottom), new PointF(ef5.X + (ef5.Width / 2f), ef5.Bottom), new PointF(ef5.X + (ef5.Width / 2f), ef5.Y + (ef5.Height / 2f)) } ;
                            PointF[] tfArray2 = tfArray6;
                            Matrix matrix4 = matrix2.Clone();
                            if(matrix4.IsInvertible)
                                matrix4.Invert();
                            PointF[] tfArray7 = new PointF[3] { tf10, tf11, tf12 } ;
                            PointF[] tfArray3 = tfArray7;
                            if(this.currentMousePoint!=MousePoint.Rotate)
                            {
                                matrix4.TransformPoints(tfArray3);
                            }
                            tf6 = tfArray3[0];
                            tf7 = tfArray3[1];
                            tf5 = tfArray3[2];
                            single3 = tf7.X - tf6.X;
                            single4 = tf7.Y - tf6.Y;
                            Matrix matrix5 = new Matrix();
                            PointF tf23 = this.mouseAreaControl.PicturePanel.PointToSystem(startpoint);

                            if ((Math.Abs((float) (e.X - tf23.X)) <= 1f) && (Math.Abs((float) (e.Y - tf23.Y)) <= 1f))
                            {
                                return;
                            }
                            switch (this.currentMousePoint)
                            {
                                case MousePoint.ScaleTopLeft:
                                case MousePoint.ScaleTopMiddle:
                                case MousePoint.ScaleTopRight:
                                case MousePoint.ScaleMiddleLeft:
                                case MousePoint.ScaleMiddleRight:
                                case MousePoint.ScaleBottomLeft:
                                case MousePoint.ScaleBottomMiddle:
                                case MousePoint.ScaleBottomRight:
                                {
                                    if ((Control.ModifierKeys & Keys.Control) != Keys.Control)
                                    {
                                        goto Label_101C;
                                    }
                                    if (this.currentMousePoint != MousePoint.ScaleTopLeft)
                                    {
                                        goto Label_0F60;
                                    }
                                    tf13 = tfArray2[6];
                                    goto Label_1020;
                                }
                                case MousePoint.ScaleFromCenter:
                                case MousePoint.SkewXFromCenter:
                                case MousePoint.SkewYFromCenter:
                                case MousePoint.RotateFromCenter:
                                {
                                    continue;
                                }
                                case MousePoint.SkewXTop:
                                case MousePoint.SkewXBottom:
                                case MousePoint.SkewYLeft:
                                case MousePoint.SkewYRight:
                                {
                                    if ((Control.ModifierKeys & Keys.Control) != Keys.Control)
                                    {
                                        goto Label_16F2;
                                    }
                                    if (this.currentMousePoint != MousePoint.SkewXBottom)
                                    {
                                        goto Label_16A1;
                                    }
                                    tf13 = tfArray2[0];
                                    goto Label_16F6;
                                }
                                case MousePoint.Rotate:
                                {
                                    if ((Control.ModifierKeys & Keys.Control) != Keys.Control)
                                    {
                                        goto Label_1EAB;
                                    }
                                    tf13 = tfArray2[this.rotateindex];
                                    goto Label_1EAF;
                                }
                                case MousePoint.Translate:
                                {
                                    goto Label_09B7;
                                }
                                default:
                                {
                                    continue;
                                }
                            }
                        Label_09B7:
                            if (((element1.InfoList.Count == 1) && (document1.ControlTime == 0)) || !document1.RecordAnim)
                            {
                                Matrix matrix6 = ((IGraph) element1).Transform.Matrix.Clone();
                                if (element1.SvgAttributes.ContainsKey("transform"))
                                {
                                    Matrix matrix7 = ((Matrix) element1.SvgAttributes["transform"]).Clone();
                                    matrix7.Invert();
                                    matrix6.Multiply(matrix7, MatrixOrder.Append);
                                }
                                matrix5.Reset();
                                matrix5.Translate(single3, single4);
                                Matrix matrix8 = ((IGraph) element1).Transform.Matrix.Clone();
                                matrix8.Multiply(matrix5);
                                matrix6.Invert();
                                matrix6.Multiply(matrix8, MatrixOrder.Append);
                                //								string[] textArray1 = new string[13];
                                //								textArray1[0] = "matrix(";
                                //								double num13 = Math.Round((double) matrix6.Elements[0], 4);
                                //								textArray1[1] = num13.ToString();
                                //								textArray1[2] = ",";
                                //								double num14 = Math.Round((double) matrix6.Elements[1], 4);
                                //								textArray1[3] = num14.ToString();
                                //								textArray1[4] = ",";
                                //								double num15 = Math.Round((double) matrix6.Elements[2], 4);
                                //								textArray1[5] = num15.ToString();
                                //								textArray1[6] = ",";
                                //								double num16 = Math.Round((double) matrix6.Elements[3], 4);
                                //								textArray1[7] = num16.ToString();
                                //								textArray1[8] = ",";
                                //								double num17 = Math.Round((double) matrix6.Elements[4], 4);
                                //								textArray1[9] = num17.ToString();
                                //								textArray1[10] = ",";
                                //								double num18 = Math.Round((double) matrix6.Elements[5], 4);
                                //								textArray1[11] = num18.ToString();
                                //								textArray1[12] = ")";
                                //								string text1 = string.Concat(textArray1);
                                //								AttributeFunc.SetAttributeValue(element1, "transform", text1);
                                (element1 as IGraph).Transform= new ItopVector.Core.Types.Transf(matrix6);
                                this.mouseAreaControl.PicturePanel.InvalidateElement(element1);
                                if (element1 is Use)
                                {
                                    MoveEventArgs moveElement = new MoveEventArgs(element1, tf6, tf7);
                                    if (OnElementMove != null)
                                    {
                                        OnElementMove(element1, moveElement);
                                    }
                                }
                            }

                            continue;
                        Label_0F60:
                            if (this.currentMousePoint == MousePoint.ScaleTopRight)
                            {
                                tf13 = tfArray2[2];
                                goto Label_1020;
                            }
                            if (this.currentMousePoint == MousePoint.ScaleBottomLeft)
                            {
                                tf13 = tfArray2[4];
                                goto Label_1020;
                            }
                            if (this.currentMousePoint == MousePoint.ScaleBottomRight)
                            {
                                tf13 = tfArray2[0];
                                goto Label_1020;
                            }
                            if (this.currentMousePoint == MousePoint.ScaleMiddleLeft)
                            {
                                tf13 = tfArray2[5];
                                goto Label_1020;
                            }
                            if (this.currentMousePoint == MousePoint.ScaleMiddleRight)
                            {
                                tf13 = tfArray2[1];
                                goto Label_1020;
                            }
                            if (this.currentMousePoint == MousePoint.ScaleTopMiddle)
                            {
                                tf13 = tfArray2[7];
                                goto Label_1020;
                            }
                            if (this.currentMousePoint == MousePoint.ScaleBottomMiddle)
                            {
                                tf13 = tfArray2[3];
                            }
                            goto Label_1020;
                        Label_101C:
                            tf13 = tf5;
                        Label_1020:
                            single3 = (tf7.X - tf13.X) / (tf6.X - tf13.X);
                            single4 = (tf7.Y - tf13.Y) / (tf6.Y - tf13.Y);
                            if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift)
                            {
                                single3 = single4 = Math.Min(single3, single4);
                            }
                            if ((this.currentMousePoint == MousePoint.ScaleMiddleLeft) || (this.currentMousePoint == MousePoint.ScaleMiddleRight))
                            {
                                single4 = 1f;
                            }
                            else if ((this.currentMousePoint == MousePoint.ScaleTopMiddle) || (this.currentMousePoint == MousePoint.ScaleBottomMiddle))
                            {
                                single3 = 1f;
                            }
                            if (((element1.InfoList.Count == 1) && (document1.ControlTime == 0)) )
                            {
                                Matrix matrix12 = ((IGraph) element1).Transform.Matrix.Clone();
                                if (element1.SvgAttributes.ContainsKey("transform"))
                                {
                                    Matrix matrix13 = ((Matrix) element1.SvgAttributes["transform"]).Clone();
                                    if(matrix13.IsInvertible)
                                        matrix13.Invert();
                                    matrix12.Multiply(matrix13, MatrixOrder.Append);
                                }
                                matrix5.Reset();
                                matrix5.Translate(tf13.X, tf13.Y, MatrixOrder.Prepend);
                                matrix5.Scale(single3, single4, MatrixOrder.Prepend);
                                matrix5.Translate(-tf13.X, -tf13.Y, MatrixOrder.Prepend);
                                Matrix matrix14 = ((IGraph) element1).Transform.Matrix.Clone();
                                matrix14.Multiply(matrix5);
                                if(matrix12.IsInvertible)
                                    matrix12.Invert();
                                matrix12.Multiply(matrix14, MatrixOrder.Append);
                                string[] textArray2 = new string[13];
                                textArray2[0] = "matrix(";
                                double num19 = Math.Round((double) matrix12.Elements[0], 2);
                                textArray2[1] = num19.ToString();
                                textArray2[2] = ",";
                                double num20 = Math.Round((double) matrix12.Elements[1], 2);
                                textArray2[3] = num20.ToString();
                                textArray2[4] = ",";
                                double num21 = Math.Round((double) matrix12.Elements[2], 2);
                                textArray2[5] = num21.ToString();
                                textArray2[6] = ",";
                                double num22 = Math.Round((double) matrix12.Elements[3], 2);
                                textArray2[7] = num22.ToString();
                                textArray2[8] = ",";
                                double num23 = Math.Round((double) matrix12.Elements[4], 2);
                                textArray2[9] = num23.ToString();
                                textArray2[10] = ",";
                                double num24 = Math.Round((double) matrix12.Elements[5], 2);
                                textArray2[11] = num24.ToString();
                                textArray2[12] = ")";
                                string text2 = string.Concat(textArray2);
                                AttributeFunc.SetAttributeValue(element1, "transform", text2);
                                this.mouseAreaControl.PicturePanel.InvalidateElement(element1);
                            }
                            continue;
                        Label_16A1:
                            if (this.currentMousePoint == MousePoint.SkewXTop)
                            {
                                tf13 = tfArray2[6];
                                goto Label_16F6;
                            }
                            if (this.currentMousePoint == MousePoint.SkewYLeft)
                            {
                                tf13 = tfArray2[4];
                                goto Label_16F6;
                            }
                            if (this.currentMousePoint == MousePoint.SkewYRight)
                            {
                                tf13 = tfArray2[0];
                            }
                            goto Label_16F6;
                        Label_16F2:
                            tf13 = tf5;
                        Label_16F6:
                            single3 /= (tfArray2[6].Y - tfArray2[4].Y);
                            single4 /= (tfArray2[6].X - tfArray2[2].X);
                            if ((this.currentMousePoint == MousePoint.SkewXTop) || (this.currentMousePoint == MousePoint.SkewXBottom))
                            {
                                single4 = 0f;
                                if (this.currentMousePoint == MousePoint.SkewXTop)
                                {
                                    single3 = -single3;
                                }
                            }
                            else if ((this.currentMousePoint == MousePoint.SkewYLeft) || (this.currentMousePoint == MousePoint.SkewYRight))
                            {
                                single3 = 0f;
                                if (this.currentMousePoint == MousePoint.SkewYLeft)
                                {
                                    single4 = -single4;
                                }
                            }
                            single3 = (single3 == 0f) ? 0f : ((single3 / Math.Abs(single3)) * Math.Min(Math.Abs(single3), (float) 3f));
                            single4 = (single4 == 0f) ? 0f : ((single4 / Math.Abs(single4)) * Math.Min(Math.Abs(single4), (float) 3f));
                            float single8 = (float) ((Math.Atan((double) single3) / 3.1415926535897931) * 180);
                            float single9 = (float) ((Math.Atan((double) single4) / 3.1415926535897931) * 180);
                            matrix5.Translate(tf13.X, tf13.Y, MatrixOrder.Prepend);
                            matrix5.Shear(single3, single4, MatrixOrder.Prepend);
                            matrix5.Translate(-tf13.X, -tf13.Y, MatrixOrder.Prepend);
                            if (((element1.InfoList.Count == 1) && (document1.ControlTime == 0)))
                            {
                                Matrix matrix15 = ((IGraph) element1).Transform.Matrix.Clone();
                                if (element1.SvgAttributes.ContainsKey("transform"))
                                {
                                    Matrix matrix16 = ((Matrix) element1.SvgAttributes["transform"]).Clone();
                                    matrix16.Invert();
                                    matrix15.Multiply(matrix16, MatrixOrder.Append);
                                }
                                matrix5.Reset();
                                single8 = (float) ((Math.Atan((double) single3) / 3.1415926535897931) * 180);
                                single9 = (float) ((Math.Atan((double) single4) / 3.1415926535897931) * 180);
                                matrix5.Translate(tf13.X, tf13.Y, MatrixOrder.Prepend);
                                matrix5.Shear(single3, single4, MatrixOrder.Prepend);
                                matrix5.Translate(-tf13.X, -tf13.Y, MatrixOrder.Prepend);
                                Matrix matrix17 = ((IGraph) element1).Transform.Matrix.Clone();
                                matrix17.Multiply(matrix5);
                                matrix15.Invert();
                                matrix15.Multiply(matrix17, MatrixOrder.Append);
                                string[] textArray3 = new string[13];
                                textArray3[0] = "matrix(";
                                double num25 = Math.Round((double) matrix15.Elements[0], 2);
                                textArray3[1] = num25.ToString();
                                textArray3[2] = ",";
                                double num26 = Math.Round((double) matrix15.Elements[1], 2);
                                textArray3[3] = num26.ToString();
                                textArray3[4] = ",";
                                double num27 = Math.Round((double) matrix15.Elements[2], 2);
                                textArray3[5] = num27.ToString();
                                textArray3[6] = ",";
                                double num28 = Math.Round((double) matrix15.Elements[3], 2);
                                textArray3[7] = num28.ToString();
                                textArray3[8] = ",";
                                double num29 = Math.Round((double) matrix15.Elements[4], 2);
                                textArray3[9] = num29.ToString();
                                textArray3[10] = ",";
                                double num30 = Math.Round((double) matrix15.Elements[5], 2);
                                textArray3[11] = num30.ToString();
                                textArray3[12] = ")";
                                string text3 = string.Concat(textArray3);
                                AttributeFunc.SetAttributeValue(element1, "transform", text3);
                                this.mouseAreaControl.PicturePanel.InvalidateElement(element1);
                            }
                            continue;
                        Label_1EAB:
                            tf13 = tf5;
                        Label_1EAF:
                            single10 = 0f;
                            float single11 = (float) Math.Atan((double) ((tf6.Y - tf13.Y) / (tf6.X - tf13.X)));
                            float single12 = (float) Math.Atan((double) ((tf7.Y - tf13.Y) / (tf7.X - tf13.X)));
                            single10 = ((float) (((double) (single12 - single11)) / 3.1415926535897931)) * 180f;
                            if (((tf7.X - tf13.X) * (tf6.X - tf13.X)) < 0f)
                            {
                                single10 += 180f;
                            }
                            if (((Control.ModifierKeys & Keys.Shift) == Keys.Shift) && (single10 != 0f))
                            {
                                single10 = (single10 / Math.Abs(single10)) * ((((int) (Math.Abs(single10) + 23f)) / 0x2d) * 0x2d);
                            }
                            if (single10 < 0f)
                            {
                                single10 += 360f;
                            }
                            if (((element1.InfoList.Count == 1) && (document1.ControlTime == 0)) || !document1.RecordAnim)
                            {
                                using(Matrix matrix18 = ((IGraph) element1).Transform.Matrix.Clone())
                                {
                                    if (element1.SvgAttributes.ContainsKey("transform"))
                                    {
                                        using(Matrix matrix19 = ((Matrix) element1.SvgAttributes["transform"]).Clone())
                                        {
                                            matrix19.Invert();
                                            matrix18.Multiply(matrix19, MatrixOrder.Append);
                                        }
                                    }
                                    matrix5.Reset();
                                    matrix5.RotateAt(single10, tf13);
                                    using(Matrix matrix20 = ((IGraph) element1).Transform.Matrix.Clone())
                                    {
                                        if(this.currentMousePoint==MousePoint.Rotate)
                                        {
                                            matrix20.Multiply(matrix5,MatrixOrder.Append);
                                        }
                                        else
                                        {
                                            matrix20.Multiply(matrix5);
                                        }
                                        matrix18.Invert();
                                        matrix18.Multiply(matrix20, MatrixOrder.Append);
                                    }
                                    string[] textArray4 = new string[13];
                                    textArray4[0] = "matrix(";
                                    double num31 = Math.Round((double) matrix18.Elements[0], 2);
                                    textArray4[1] = num31.ToString();
                                    textArray4[2] = ",";
                                    double num32 = Math.Round((double) matrix18.Elements[1], 2);
                                    textArray4[3] = num32.ToString();
                                    textArray4[4] = ",";
                                    double num33 = Math.Round((double) matrix18.Elements[2], 2);
                                    textArray4[5] = num33.ToString();
                                    textArray4[6] = ",";
                                    double num34 = Math.Round((double) matrix18.Elements[3], 2);
                                    textArray4[7] = num34.ToString();
                                    textArray4[8] = ",";
                                    double num35 = Math.Round((double) matrix18.Elements[4], 2);
                                    textArray4[9] = num35.ToString();
                                    textArray4[10] = ",";
                                    double num36 = Math.Round((double) matrix18.Elements[5], 2);
                                    textArray4[11] = num36.ToString();
                                    textArray4[12] = ")";
                                    string text4 = string.Concat(textArray4);
                                    AttributeFunc.SetAttributeValue(element1, "transform", text4);
                                    this.mouseAreaControl.PicturePanel.InvalidateElement(element1);
                                }
                            }

                        }
                        this.mouseAreaControl.SVGDocument.NotifyUndo();
                        this.mouseAreaControl.SVGDocument.AcceptChanges = flag1;
                        if (this.currentMousePoint == MousePoint.Translate)
                        {
                            Matrix matrix21 = new Matrix();
                            matrix21.Translate(tf9.X - tf8.X, tf9.Y - tf8.Y);
                            PointF[] tfArray10 = new PointF[1] { this.mouseAreaControl.CenterPoint } ;
                            PointF[] tfArray5 = tfArray10;
                            matrix21.TransformPoints(tfArray5);
                            this.mouseAreaControl.CenterPoint = tfArray5[0];
                        }
                    }
                    else if (this.mouseAreaControl.CanEdit&&(this.currentMousePoint == MousePoint.None) && (OperationFunc.IsSelectOperation(operation1) || OperationFunc.IsTransformOperation(operation1)))
                    {
                        //��ѡ��
                        this.win32.hdc = this.win32.W32GetDC(this.mouseAreaControl.Handle);
                        this.win32.W32SetROP2(7);
                        this.win32.W32PolyDraw(this.reversePath);
                        this.win32.ReleaseDC();
                        PointF tf14 = new PointF((float) e.X, (float) e.Y);
                        PointF tf15 =startpoint;// this.mouseAreaControl.PicturePanel.PointToView(this.);
                        PointF tf16 = this.mouseAreaControl.PicturePanel.PointToView(tf14);
                        float single13 = this.mouseAreaControl.PicturePanel.ScaleUnit;
                        float single14 = Math.Min(tf15.X, tf16.X);
                        float single15 = Math.Min(tf15.Y, tf16.Y);
                        float single16 = Math.Max(tf15.X, tf16.X);
                        float single17 = Math.Max(tf15.Y, tf16.Y);
                        this.selectAreaPath = new GraphicsPath();
                        this.selectAreaPath.AddRectangle(new RectangleF(single14, single15, single16 - single14, single17 - single15));
                        Matrix matrix22 = this.mouseAreaControl.PicturePanel.CoordTransform.Clone();
                        this.selectAreaPath.Transform(matrix22);
                        RectangleF ef6 = PathFunc.GetBounds(this.selectAreaPath);

                        this.mouseAreaControl.SVGDocument.ClearSelects();
                        SvgElementCollection collection1 =null;// this.mouseAreaControl.PicturePanel.ElementList;

                        if ( !freeSelect)
                        {
                            ILayer layer1 = this.mouseAreaControl.SVGDocument.Layers[SvgDocument.currentLayer] as ILayer;
                            if(layer1 ==null)return;
                            collection1 = layer1.GraphList; //
                        }
                        else
                        {
                            collection1 =this.mouseAreaControl.PicturePanel.ElementList;
                        }
                        if (collection1 == null)
                        {
                            return;
                        }
                        int num11 = 0;
                        SvgElementCollection collection2 = new SvgElementCollection();
                        SvgElementCollection.ISvgElementEnumerator enumerator3 = collection1.GetEnumerator();
                        while (enumerator3.MoveNext())
                        {
                            IGraph graph2 = (IGraph) enumerator3.Current;
                            if ((graph2.CanSelect&&!graph2.IsLock && graph2.DrawVisible) && graph2.Visible )
                            {
                                GraphicsPath path4 = (GraphicsPath) graph2.GPath.Clone();
                                path4.Transform(graph2.GraphTransform.Matrix);
                                RectangleF ef7 = PathFunc.GetBounds(path4);
                                if (ef6.Contains(ef7))
                                {
                                    //int num12 = AnimFunc.GetKeyIndex((SvgElement) graph2, this.mouseAreaControl.SVGDocument.ControlTime, true);
                                    collection2.Add((SvgElement) graph2);
                                    num11++;
                                }
                            }
                        }
                        if (collection2.Count > 0)
                        {
                            this.mouseAreaControl.SVGDocument.SelectCollection.AddRange(collection2);
                        }
                        else
                        {
                            this.mouseAreaControl.SVGDocument.CurrentElement = (SvgElement) this.mouseAreaControl.SVGDocument.DocumentElement;
                        }
                    }
                    else if(OperationFunc.IsConnectLineOperation(operation1) )
                    {
                        string type="";

                        if(MouseArea.ConnectLinePoints==2)
                        {
                            switch  (operation1)
                            {
                                case ToolOperation.ConnectLine_Line:
                                    type="line";
                                    break;
                                case ToolOperation.ConnectLine_Polyline:
                                    type="polyline";
                                    break;
                                case ToolOperation.ConnectLine_Rightangle:
                                    type="rightangle";
                                    break;
                                case ToolOperation.ConnectLine_Spline:
                                    type="spline";
                                    break;
                            }
                            XmlElement n1=this.mouseAreaControl.SVGDocument.CreateElement("tonli","connectline","http://www.tonli.com/tonli");
                            n1.SetAttribute("x1",MouseArea.ConLineStartPoint.X.ToString());
                            n1.SetAttribute("y1",MouseArea.ConLineStartPoint.Y.ToString());
                            n1.SetAttribute("x2",MouseArea.ConLineEndPoint.X.ToString());
                            n1.SetAttribute("y2",MouseArea.ConLineEndPoint.Y.ToString());
                            n1.SetAttribute("start","#"+MouseArea.SvgStartObj.ID);
                            n1.SetAttribute("end","#"+MouseArea.SvgEndObj.ID);
                            n1.SetAttribute("type",type);
                            n1.SetAttribute("layer",SvgDocument.currentLayer);
                            this.mouseAreaControl.SVGDocument.RootElement.AppendChild(n1);
                            MouseArea.ConnectLinePoints=0;
                            ToolOperation oper=this.mouseAreaControl.CurrentOperation;
                            this.mouseAreaControl.CurrentOperation=ToolOperation.Select;
                            this.mouseAreaControl.CurrentOperation=oper;
                        }
                    }
                }//������̧��
            Lable_MoveIn:
                this.toBeSelectedGraph = null;
                this.toBeSelectedPath = null;
                this.reversePath.Reset();
                this.CurrentMousePoint = this.currentMousePoint;

            }
        }