コード例 #1
0
        public UseCaseDiagramDocument(UseCaseDiagramDocument obj)
        {
            List <IDrawable> elem = new List <IDrawable>();

            foreach (IDrawable o in obj.Elements)
            {
                if (o is UMLElipse)
                {
                    UMLElipse elipse    = o as UMLElipse;
                    UMLElipse newObject = new UMLElipse(elipse);
                    elem.Add(newObject);
                }
                else if (o is Line)
                {
                    Line line      = o as Line;
                    Line newObject = new Line(line);
                    elem.Add(newObject);
                }
                else if (o is Actor)
                {
                    Actor actor     = o as Actor;
                    Actor newObject = new Actor(actor);
                    elem.Add(newObject);
                }
            }
            Elements = elem;
        }
コード例 #2
0
        private void copy()
        {
            bool newListMade = false;

            foreach (IDrawable obj in Elements.Elements)
            {
                if (obj.Selected)
                {
                    if (!newListMade)
                    {
                        copyList    = new List <IDrawable>();
                        newListMade = true;
                    }
                    if (obj is UMLElipse)
                    {
                        UMLElipse el = obj as UMLElipse;
                        UMLElipse o  = new UMLElipse(el);
                        copyList.Add(o);
                    }
                    else if (obj is Line)
                    {
                        Line l = obj as Line;
                        Line o = new Line(l);
                        copyList.Add(o);
                    }
                    else
                    {
                        Actor a = obj as Actor;
                        Actor o = new Actor(a);
                        copyList.Add(o);
                    }
                    obj.Selected = false;
                }
            }
        }
コード例 #3
0
ファイル: UMLElipse.cs プロジェクト: stefankochev/DrawU
 public UMLElipse(UMLElipse o)
 {
     X           = o.X;
     Y           = o.Y;
     Width       = o.Width;
     Height      = o.Height;
     BorderColor = o.BorderColor;
     FillColor   = o.FillColor;
     Text        = o.Text;
     TextColor   = o.TextColor;
     TextSize    = o.TextSize;
     BorderWidth = o.BorderWidth;
 }
コード例 #4
0
ファイル: UMLElipse.cs プロジェクト: stefankochev/DrawU
        public override bool Equals(object obj)
        {
            if (!(obj is UMLElipse))
            {
                return(false);
            }
            UMLElipse e = obj as UMLElipse;

            if (X != e.X)
            {
                return(false);
            }
            if (Y != e.Y)
            {
                return(false);
            }
            if (Width != e.Width)
            {
                return(false);
            }
            if (Height != e.Height)
            {
                return(false);
            }
            if (BorderColor != e.BorderColor)
            {
                return(false);
            }
            if (FillColor != e.FillColor)
            {
                return(false);
            }
            if (Text != e.Text)
            {
                return(false);
            }
            if (TextColor != e.TextColor)
            {
                return(false);
            }
            if (TextSize != e.TextSize)
            {
                return(false);
            }
            if (BorderWidth != e.BorderWidth)
            {
                return(false);
            }
            return(true);
        }