npoi

Форк
0
/
SurfaceChart.cs 
460 строк · 12.5 Кб
1
using NPOI.OpenXml4Net.Util;
2
using System;
3
using System.Collections.Generic;
4
using System.ComponentModel;
5
using System.IO;
6
using System.Text;
7
using System.Xml;
8
using System.Xml.Serialization;
9

10
namespace NPOI.OpenXmlFormats.Dml.Chart
11
{
12

13
    [Serializable]
14

15
    [System.ComponentModel.DesignerCategoryAttribute("code")]
16
    [XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart")]
17
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart", IsNullable = true)]
18
    public class CT_Surface
19
    {
20

21
        private CT_UnsignedInt thicknessField;
22

23
        private CT_ShapeProperties spPrField;
24

25
        private CT_PictureOptions pictureOptionsField;
26

27
        private List<CT_Extension> extLstField;
28

29
        public CT_Surface()
30
        {
31
        }
32
        public static CT_Surface Parse(XmlNode node, XmlNamespaceManager namespaceManager)
33
        {
34
            if (node == null)
35
                return null;
36
            CT_Surface ctObj = new CT_Surface();
37
            ctObj.extLst = new List<CT_Extension>();
38
            foreach (XmlNode childNode in node.ChildNodes)
39
            {
40
                if (childNode.LocalName == "thickness")
41
                    ctObj.thickness = CT_UnsignedInt.Parse(childNode, namespaceManager);
42
                else if (childNode.LocalName == "spPr")
43
                    ctObj.spPr = CT_ShapeProperties.Parse(childNode, namespaceManager);
44
                else if (childNode.LocalName == "pictureOptions")
45
                    ctObj.pictureOptions = CT_PictureOptions.Parse(childNode, namespaceManager);
46
                else if (childNode.LocalName == "extLst")
47
                    ctObj.extLst.Add(CT_Extension.Parse(childNode, namespaceManager));
48
            }
49
            return ctObj;
50
        }
51

52

53

54
        internal void Write(StreamWriter sw, string nodeName)
55
        {
56
            sw.Write(string.Format("<c:{0}", nodeName));
57
            sw.Write(">");
58
            if (this.thickness != null)
59
                this.thickness.Write(sw, "thickness");
60
            if (this.spPr != null)
61
                this.spPr.Write(sw, "spPr");
62
            if (this.pictureOptions != null)
63
                this.pictureOptions.Write(sw, "pictureOptions");
64
            if (this.extLst != null)
65
            {
66
                foreach (CT_Extension x in this.extLst)
67
                {
68
                    x.Write(sw, "extLst");
69
                }
70
            }
71
            sw.Write(string.Format("</c:{0}>", nodeName));
72
        }
73

74

75
        [XmlElement(Order = 0)]
76
        public CT_UnsignedInt thickness
77
        {
78
            get
79
            {
80
                return this.thicknessField;
81
            }
82
            set
83
            {
84
                this.thicknessField = value;
85
            }
86
        }
87

88
        [XmlElement(Order = 1)]
89
        public CT_ShapeProperties spPr
90
        {
91
            get
92
            {
93
                return this.spPrField;
94
            }
95
            set
96
            {
97
                this.spPrField = value;
98
            }
99
        }
100

101
        [XmlElement(Order = 2)]
102
        public CT_PictureOptions pictureOptions
103
        {
104
            get
105
            {
106
                return this.pictureOptionsField;
107
            }
108
            set
109
            {
110
                this.pictureOptionsField = value;
111
            }
112
        }
113

114
        [XmlElement(Order = 3)]
115
        public List<CT_Extension> extLst
116
        {
117
            get
118
            {
119
                return this.extLstField;
120
            }
121
            set
122
            {
123
                this.extLstField = value;
124
            }
125
        }
126
    }
127

128

129
    [Serializable]
130

131
    [System.ComponentModel.DesignerCategoryAttribute("code")]
132
    [XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart")]
133
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart", IsNullable = true)]
134
    public class CT_Surface3DChart
135
    {
136

137
        private CT_Boolean wireframeField;
138

139
        private List<CT_SurfaceSer> serField;
140

141
        private List<CT_BandFmt> bandFmtsField;
142

143
        private List<CT_UnsignedInt> axIdField;
144

145
        private List<CT_Extension> extLstField;
146

147
        public CT_Surface3DChart()
148
        {
149

150
        }
151

152
        public static CT_Surface3DChart Parse(XmlNode node, XmlNamespaceManager namespaceManager)
153
        {
154
            if (node == null)
155
                return null;
156
            CT_Surface3DChart ctObj = new CT_Surface3DChart();
157
            ctObj.ser = new List<CT_SurfaceSer>();
158
            ctObj.bandFmts = new List<CT_BandFmt>();
159
            ctObj.axId = new List<CT_UnsignedInt>();
160
            ctObj.extLst = new List<CT_Extension>();
161
            foreach (XmlNode childNode in node.ChildNodes)
162
            {
163
                if (childNode.LocalName == "wireframe")
164
                    ctObj.wireframe = CT_Boolean.Parse(childNode, namespaceManager);
165
                else if (childNode.LocalName == "ser")
166
                    ctObj.ser.Add(CT_SurfaceSer.Parse(childNode, namespaceManager));
167
                else if (childNode.LocalName == "bandFmts")
168
                    ctObj.bandFmts.Add(CT_BandFmt.Parse(childNode, namespaceManager));
169
                else if (childNode.LocalName == "axId")
170
                    ctObj.axId.Add(CT_UnsignedInt.Parse(childNode, namespaceManager));
171
                else if (childNode.LocalName == "extLst")
172
                    ctObj.extLst.Add(CT_Extension.Parse(childNode, namespaceManager));
173
            }
174
            return ctObj;
175
        }
176

177

178

179
        internal void Write(StreamWriter sw, string nodeName)
180
        {
181
            sw.Write(string.Format("<c:{0}", nodeName));
182
            sw.Write(">");
183
            if (this.wireframe != null)
184
                this.wireframe.Write(sw, "wireframe");
185
            if (this.ser != null)
186
            {
187
                foreach (CT_SurfaceSer x in this.ser)
188
                {
189
                    x.Write(sw, "ser");
190
                }
191
            }
192
            if (this.bandFmts != null)
193
            {
194
                foreach (CT_BandFmt x in this.bandFmts)
195
                {
196
                    x.Write(sw, "bandFmts");
197
                }
198
            }
199
            if (this.axId != null)
200
            {
201
                foreach (CT_UnsignedInt x in this.axId)
202
                {
203
                    x.Write(sw, "axId");
204
                }
205
            }
206
            if (this.extLst != null)
207
            {
208
                foreach (CT_Extension x in this.extLst)
209
                {
210
                    x.Write(sw, "extLst");
211
                }
212
            }
213
            sw.Write(string.Format("</c:{0}>", nodeName));
214
        }
215

216
        public int GetSeriesCount()
217
        {
218
            return this.serField == null ? 0 : this.serField.Count;
219
        }
220

221
        [XmlElement(Order = 0)]
222
        public CT_Boolean wireframe
223
        {
224
            get
225
            {
226
                return this.wireframeField;
227
            }
228
            set
229
            {
230
                this.wireframeField = value;
231
            }
232
        }
233

234
        [XmlElement("ser", Order = 1)]
235
        public List<CT_SurfaceSer> ser
236
        {
237
            get
238
            {
239
                return this.serField;
240
            }
241
            set
242
            {
243
                this.serField = value;
244
            }
245
        }
246

247
        [XmlElement(Order = 2)]
248
        public List<CT_BandFmt> bandFmts
249
        {
250
            get
251
            {
252
                return this.bandFmtsField;
253
            }
254
            set
255
            {
256
                this.bandFmtsField = value;
257
            }
258
        }
259

260
        [XmlElement("axId", Order = 3)]
261
        public List<CT_UnsignedInt> axId
262
        {
263
            get
264
            {
265
                return this.axIdField;
266
            }
267
            set
268
            {
269
                this.axIdField = value;
270
            }
271
        }
272

273
        [XmlElement(Order = 4)]
274
        public List<CT_Extension> extLst
275
        {
276
            get
277
            {
278
                return this.extLstField;
279
            }
280
            set
281
            {
282
                this.extLstField = value;
283
            }
284
        }
285
    }
286

287

288
    [Serializable]
289

290
    [System.ComponentModel.DesignerCategoryAttribute("code")]
291
    [XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart")]
292
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart", IsNullable = true)]
293
    public class CT_SurfaceSer
294
    {
295

296
        private CT_UnsignedInt idxField;
297

298
        private CT_UnsignedInt orderField;
299

300
        private CT_SerTx txField;
301

302
        private CT_ShapeProperties spPrField;
303

304
        private CT_AxDataSource catField;
305

306
        private CT_NumDataSource valField;
307

308
        private List<CT_Extension> extLstField;
309

310
        public CT_SurfaceSer()
311
        {
312

313
        }
314

315
        public static CT_SurfaceSer Parse(XmlNode node, XmlNamespaceManager namespaceManager)
316
        {
317
            if (node == null)
318
                return null;
319
            CT_SurfaceSer ctObj = new CT_SurfaceSer();
320
            ctObj.extLst = new List<CT_Extension>();
321
            foreach (XmlNode childNode in node.ChildNodes)
322
            {
323
                if (childNode.LocalName == "idx")
324
                    ctObj.idx = CT_UnsignedInt.Parse(childNode, namespaceManager);
325
                else if (childNode.LocalName == "order")
326
                    ctObj.order = CT_UnsignedInt.Parse(childNode, namespaceManager);
327
                else if (childNode.LocalName == "tx")
328
                    ctObj.tx = CT_SerTx.Parse(childNode, namespaceManager);
329
                else if (childNode.LocalName == "spPr")
330
                    ctObj.spPr = CT_ShapeProperties.Parse(childNode, namespaceManager);
331
                else if (childNode.LocalName == "cat")
332
                    ctObj.cat = CT_AxDataSource.Parse(childNode, namespaceManager);
333
                else if (childNode.LocalName == "val")
334
                    ctObj.val = CT_NumDataSource.Parse(childNode, namespaceManager);
335
                else if (childNode.LocalName == "extLst")
336
                    ctObj.extLst.Add(CT_Extension.Parse(childNode, namespaceManager));
337
            }
338
            return ctObj;
339
        }
340

341

342

343
        internal void Write(StreamWriter sw, string nodeName)
344
        {
345
            sw.Write(string.Format("<c:{0}", nodeName));
346
            sw.Write(">");
347
            if (this.idx != null)
348
                this.idx.Write(sw, "idx");
349
            if (this.order != null)
350
                this.order.Write(sw, "order");
351
            if (this.tx != null)
352
                this.tx.Write(sw, "tx");
353
            if (this.spPr != null)
354
                this.spPr.Write(sw, "spPr");
355
            if (this.cat != null)
356
                this.cat.Write(sw, "cat");
357
            if (this.val != null)
358
                this.val.Write(sw, "val");
359
            if (this.extLst != null)
360
            {
361
                foreach (CT_Extension x in this.extLst)
362
                {
363
                    x.Write(sw, "extLst");
364
                }
365
            }
366
            sw.Write(string.Format("</c:{0}>", nodeName));
367
        }
368

369
        [XmlElement(Order = 0)]
370
        public CT_UnsignedInt idx
371
        {
372
            get
373
            {
374
                return this.idxField;
375
            }
376
            set
377
            {
378
                this.idxField = value;
379
            }
380
        }
381

382
        [XmlElement(Order = 1)]
383
        public CT_UnsignedInt order
384
        {
385
            get
386
            {
387
                return this.orderField;
388
            }
389
            set
390
            {
391
                this.orderField = value;
392
            }
393
        }
394

395
        [XmlElement(Order = 2)]
396
        public CT_SerTx tx
397
        {
398
            get
399
            {
400
                return this.txField;
401
            }
402
            set
403
            {
404
                this.txField = value;
405
            }
406
        }
407

408
        [XmlElement(Order = 3)]
409
        public CT_ShapeProperties spPr
410
        {
411
            get
412
            {
413
                return this.spPrField;
414
            }
415
            set
416
            {
417
                this.spPrField = value;
418
            }
419
        }
420

421
        [XmlElement(Order = 4)]
422
        public CT_AxDataSource cat
423
        {
424
            get
425
            {
426
                return this.catField;
427
            }
428
            set
429
            {
430
                this.catField = value;
431
            }
432
        }
433

434
        [XmlElement(Order = 5)]
435
        public CT_NumDataSource val
436
        {
437
            get
438
            {
439
                return this.valField;
440
            }
441
            set
442
            {
443
                this.valField = value;
444
            }
445
        }
446

447
        [XmlElement(Order = 6)]
448
        public List<CT_Extension> extLst
449
        {
450
            get
451
            {
452
                return this.extLstField;
453
            }
454
            set
455
            {
456
                this.extLstField = value;
457
            }
458
        }
459
    }
460
}
461

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.