Example #1
0
        /// <summary>
        /// Überprüft ob eine Linie erstellt oder gelöscht werden muss.
        /// ----
        /// User Story hat Epic & Linie existiert => nichts tun
        /// User Story hat Epic & Linie existiert nicht => Linie erstellen
        /// ----
        /// User Story hat keine Epic & Linie existiert => Linie löschen
        /// User Story hat Epic & Linie existiert nicht => nichts tun
        /// </summary>
        public virtual void CheckLine()
        {
            if (UserStory.Epic != null)
            {
                EpicControl ec = null;
                if (UserStory.Epic.Representations.Count > 0)
                {
                    ec = UserStory.Epic.Representations[0] as EpicControl;
                }

                if (Line == null)
                {
                    if (ec != null && !ec.IsHidden)
                    {
                        CreateLine(ec);
                    }
                }
                else
                {
                    if (ec == null || ec.IsHidden)
                    {
                        RemoveLine();
                    }
                }
            }
            else
            {
                if (Line != null)
                {
                    RemoveLine();
                }
            }
        }
Example #2
0
        /// <summary>
        /// Entfernt oder löscht die Linie, je nachdem, ob die zu dieser User Story gehörende Epic
        /// Sichtbar ist.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ec_IsHiddenChanged(object sender, EventArgs e)
        {
            EpicControl ec = ((sender) as EpicControl);

            if (ec != null)
            {
                if (ec.IsHidden && Line != null)
                {
                    RemoveLine();
                }
                else
                {
                    CreateLine(ec);
                }
            }
        }
Example #3
0
        /// <summary>
        /// Platziert die User Story automatisch in die nähere Umgebung der EpicControl (falls der User Story eine Epic zugewiesen wurde)
        /// </summary>
        public override void AutoPos()
        {
            if (this.UserStory.Epic == null)
            {
                base.AutoPos();
            }
            else
            {
                if (this.UserStory.Epic.Representations.Count > 0)
                {
                    EpicControl epic = (EpicControl)this.UserStory.Epic.Representations.First();
                    if (epic.IsLoaded)
                    {
                        epic.Loaded -= AutoPos;

                        this.Scale(UserStoryControl.StaticDefaultSettings.Scale, true);
                        double w = UserStoryControl.StaticDefaultSettings.Scale * UserStoryControl.StdWidth;
                        double h = UserStoryControl.StaticDefaultSettings.Scale * UserStoryControl.StdHeight;
                        double r = Math.Sqrt(w * w + h * h) / 2;

                        Point  pt  = MathHelper.GetPointOnCircle(epic.Center, epic.ScaledWidth / 2);
                        Vector vec = new Vector(pt.X - epic.CenterX, pt.Y - epic.CenterY);
                        pt = vec.MovePoint(pt, 3 * r / 2);
                        this.MoveCenter(pt.X, pt.Y, true);
                    }
                    else
                    {
                        epic.Loaded += AutoPos;
                    }
                }
                else
                {
                    base.AutoPos();
                }
            }
        }
Example #4
0
 /// <summary>
 /// Erstellt eine Linie zu der angegebenen EpicControl
 /// </summary>
 /// <param name="ec"></param>
 private void CreateLine(EpicControl ec)
 {
     ec.IsHiddenChanged += ec_IsHiddenChanged;
     Line = new ConnectionLine(this, ec);
 }