-
Notifications
You must be signed in to change notification settings - Fork 134
/
IGrid.cs
179 lines (145 loc) · 4.66 KB
/
IGrid.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
using GridShared.Grouping;
using GridShared.Pagination;
using GridShared.Style;
using GridShared.Utility;
using Microsoft.Extensions.Primitives;
using System;
using System.Collections.Generic;
using System.Reflection;
namespace GridShared
{
public interface IGrid<T> : IGrid
{
IColumnGroup<T> GetGroup(string columnName);
IList<object> GetGroupValues(IColumnGroup<T> group, IEnumerable<object> items);
}
/// <summary>
/// Grid.Mvc interface
/// </summary>
public interface IGrid
{
/// <summary>
/// Query for the grid
/// </summary>
QueryDictionary<StringValues> Query { get; set; }
/// <summary>
/// Grid columns
/// </summary>
IGridColumnCollection Columns { get; }
/// <summary>
/// Grid items
/// </summary>
IEnumerable<object> ItemsToDisplay { get; }
/// <summary>
/// Displaying grid items count
/// </summary>
int DisplayingItemsCount { get; }
/// <summary>
/// Enable paging view
/// </summary>
[Obsolete("This property is obsolete. Use PagingType property", true)]
bool EnablePaging { get; set; }
/// <summary>
/// Enable paging type
/// </summary>
PagingType PagingType { get; set; }
/// <summary>
/// Set or get options for searching
/// </summary>
SearchOptions SearchOptions { get; set; }
/// <summary>
/// Set or get default value of extended sorting
/// </summary>
bool ExtSortingEnabled { get; set; }
/// <summary>
/// Hide extended sorting / grouping header
/// </summary>
bool HiddenExtSortingHeader { get; set; }
/// <summary>
/// Set or get default value of grouping
/// </summary>
bool GroupingEnabled { get; set; }
/// <summary>
/// Enable Sync button
/// </summary>
bool SyncButtonEnabled { get; set; }
/// <summary>
/// Set or get visibility of ClearFiltersButton
/// </summary>
bool ClearFiltersButtonEnabled { get; set; }
/// <summary>
/// Text in empty grid (no items for display)
/// </summary>
string EmptyGridText { get; set; }
/// <summary>
/// Returns the current Grid language
/// </summary>
string Language { get; set; }
/// <summary>
/// Object that sanitize grid column values from dangerous content
/// </summary>
ISanitizer Sanitizer { get; }
/// <summary>
/// Grid mode
/// </summary>
GridMode Mode { get; }
/// <summary>
/// Get value for creating items
/// </summary>
bool CreateEnabled { get; }
/// <summary>
/// Get value for reading items
/// </summary>
bool ReadEnabled { get; }
/// <summary>
/// Get value for updating items
/// </summary>
bool UpdateEnabled { get; }
/// <summary>
/// Get value for deleting items
/// </summary>
bool DeleteEnabled { get; }
/// <summary>
/// Get value for table layout
/// </summary>
TableLayout TableLayout { get; set; }
/// <summary>
/// Get value for table width
/// </summary>
string Width { get; set; }
/// <summary>
/// Get value for table height
/// </summary>
string Height { get; set; }
/// <summary>
/// Database function to remove diacritics
/// </summary>
MethodInfo RemoveDiacritics { get; set; }
/// <summary>
/// Get all css classes mapped to the item
/// </summary>
string GetRowCssClasses(object item);
/// <summary>
/// Get grid state
/// </summary>
string GetState();
/// <summary>
/// Grid direction
/// </summary>
GridDirection Direction { get; set; }
/// <summary>
/// Grid items to display
/// </summary>
IEnumerable<object> GetItemsToDisplay(IList<Tuple<string, object>> values, IEnumerable<object> items);
int ItemsCount { get; }
//void OnPreRender(); //TODO backward Compatibility
/// <summary>
/// CSS Framework
/// </summary>
CssFramework CssFramework { get; set; }
/// <summary>
/// Html classes
/// </summary>
HtmlClass HtmlClass { get; set; }
}
}