Ejemplo n.º 1
0
        public void Draw(PointerModes mode, CADPoint _loc, double Length, double pickupBox_side, bool show)
        {
            Open();
            if (!show)
            {
                Close();
                return;
            }

            var loc = _drawing.ModelToCanvas(_loc);

            if (mode == PointerModes.Default || mode == PointerModes.Select)
            {
                var p = new CADPoint(loc.X - pickupBox_side / 2, loc.Y - pickupBox_side / 2);
                DrawRectangle(p, pickupBox_side, pickupBox_side, false);
            }

            if (mode == PointerModes.Default || mode == PointerModes.Locate)
            {
                var p1 = new CADPoint(loc.X - Length / 2, loc.Y);
                var p2 = new CADPoint(loc.X + Length / 2, loc.Y);
                DrawLine(p1, p2, false);
                p1 = new CADPoint(loc.X, loc.Y - Length / 2);
                p2 = new CADPoint(loc.X, loc.Y + Length / 2);
                DrawLine(p1, p2, false);
            }
            Close();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Конструктор
        /// </summary>
        public Editor(CompManager compManager, Log log)
        {
            if (compManager == null)
            {
                throw new ArgumentNullException("compManager");
            }
            if (log == null)
            {
                throw new ArgumentNullException("log");
            }

            this.compManager = compManager;
            this.log         = log;
            changes          = new List <Change>();
            changeStampCntr  = 0;
            modified         = false;
            pointerMode      = PointerModes.Select;
            selComponents    = new List <BaseComponent>();
            clipboard        = new List <BaseComponent>();

            EditorID             = GetRandomString(EditorIDLength);
            SchemeView           = null;
            FileName             = "";
            History              = new History(log);
            NewComponentTypeName = "";
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 初始化
        /// </summary>
        public virtual void Initialize()
        {
            _lastPointerMode = this.Pointer.mode;
            _lastShowAnchor  = this.Pointer.isShowAnchor;

            this.Pointer.isShowAnchor = false;
        }