Example #1
0
        public void DeleteColumn(MouseEventArgs e, DashboardRow row, DashboardColumn column, DashboardColumn parrernColumn = null)
        {
            var columnSize = column.Size;

            if (row.Columns.Count == 1)
            {
                if (parrernColumn != null)
                {
                    parrernColumn.InnerRows.Remove(row);
                }
                else
                {
                    Source.Rows.Remove(row);
                }

                return;
            }

            var n          = row.Columns.Find(column);
            var prevColumn = n.Previous;

            row.Columns.Remove(column);

            if (prevColumn == null)
            {
                var firstCol = row.Columns.FirstOrDefault();
                firstCol.Size += columnSize;
                return;
            }

            prevColumn.Value.Size += columnSize;
        }
Example #2
0
        public void CloneInnerRow(MouseEventArgs e, DashboardColumn parentColumn, DashboardRow row)
        {
            var r = Source.Rows.Find(row);
            //TODO add copy implementation !!!

            //Source.Rows.AddAfter(r, r.Value);
        }
Example #3
0
 public void OpenWidgetModal(MouseEventArgs e, DashboardColumn column)
 {
     if (AvailableWidgets != null && AvailableWidgets.Any())
     {
         IsShowModalWidget = true;
         SelectedColumn    = column;
     }
 }
Example #4
0
        public void AddInnerRow(MouseEventArgs e, DashboardRow row, DashboardColumn column)
        {
            var newRow = new DashboardRow();

            newRow.Columns.AddFirst(new DashboardColumn {
                Size = 12
            });

            column.InnerRows.AddLast(newRow);
        }
Example #5
0
        public bool HasNextColumn(DashboardRow row, DashboardColumn column)
        {
            var n          = row.Columns.Find(column);
            var nextColumn = n.Next;

            if (nextColumn == null || nextColumn.Value.Size == 1)
            {
                return(false);
            }

            return(true);
        }
Example #6
0
        public bool HasPreviousColumn(DashboardRow row, DashboardColumn column)
        {
            var n          = row.Columns.Find(column);
            var prevColumn = n.Previous;

            if (prevColumn == null || prevColumn.Value.Size == 1)
            {
                return(false);
            }

            return(true);
        }
Example #7
0
        public void IncreaseSizeRight(MouseEventArgs e, DashboardRow row, DashboardColumn column)
        {
            var n          = row.Columns.Find(column);
            var nextColumn = n.Next;

            if (nextColumn == null || nextColumn.Value.Size == 1)
            {
                return;
            }

            nextColumn.Value.Size--;
            column.Size++;

            column.ShowBetweenCommands = false;
        }
Example #8
0
        public void IncreaseSizeLeft(MouseEventArgs e, DashboardRow row, DashboardColumn column)
        {
            var n          = row.Columns.Find(column);
            var prevColumn = n.Previous;

            if (prevColumn == null || prevColumn.Value.Size == 1)
            {
                return;
            }

            prevColumn.Value.Size--;
            column.Size++;

            column.ShowBetweenCommands = false;
        }
Example #9
0
        public void OnSwapColumns(MouseEventArgs e, DashboardRow row, DashboardColumn column)
        {
            var n          = row.Columns.Find(column);
            var nextColumn = n.Next;

            if (nextColumn == null)
            {
                return;
            }

            row.Columns.Remove(nextColumn);
            row.Columns.AddBefore(n, nextColumn);

            column.ShowBetweenCommands = false;
        }
Example #10
0
        public void SplitColumn(MouseEventArgs e, DashboardRow row, DashboardColumn column)
        {
            var size  = column.Size % 2;
            var sizeF = column.Size / 2;

            column.Size         = sizeF;
            column.ShowCommands = false;
            var newColumn = new DashboardColumn {
                Size = sizeF + size
            };

            var n = row.Columns.Find(column);

            row.Columns.AddAfter(n, newColumn);
        }
Example #11
0
        public void OnSwapInnerRows(MouseEventArgs e, DashboardColumn parentColumn, DashboardRow row)
        {
            if (parentColumn == null || row == null)
            {
                return;
            }

            var r       = parentColumn.InnerRows.Find(row);
            var prevRow = r.Previous;

            if (prevRow == null)
            {
                return;
            }

            parentColumn.InnerRows.Remove(prevRow);
            parentColumn.InnerRows.AddAfter(r, prevRow);
        }
Example #12
0
        // split only first level
        public void InitSplitElementVerical(MouseEventArgs e, DashboardRow row, DashboardColumn column)
        {
            if (column.InnerRows.Count != 0)
            {
                return;
            }

            var row1 = new DashboardRow();

            row1.Columns.AddFirst(new DashboardColumn {
                Size = 12
            });

            var row2 = new DashboardRow();

            row2.Columns.AddFirst(new DashboardColumn {
                Size = 12
            });
            column.InnerRows.AddFirst(row1);
            column.InnerRows.AddFirst(row2);
        }
Example #13
0
        public void OnMouseMoveDraging(MouseEventArgs e, DashboardRow row, DashboardColumn column)
        {
            var x   = e.ClientX;
            var dif = x - _startClientX;

            if (_isStartDraging && (dif > 3 || dif < -3))
            {
                var n          = row.Columns.Find(column);
                var prevColumn = n.Next;

                if (prevColumn == null)
                {
                    return;
                }

                if (dif < -3)
                {
                    if (column.Size == 1 || prevColumn.Value.Size == 12)
                    {
                        return;
                    }

                    prevColumn.Value.Size++;
                    column.Size--;
                }

                if (dif > 3)
                {
                    if (prevColumn.Value.Size == 1 || column.Size == 12)
                    {
                        return;
                    }

                    prevColumn.Value.Size--;
                    column.Size++;
                }

                _isStartDraging = false;
            }
        }
Example #14
0
 public void OpenWidgetProperty(MouseEventArgs e, DashboardColumn column)
 {
     IsShowProperty = true;
     SelectedColumn = column;
 }
Example #15
0
 public void ToggleVisibility(MouseEventArgs e, DashboardColumn column)
 {
     column.Widget.IsVisible = !column.Widget.IsVisible;
 }
Example #16
0
 public void ShowCommands(MouseEventArgs e, DashboardColumn column)
 {
     column.ShowCommands = true;
 }
Example #17
0
 public void CleanWidget(MouseEventArgs e, DashboardColumn column)
 {
     column.Widget = null;
 }
Example #18
0
 public void HideCommands(MouseEventArgs e, DashboardColumn column)
 {
     column.ShowCommands = false;
 }