@@ -11,6 +11,17 @@ namespace DocumentFormat.OpenXml.Generator.Generators.Elements;
1111
1212public 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 }
0 commit comments