Exemplo n.º 1
0
        public void Excute()
        {
            if (mState == null || mPipe == null)
            {
                return;
            }
            //先插入到数据库,获取id,后插入图层中
            int id = mState.AddPipe2Data(mPipe, mInJunc, mOutJunc);

            mPipe.pipeInfo.ID = id;
            mPath             = mState.AddPipe(mPipe, new VectorLine(mState.Mercator2Screen(mPipe.Start.Location), mState.Mercator2Screen(mPipe.End.Location)));
        }
Exemplo n.º 2
0
        public void Undo()
        {
            if (mState == null)
            {
                return;
            }
            Pipe pipe = mPath.ToolTip as Pipe;

            mPath = mState.AddPipe(pipe, new VectorLine(pipe.Start.Location, pipe.End.Location));
            Cover start = new Cover();

            start.juncInfo    = new DBCtrl.DBClass.CJuncInfo();
            start.juncInfo.ID = pipe.pipeInfo.In_JunID;

            Cover end = new Cover();

            end.juncInfo    = new DBCtrl.DBClass.CJuncInfo();
            end.juncInfo.ID = pipe.pipeInfo.Out_JunID;
            mCurId          = mState.AddPipe2Data(pipe, start, end);
        }