-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathSheetTemplate.cs
74 lines (63 loc) · 2.04 KB
/
SheetTemplate.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
/* Copyright (C) 2023-2024 b1f6c1c4
*
* This file is part of ProfessionalAccounting.
*
* ProfessionalAccounting is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, version 3.
*
* ProfessionalAccounting is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
* for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with ProfessionalAccounting. If not, see
* <https://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Xml.Serialization;
using AccountingServer.Entities;
namespace AccountingServer.Shell.Plugins.SpreadSheet;
[Serializable]
[XmlRoot("Templates")]
public class SheetTemplates
{
[XmlElement("Template")] public List<SheetTemplate> Templates;
}
[Serializable]
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public class SheetTemplate
{
[XmlAttribute("name")]
public string Name { get; set; }
[XmlAttribute("desc")]
public string Description { get; set; }
[XmlElement("Column")]
public List<SheetColumn> Columns { get; set; }
}
[Serializable]
[Flags]
public enum SheetColumnKind
{
[XmlEnum(Name = "simple")] None = 0b0000_0000,
[XmlEnum(Name = "aux")] Auxiliary = 0b1000_0000,
[XmlEnum(Name = "cmplx")] Complex = 0b1100_0000,
[XmlEnum(Name = "content")] Content = 0b1100_0011,
[XmlEnum(Name = "title")] Title = 0b1100_0001,
}
[Serializable]
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public class SheetColumn
{
[XmlAttribute("name")]
public string Name { get; set; }
[XmlAttribute("type")]
public SheetColumnKind Kind { get; set; }
[XmlAttribute("complex")]
public bool IsComplex { get; set; }
[XmlText]
public string Query { get; set; }
}