Last change
on this file since 17473 was
17473,
checked in by dpiringe, 4 years ago
|
#3026:
- refactored inheritance structure of json items, now the default JsonItem is an abstract class without properties Value and Range -> splitted up into new interfaces
- updated view models for new json item structure
- updated SingleLineArrayJsonWriter
|
File size:
1.2 KB
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Threading.Tasks;
|
---|
6 | using Newtonsoft.Json.Linq;
|
---|
7 |
|
---|
8 | namespace HeuristicLab.JsonInterface {
|
---|
9 | public abstract class MatrixJsonItem<T> : ValueJsonItem<T[][]>, IMatrixJsonItem {
|
---|
10 | public virtual bool RowsResizable { get; set; }
|
---|
11 | public virtual bool ColumnsResizable { get; set; }
|
---|
12 |
|
---|
13 | IList<string> rows = new List<string>();
|
---|
14 | public IEnumerable<string> RowNames {
|
---|
15 | get => rows;
|
---|
16 | set => rows = new List<string>(value);
|
---|
17 | }
|
---|
18 |
|
---|
19 | IList<string> cols = new List<string>();
|
---|
20 | public IEnumerable<string> ColumnNames {
|
---|
21 | get => cols;
|
---|
22 | set => cols = new List<string>(value);
|
---|
23 | }
|
---|
24 |
|
---|
25 | public override void SetFromJObject(JObject jObject) {
|
---|
26 | base.SetFromJObject(jObject);
|
---|
27 | RowsResizable = (jObject[nameof(IMatrixJsonItem.RowsResizable)]?.ToObject<bool>()).GetValueOrDefault();
|
---|
28 | ColumnsResizable = (jObject[nameof(IMatrixJsonItem.ColumnsResizable)]?.ToObject<bool>()).GetValueOrDefault();
|
---|
29 | RowNames = jObject[nameof(IMatrixJsonItem.RowNames)]?.ToObject<IEnumerable<string>>();
|
---|
30 | ColumnNames = jObject[nameof(IMatrixJsonItem.ColumnNames)]?.ToObject<IEnumerable<string>>();
|
---|
31 | }
|
---|
32 | }
|
---|
33 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.