Beispiel #1
0
        /// <summary>
        /// Moves the control to another section and column in the given position
        /// </summary>
        /// <param name="newColumn">New column that will host the control</param>
        /// <param name="position">New position for the control in the new column</param>
        public void MovePosition(CanvasColumn newColumn, int position)
        {
            var currentColumn = this.Column;

            MovePosition(newColumn);
            ReindexColumn(currentColumn);
            MovePosition(position);
        }
        internal void AddColumn(CanvasColumn column)
        {
            if (column == null)
            {
                throw new ArgumentNullException("Passed column cannot be null");
            }

            this.columns.Add(column);
        }
Beispiel #3
0
        /// <summary>
        /// Moves the control to another section and column while keeping it's current position
        /// </summary>
        /// <param name="newColumn">New column that will host the control</param>
        public void MovePosition(CanvasColumn newColumn)
        {
            var currentColumn = this.Column;

            this.section = newColumn.Section;
            this.column  = newColumn;
            ReindexColumn(currentColumn);
            ReindexColumn(this.Column);
        }
Beispiel #4
0
        /// <summary>
        /// Moves the control to another section and column while keeping it's current position
        /// </summary>
        /// <param name="newSection">New section that will host the control</param>
        public void MovePosition(CanvasSection newSection)
        {
            var currentSection = this.Section;

            this.section = newSection;
            this.column  = newSection.DefaultColumn;
            ReindexSection(currentSection);
            ReindexSection(this.Section);
        }
Beispiel #5
0
        private void ReindexColumn(CanvasColumn column)
        {
            var index = 0;

            foreach (var control in this.column.Section.Page.Controls.Where(c => c.Section == column.Section && c.Column == column).OrderBy(c => c.Order))
            {
                index++;
                control.order = index;
            }
        }
        internal void MergeVerticalSectionColumn(CanvasColumn column)
        {
            // What was the highest order
            int order      = 1;
            var lastColumn = this.columns.OrderBy(p => p.Order).FirstOrDefault();

            if (lastColumn != null)
            {
                order = lastColumn.Order + 1;
            }

            // Add the column to this section, first ensure it's connected to the new section and it's order has been updated for insertion in the new section
            column.MoveTo(this);
            column.Order = order;

            this.AddColumn(column);
        }
Beispiel #7
0
 internal void MoveTo(CanvasSection newSection, CanvasColumn newColumn)
 {
     this.section = newSection;
     this.column  = newColumn;
 }
Beispiel #8
0
 /// <summary>
 /// Moves the control to another section and column
 /// </summary>
 /// <param name="newColumn">New column that will host the control</param>
 /// <param name="order">New order for the control in the new column</param>
 public void Move(CanvasColumn newColumn, int order)
 {
     Move(newColumn);
     this.order = order;
 }
Beispiel #9
0
 /// <summary>
 /// Moves the control to another section and column
 /// </summary>
 /// <param name="newColumn">New column that will host the control</param>
 public void Move(CanvasColumn newColumn)
 {
     this.section = newColumn.Section;
     this.column  = newColumn;
 }
Beispiel #10
0
 /// <summary>
 /// Moves the control to another section and column
 /// </summary>
 /// <param name="newSection">New section that will host the control</param>
 public void Move(CanvasSection newSection)
 {
     this.section = newSection;
     this.column  = newSection.DefaultColumn;
 }