Пример #1
0
        public LayoutFilter Add(LayoutColumn column, object value = null)
        {
            var filter = new LayoutFilter(column)
            {
                Comparer = CompareType.Equal,
                Value    = value
            };

            if (column.DataType == typeof(string) ||
                column.DataType == typeof(object))
            {
                filter.Comparer = CompareType.Like;
            }
            else if (column.DataType == typeof(DateTime))
            {
                filter.Comparer = CompareType.Between;
            }

            if (Filters.GetByName(column.Name) != null)
            {
                filter.Logic = LogicType.Or;
            }
            Filters.Add(filter);
            OnCellEditBegin(filter, valueColumn);
            return(filter);
        }
Пример #2
0
 public LayoutListInfo()
 {
     columns = new LayoutColumn(this)
     {
         StyleName = "List"
     };
     sorters = new LayoutSortList(this);
 }
Пример #3
0
        public LayoutFilterView(LayoutList list)
        {
            styleClose       = GuiEnvironment.Theme["Close"];
            AutoSize         = true;
            AllowCellSize    = true;
            AllowFilter      = false;
            AllowSort        = false;
            EditMode         = EditModes.ByClick;
            GenerateColumns  = false;
            GenerateToString = false;

            valueColumn = new LayoutColumn {
                Name = nameof(LayoutFilter.Value), Width = 150, Invoker = valueInvoker
            };



            ListInfo = new LayoutListInfo(
                new LayoutColumn {
                Name = nameof(LayoutFilter.Logic), Width = 50, Invoker = logicInvoker
            },
                new LayoutColumn {
                Name = nameof(LayoutFilter.Header), Editable = false, Invoker = headerInvoker
            },
                new LayoutColumn {
                Name = nameof(LayoutFilter.Comparer), Width = 50, Invoker = comparerInvoker
            },
                valueColumn)
            {
                Indent         = 9,
                HeaderWidth    = 22,
                ColumnsVisible = false,
                GridMode       = true,
                GridAuto       = true,
                StyleRowName   = "Row"
                                 //StyleRow = new CellStyle()
                                 //{
                                 //    Alternate = false,
                                 //    Round = 6,
                                 //    BackBrush = new CellStyleBrush()
                                 //    {
                                 //        Color = Colors.White,
                                 //        ColorSelect = Colors.White,
                                 //        ColorHover = Colors.White
                                 //    },
                                 //    BorderBrush = new CellStyleBrush()
                                 //    {
                                 //        Color = Colors.Gray,
                                 //        ColorSelect = Colors.Gray,
                                 //        ColorHover = Colors.Gray
                                 //    }
                                 //}
            };
            ListSource = new LayoutFilterList(list);
            Filters.CollectionChanged   += (sender, e) => { List.OnFilterChange(); };
            Filters.ItemPropertyChanged += (sender, e) => { List.OnFilterChange(); };
        }
Пример #4
0
        public void Remove(LayoutColumn column)
        {
            var toremove = Filters.Select((nameof(LayoutFilter)), CompareType.Equal, column.Name).ToList();

            foreach (var item in toremove)
            {
                Filters.RemoveInternal(item, Filters.IndexOf(item));
            }
            Filters.OnListChanged(NotifyCollectionChangedAction.Reset);
        }
Пример #5
0
        public NotifyWindow()
            : base()
        {
            LayoutColumn module = new LayoutColumn()
            {
                Name      = "Module",
                FillWidth = true,
                Column    = 2,
                Height    = 25,
                StyleName = "Notify"
            };

            var notifyInfo = new LayoutListInfo();

            notifyInfo.Columns.Add("Icon", 25);
            notifyInfo.Columns.Add(module);
            notifyInfo.Columns.Add("Date", 50, 0, 3).Format = "hh:mm";
            notifyInfo.Columns.Add("Message", 100, 1, 0);
            notifyInfo.Columns.Add("Description", 100, 2, 0);
            notifyInfo.ColumnsVisible  = false;
            notifyInfo.HeaderVisible   = false;
            notifyInfo.HotTrackingCell = true;
            notifyInfo.CalcHeigh       = false;
            notifyInfo.Indent          = 5;

            notifies.ApplySort(new InvokerComparer(typeof(StateInfo), "Date", ListSortDirection.Descending));

            notifyList.Text             = "Notify";
            notifyList.GenerateColumns  = false;
            notifyList.GenerateToString = false;
            notifyList.ListInfo         = notifyInfo;
            notifyList.ListSource       = notifies;
            notifyList.CellDoubleClick += NotifyPListCellClick;

            //dock.PagesAlign = LayoutAlignType.Bottom;
            //dock.Add(notifyList);
            //dock.Add(taskList);

            this.Label.Text          = "Notify";
            this.HeaderVisible       = false;
            this.Mode                = ToolShowMode.ToolTip;
            this.Target              = notifyList;
            this.Width               = 400;
            this.Height              = 250;
            this.ButtonClose.Visible = false;
            this.TimerInterval       = 4000;
            //notifyWondow.Opacity = 0.5D;
            //this.MaximumSize = new Size(400, Screen.PrimaryScreen.WorkingArea.Height - 50);
        }
Пример #6
0
 public CalendarList()
 {
     GenerateColumns  = false;
     GenerateToString = false;
     ListInfo         = new LayoutListInfo(numberColumn = new LayoutColumn()
     {
         Name = "Number", Width = 50, Height = 50, StyleName = "Calendar"
     })
     {
         Indent       = 4,
         StyleRowName = "Node",
         GridCol      = 7,
         //ColumnsVisible = false,
         HeaderVisible = false
     };
 }
Пример #7
0
 public LayoutFilter(LayoutColumn column)
 {
     Column = column;
 }
Пример #8
0
 public LayoutSelectionRow(object item, int index, LayoutColumn column = null)
 {
     Item   = item;
     Index  = index;
     Column = column;
 }