Example #1
0
        public IDrawObj StudioCreateDrawObj(Type type, RectangleF rf)
        {
            const int limit = 5;
            const int v     = 100;

            if (rf.Width < limit || rf.Height < limit)
            {
                rf.Width  = v;
                rf.Height = v;
            }

            Undo.StartTransaction("Create");
            IDrawObj obj = CreateDrawObj(type);

            CreateDrawObjOper(obj);

            obj.Parant = Container;
            _nameManager.CreateName(obj);
            obj.Rect  = rf;
            obj.Layer = DefaultLayer;
            obj.LoadInitializationEvent();

            Undo.EndTransaction();

            return(obj);
        }
Example #2
0
        private IDrawObj CloneDrawObj(IDrawObj origObj)
        {
            IDrawObj newObj = (IDrawObj)origObj.Clone();

            newObj.Parant = Container;
            _nameManager.CreateName(newObj);
            newObj.LoadInitializationEvent();
            Objs.Add(newObj);
            newObj.Invalidate();
            return(newObj);
        }