/// <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);
        }
示例#2
0
        internal void AddColumn(CanvasColumn column)
        {
            if (column == null)
            {
                throw new ArgumentNullException("Passed column cannot be null");
            }

            this.columns.Add(column);
        }
        /// <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);
        }
        /// <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);
        }
        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;
            }
        }
示例#6
0
        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);
        }
 /// <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;
 }
 /// <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;
 }
 /// <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;
 }
示例#10
0
 internal void MoveTo(CanvasSection newSection, CanvasColumn newColumn)
 {
     this.section = newSection;
     this.column  = newColumn;
 }