Exemple #1
0
        private void AddSide()
        {
            var side = new Segment();

            side.Drawing = Drawing;
            var index = sides.Count;

            if (index > 2)
            {
                sides[index - 1].Dependencies[1] = vertices[index - 1];
            }
            if (index == 0)
            {
                side.Dependencies = new[] { this.Dependencies[1], vertices[0] };
            }
            else if (index == NumberOfSides - 1)
            {
                side.Dependencies = new[] { vertices[NumberOfSides - 2], this.Dependencies[1] };
            }
            else
            {
                side.Dependencies = new[] { vertices[index - 1], vertices[index] };
            }
            sides.Add(side);
            Children.Add(side);
            if (Drawing != null)
            {
                side.OnAddingToCanvas(Drawing.Canvas);
            }
        }
Exemple #2
0
        protected override void AddSide(int sideCount)
        {
            var side = new Segment();

            side.Drawing = Drawing;
            var index         = sides.Count;
            var NumberOfSides = sideCount;

            if (index > 2)
            {
                var firstSide = sides[index - 1];
                firstSide.UnregisterFromDependencies();
                firstSide.Dependencies[1] = vertices[index - 1];
                firstSide.RegisterWithDependencies();
            }

            if (index == 0)
            {
                side.Dependencies = new[] { this.Dependencies[1], vertices[0] };
            }
            else if (index == NumberOfSides - 1)
            {
                side.Dependencies = new[] { vertices[NumberOfSides - 2], this.Dependencies[1] };
            }
            else
            {
                side.Dependencies = new[] { vertices[index - 1], vertices[index] };
            }

            sides.Add(side);
            Children.Add(side);
            if (Drawing != null)
            {
                side.OnAddingToCanvas(Drawing.Canvas);
            }

            side.RegisterWithDependencies();
        }
Exemple #3
0
 private void AddSide()
 {
     var side = new Segment();
     side.Drawing = Drawing;
     var index = sides.Count;
     if (index > 2)
     {
         sides[index - 1].Dependencies[1] = vertices[index - 1];
     }
     if (index == 0)
     {
         side.Dependencies = new[] { this.Dependencies[1], vertices[0] };
     }
     else if (index == NumberOfSides - 1)
     {
         side.Dependencies = new[] { vertices[NumberOfSides - 2], this.Dependencies[1] };
     }
     else
     {
         side.Dependencies = new[] { vertices[index - 1], vertices[index] };
     }
     sides.Add(side);
     Children.Add(side);
     if (Drawing != null)
     {
         side.OnAddingToCanvas(Drawing.Canvas);
     }
 }