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

Simple case: Enum based column. Possible values are given in the StandardItems, custom editor is not used. More...

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

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]
 If this is not null, it declares column header menu entries that can be used for "Autofill" like features.
 
- Properties inherited from AxelSemrau.Chronos.Plugin.Columns.IColumnTypeDefinition

Private Member Functions

void CycleThrough (IReadOnlyList< ICellAccessor > cells)
 
void FillDown (IReadOnlyList< ICellAccessor > cells)
 Fill all given cells with the value of the top row.
 

Detailed Description

Simple case: Enum based column. Possible values are given in the StandardItems, custom editor is not used.

Definition at line 17 of file CreamTypeColumn.cs.

Member Function Documentation

◆ CycleThrough()

void MockPlugin.SampleListColumns.CreamTypeColumn.CycleThrough ( IReadOnlyList< ICellAccessor > cells)
private

Definition at line 35 of file CreamTypeColumn.cs.

36 {
37 if (cells.Count >= 2)
38 {
39 var allValues = Enum.GetValues(typeof(BrewFrappuccino.CreamType)).Cast<BrewFrappuccino.CreamType>().ToArray();
40 var currVal = (BrewFrappuccino.CreamType) cells[0].Value;
41 foreach (var someCell in cells.Skip(1))
42 {
43 var validItems = someCell.Column.StandardItems;
44 var roundtrips = 0;
45 do
46 {
47 if (currVal == allValues.Last())
48 {
49 currVal = allValues.First();
50 roundtrips += 1;
51 }
52 else
53 {
54 currVal += 1;
55 }
56 } while (roundtrips < 2 && (validItems?.Count ?? 0) > 0 && !validItems.Contains(currVal.ToString()));
57 someCell.Value = currVal;
58 }
59 }
60 }
A task working on a complex parameter set.
CreamType
Enum properties result in nice drop-down lists.

◆ FillDown()

void MockPlugin.SampleListColumns.CreamTypeColumn.FillDown ( IReadOnlyList< ICellAccessor > cells)
private

Fill all given cells with the value of the top row.

Parameters
cells

Definition at line 66 of file CreamTypeColumn.cs.

67 {
68 if (cells.Count >= 2)
69 {
70 var topVal = cells[0].Value;
71 foreach (var someCell in cells.Skip(1))
72 {
73 someCell.Value = topVal;
74 }
75 }
76 }

Property Documentation

◆ ColumnHeaderMenu

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

If this is not null, it declares column header menu entries that can be used for "Autofill" like features.

Implements AxelSemrau.Chronos.Plugin.Columns.IColumnTypeDefinition.

Definition at line 26 of file CreamTypeColumn.cs.

27 {
28 get
29 {
30 yield return new ColumnHeaderMenu(() => LocalizeMockPlugin.CreamTypeColumn_ColumnHeaderMenu_Fill_down, FillDown);
31 yield return new ColumnHeaderMenu(() => LocalizeMockPlugin.CreamTypeColumn_ColumnHeaderMenu_Cycle_through, CycleThrough);
32 }
33 }
void CycleThrough(IReadOnlyList< ICellAccessor > cells)
void FillDown(IReadOnlyList< ICellAccessor > cells)
Fill all given cells with the value of the top row.
IEnumerable< IColumnMenu > ColumnHeaderMenu
If this is not null, it declares column header menu entries that can be used for "Autofill" like feat...

◆ ComboboxItems

IEnumerable<object> MockPlugin.SampleListColumns.CreamTypeColumn.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 22 of file CreamTypeColumn.cs.

◆ InternalName

string MockPlugin.SampleListColumns.CreamTypeColumn.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 19 of file CreamTypeColumn.cs.

◆ ValueType

Type MockPlugin.SampleListColumns.CreamTypeColumn.ValueType
get

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

Implements AxelSemrau.Chronos.Plugin.Columns.IColumnTypeDefinition.

Definition at line 24 of file CreamTypeColumn.cs.

◆ VisibleName

string MockPlugin.SampleListColumns.CreamTypeColumn.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 20 of file CreamTypeColumn.cs.


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