Skip to content

Commit 4e84bbf

Browse files
committed
create attribute strings
1 parent fc643e2 commit 4e84bbf

2 files changed

Lines changed: 29 additions & 18 deletions

File tree

gen/DocumentFormat.OpenXml.Generator.Models/Generators/Elements/DataModelWriterExtensions.cs

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ namespace DocumentFormat.OpenXml.Generator.Generators.Elements;
1111

1212
public static class DataModelWriterExtensions
1313
{
14+
public static class AttributeStrings
15+
{
16+
public const string ObsoletePropertyWarn = "[Obsolete(\"Unused property, will be removed in a future version.\", false)]";
17+
public const string ObsoletePropertyError = "[Obsolete(\"Unused property, will be removed in a future version.\", true)]";
18+
public const string ObsoleteAttributeWarn = "[Obsolete(\"Unused attribute, will be removed in a future version.\", false)]";
19+
public const string ObsoleteAttributeError = "[Obsolete(\"Unused attribute, will be removed in a future version.\", true)]";
20+
public const string EditorBrowsableAlways = "[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Always)] ";
21+
public const string EditorBrowsableAdvanced = "[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)] ";
22+
public const string EditorBrowsableNever = "[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] ";
23+
}
24+
1425
// Use this dictionary to add attributes like ObsoleteAttribute or other directives to classes, child elements or attributes.
1526
private static readonly Dictionary<string, Dictionary<string, List<string>>> _attributeData =
1627
new Dictionary<string, Dictionary<string, List<string>>>()
@@ -63,8 +74,8 @@ public static class DataModelWriterExtensions
6374
"c:CT_PictureOptions/c:pictureOptions",
6475
new List<string>()
6576
{
66-
"[Obsolete(\"Unused property, will be removed in the next major version.\", false)]",
67-
"[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] ",
77+
AttributeStrings.ObsoletePropertyWarn,
78+
AttributeStrings.EditorBrowsableNever,
6879
}
6980
},
7081
}
@@ -77,8 +88,8 @@ public static class DataModelWriterExtensions
7788
"c:CT_PictureOptions/c:pictureOptions",
7889
new List<string>()
7990
{
80-
"[Obsolete(\"Unused property, will be removed in the next major version.\", false)]",
81-
"[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] ",
91+
AttributeStrings.ObsoletePropertyWarn,
92+
AttributeStrings.EditorBrowsableNever,
8293
}
8394
},
8495
}
@@ -91,8 +102,8 @@ public static class DataModelWriterExtensions
91102
"c:CT_PictureOptions/c:pictureOptions",
92103
new List<string>()
93104
{
94-
"[Obsolete(\"Unused property, will be removed in the next major version.\", false)]",
95-
"[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] ",
105+
AttributeStrings.ObsoletePropertyWarn,
106+
AttributeStrings.EditorBrowsableNever,
96107
}
97108
},
98109
}
@@ -105,8 +116,8 @@ public static class DataModelWriterExtensions
105116
"c:CT_PictureOptions/c:pictureOptions",
106117
new List<string>()
107118
{
108-
"[Obsolete(\"Unused property, will be removed in the next major version.\", false)]",
109-
"[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] ",
119+
AttributeStrings.ObsoletePropertyWarn,
120+
AttributeStrings.EditorBrowsableNever,
110121
}
111122
},
112123
}
@@ -119,16 +130,16 @@ public static class DataModelWriterExtensions
119130
"c:CT_PictureOptions/c:pictureOptions",
120131
new List<string>()
121132
{
122-
"[Obsolete(\"Unused property, will be removed in the next major version.\", false)]",
123-
"[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] ",
133+
AttributeStrings.ObsoletePropertyWarn,
134+
AttributeStrings.EditorBrowsableNever,
124135
}
125136
},
126137
{
127138
"c:CT_Boolean/c:bubble3D",
128139
new List<string>()
129140
{
130-
"[Obsolete(\"Unused property, will be removed in the next major version.\", false)]",
131-
"[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] ",
141+
AttributeStrings.ObsoletePropertyWarn,
142+
AttributeStrings.EditorBrowsableNever,
132143
}
133144
},
134145
}

generated/DocumentFormat.OpenXml/DocumentFormat.OpenXml.Generator/DocumentFormat.OpenXml.Generator.OpenXmlGenerator/schemas_microsoft_com_office_drawing_2012_chart.g.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2542,7 +2542,7 @@ public DocumentFormat.OpenXml.Drawing.Charts.Marker? Marker
25422542
/// <remarks>
25432543
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
25442544
/// </remarks>
2545-
[Obsolete("Unused property, will be removed in the next major version.", false)]
2545+
[Obsolete("Unused property, will be removed in a future version.", false)]
25462546
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
25472547
public DocumentFormat.OpenXml.Drawing.Charts.PictureOptions? PictureOptions
25482548
{
@@ -3036,7 +3036,7 @@ public DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties? ChartShapePro
30363036
/// <remarks>
30373037
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
30383038
/// </remarks>
3039-
[Obsolete("Unused property, will be removed in the next major version.", false)]
3039+
[Obsolete("Unused property, will be removed in a future version.", false)]
30403040
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
30413041
public DocumentFormat.OpenXml.Drawing.Charts.PictureOptions? PictureOptions
30423042
{
@@ -3224,7 +3224,7 @@ public DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties? ChartShapePro
32243224
/// <remarks>
32253225
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
32263226
/// </remarks>
3227-
[Obsolete("Unused property, will be removed in the next major version.", false)]
3227+
[Obsolete("Unused property, will be removed in a future version.", false)]
32283228
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
32293229
public DocumentFormat.OpenXml.Drawing.Charts.PictureOptions? PictureOptions
32303230
{
@@ -3400,7 +3400,7 @@ public DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties? ChartShapePro
34003400
/// <remarks>
34013401
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
34023402
/// </remarks>
3403-
[Obsolete("Unused property, will be removed in the next major version.", false)]
3403+
[Obsolete("Unused property, will be removed in a future version.", false)]
34043404
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
34053405
public DocumentFormat.OpenXml.Drawing.Charts.PictureOptions? PictureOptions
34063406
{
@@ -3570,7 +3570,7 @@ public DocumentFormat.OpenXml.Drawing.Charts.ChartShapeProperties? ChartShapePro
35703570
/// <remarks>
35713571
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
35723572
/// </remarks>
3573-
[Obsolete("Unused property, will be removed in the next major version.", false)]
3573+
[Obsolete("Unused property, will be removed in a future version.", false)]
35743574
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
35753575
public DocumentFormat.OpenXml.Drawing.Charts.PictureOptions? PictureOptions
35763576
{
@@ -3611,7 +3611,7 @@ public DocumentFormat.OpenXml.Drawing.Charts.Values? Values
36113611
/// <remarks>
36123612
/// xmlns:c = http://schemas.openxmlformats.org/drawingml/2006/chart
36133613
/// </remarks>
3614-
[Obsolete("Unused property, will be removed in the next major version.", false)]
3614+
[Obsolete("Unused property, will be removed in a future version.", false)]
36153615
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
36163616
public DocumentFormat.OpenXml.Drawing.Charts.Bubble3D? Bubble3D
36173617
{

0 commit comments

Comments
 (0)