Ejemplo n.º 1
0
        /// <summary>
        /// Add a new RectItem and separate with a dotted line in drawing.
        /// </summary>
        /// <param name="sender"></param>
        public void AddElement(RectItem sender)
        {
            //if it is a first RectItem then have to create 2
            //otherwise just create additional 1
            int counter = 0;
            //foreach (ShapeItem item in this.elementsField)
            for (int i = this.elementsField.Count - 1; i >= 0; i--)
            {
                if (this.elementsField[i] is RectItem) counter++;
                //if (this.elementsField[i] is LabelShape)
                //    this.elementsField.RemoveAt(i);
            }

            if (counter == 0)
            {
                this.elementsField.Add(new RectItem(this.materialField));
                this.elementsField.Add(new LabelShape());
                counter++;
            }

            if (this.modelField == "RectItem00")
                this.elementsField.Add(new VerticalLine());
            else
                this.elementsField.Add(new HorizontalLine());
            this.elementsField.Add(sender);
            this.elementsField.Add(new LabelShape());
            counter++;

            SetSpacing(counter);
            //AddLabel(counter);
        }
Ejemplo n.º 2
0
 public void AddVerticalElement(RectItem sender)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 3
0
 public void AddHorizontalElement(RectItem sender)
 {
     throw new NotImplementedException();
 }