Exemplo n.º 1
0
 public virtual void Copy(DrawObjectBase acopy)
 {
     UseLayerColor = acopy.UseLayerColor;
     UseLayerWidth = acopy.UseLayerWidth;
     Width         = acopy.Width;
     Color         = acopy.Color;
 }
Exemplo n.º 2
0
        public void ClearSelectedObjects()
        {
            IEnumerable <IDrawObject> x = SelectedObjects;

            foreach (IDrawObject drawobject in x)
            {
                DrawTools.DrawObjectBase obj = drawobject as DrawTools.DrawObjectBase;
                obj.Selected = false;
            }
            m_selection.Clear();
        }
Exemplo n.º 3
0
        public IDrawObject CreateObject(string type, UnitPoint point, ISnapPoint snappoint)
        {
            DrawingLayer layer = ActiveLayer as DrawingLayer;

            if (layer.Enabled == false)
            {
                return(null);
            }
            DrawTools.DrawObjectBase newobj = CreateObject(type);
            if (newobj != null)
            {
                newobj.Layer = layer;
                newobj.InitializeFromModel(point, layer, snappoint);
            }
            return(newobj as IDrawObject);
        }
Exemplo n.º 4
0
        /*
         *      public int Count
         *      {
         *              get { return m_objects.Count; }
         *      }
         *      public void Copy(DrawingLayer acopy, bool includeDrawObjects)
         *      {
         *              if (includeDrawObjects)
         *                      throw new Exception("not supported yet");
         *              m_id = acopy.m_id;
         *              m_name = acopy.m_name;
         *              m_color = acopy.m_color;
         *              m_width = acopy.m_width;
         *              m_enabled = acopy.m_enabled;
         *              m_visible = acopy.m_visible;
         *      }
         */

        #region ICanvasLayer Members
        public void Draw(ICanvas canvas, RectangleF unitrect)
        {
            int cnt = 0;

            Console.WriteLine("Draw ing Layer");
            foreach (IDrawObject drawobject in m_objects)
            {
                DrawTools.DrawObjectBase obj = drawobject as DrawTools.DrawObjectBase;
                if (obj is IDrawObject && ((IDrawObject)obj).ObjectInRectangle(canvas, unitrect, true) == false)
                {
                    continue;
                }
                bool sel  = obj.Selected;
                bool high = obj.Highlighted;
                obj.Selected = false;
                drawobject.Draw(canvas, unitrect);
                obj.Selected    = sel;
                obj.Highlighted = high;
                cnt++;
            }
        }
Exemplo n.º 5
0
 public virtual void Copy(DrawObjectBase acopy)
 {
     UseLayerColor = acopy.UseLayerColor;
     UseLayerWidth = acopy.UseLayerWidth;
     Width = acopy.Width;
     Color = acopy.Color;
 }