Chronos Plugins 5.9.0
This documentation covers the plugin interfaces definitions and an example implementation.
Loading...
Searching...
No Matches
MockPlugin.SampleListColumns.DateColumn Class Reference

Example column type that allows to pick a date and time from a graphical editor. More...

+ Inheritance diagram for MockPlugin.SampleListColumns.DateColumn:
+ Collaboration diagram for MockPlugin.SampleListColumns.DateColumn:

Properties

string InternalName [get]
 Nametag that will be used internally for storing a column of this type in the method. Do not change this once released, or the methods using this column type will no longer be usable.
 
string VisibleName [get]
 Column type name that will be presented to the user in the method editor in the "Cell Type" column. Should be localizable.
 
IEnumerable< object > ComboboxItems [get]
 List of possible values that can be presented to the user in a drop-down list.
 
Type ValueType [get]
 Used for getting information which UITypeEditor, TypeConverter etc to use for your column.
 
IEnumerable< IColumnMenuColumnHeaderMenu [get]
 Provide some column header menus for increasing the date in typically used steps.
 
- Properties inherited from AxelSemrau.Chronos.Plugin.Columns.IColumnTypeDefinition

Private Member Functions

void IncreaseBy (IReadOnlyList< ICellAccessor > cells, Func< DateTime, DateTime > adder)
 

Detailed Description

Example column type that allows to pick a date and time from a graphical editor.

You can check with the coffee

Definition at line 21 of file DateColumn.cs.

Member Function Documentation

◆ IncreaseBy()

void MockPlugin.SampleListColumns.DateColumn.IncreaseBy ( IReadOnlyList< ICellAccessor > cells,
Func< DateTime, DateTime > adder )
private

Definition at line 43 of file DateColumn.cs.

44 {
45 if (cells.Count >= 2)
46 {
47 var currVal = (MyDate) cells[0].Value;
48 foreach (var someCell in cells.Skip(1))
49 {
50 currVal = new MyDate(adder(currVal.DateTime));
51 someCell.Value = currVal;
52 }
53 }
54 }

Property Documentation

◆ ColumnHeaderMenu

IEnumerable<IColumnMenu> MockPlugin.SampleListColumns.DateColumn.ColumnHeaderMenu
get

Provide some column header menus for increasing the date in typically used steps.

Implements AxelSemrau.Chronos.Plugin.Columns.IColumnTypeDefinition.

Definition at line 32 of file DateColumn.cs.

33 {
34 get
35 {
36 yield return new ColumnHeaderMenu(() => LocalizeMockPlugin.DateColumn_ColumnHeaderMenu_Fill_down, cells => IncreaseBy(cells, dt => dt));
37 yield return new ColumnHeaderMenu(() => LocalizeMockPlugin.DateColumn_ColumnHeaderMenu_Daily, cells => IncreaseBy(cells, dt => dt.Add(TimeSpan.FromDays(1))));
38 yield return new ColumnHeaderMenu(() => LocalizeMockPlugin.DateColumn_ColumnHeaderMenu_Weekly, cells => IncreaseBy(cells,dt => dt.Add(TimeSpan.FromDays(7))));
39 yield return new ColumnHeaderMenu(() => LocalizeMockPlugin.DateColumn_ColumnHeaderMenu_Monthly, cells => IncreaseBy(cells, dt => dt.AddMonths(1)));
40 }
41 }
void IncreaseBy(IReadOnlyList< ICellAccessor > cells, Func< DateTime, DateTime > adder)
Definition DateColumn.cs:43
IEnumerable< IColumnMenu > ColumnHeaderMenu
Provide some column header menus for increasing the date in typically used steps.
Definition DateColumn.cs:33

◆ ComboboxItems

IEnumerable<object> MockPlugin.SampleListColumns.DateColumn.ComboboxItems
get

List of possible values that can be presented to the user in a drop-down list.

As stated in the class documentation: Make sure ToString() returns values that can be converted back to your object type. If you don't want to restrict the user to a given value list, use the [Editable(true)] attribute.

Implements AxelSemrau.Chronos.Plugin.Columns.IColumnTypeDefinition.

Definition at line 26 of file DateColumn.cs.

◆ InternalName

string MockPlugin.SampleListColumns.DateColumn.InternalName
get

Nametag that will be used internally for storing a column of this type in the method. Do not change this once released, or the methods using this column type will no longer be usable.

Implements AxelSemrau.Chronos.Plugin.Columns.IColumnTypeDefinition.

Definition at line 24 of file DateColumn.cs.

◆ ValueType

Type MockPlugin.SampleListColumns.DateColumn.ValueType
get

Used for getting information which UITypeEditor, TypeConverter etc to use for your column.

Implements AxelSemrau.Chronos.Plugin.Columns.IColumnTypeDefinition.

Definition at line 27 of file DateColumn.cs.

◆ VisibleName

string MockPlugin.SampleListColumns.DateColumn.VisibleName
get

Column type name that will be presented to the user in the method editor in the "Cell Type" column. Should be localizable.

Implements AxelSemrau.Chronos.Plugin.Columns.IColumnTypeDefinition.

Definition at line 25 of file DateColumn.cs.


The documentation for this class was generated from the following file: