npoi

Форк
0
1163 строки · 31.7 Кб
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

14
    [Serializable]
15

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

22
        private CT_Boolean varyColorsField;
23

24
        private List<CT_PieSer> serField;
25

26
        private CT_DLbls dLblsField;
27

28
        private List<CT_Extension> extLstField;
29

30
        public CT_Pie3DChart()
31
        {
32
        }
33
        public static CT_Pie3DChart Parse(XmlNode node, XmlNamespaceManager namespaceManager)
34
        {
35
            if (node == null)
36
                return null;
37
            CT_Pie3DChart ctObj = new CT_Pie3DChart();
38
            ctObj.ser = new List<CT_PieSer>();
39
            ctObj.extLst = new List<CT_Extension>();
40
            foreach (XmlNode childNode in node.ChildNodes)
41
            {
42
                if (childNode.LocalName == "varyColors")
43
                    ctObj.varyColors = CT_Boolean.Parse(childNode, namespaceManager);
44
                else if (childNode.LocalName == "dLbls")
45
                    ctObj.dLbls = CT_DLbls.Parse(childNode, namespaceManager);
46
                else if (childNode.LocalName == "ser")
47
                    ctObj.ser.Add(CT_PieSer.Parse(childNode, namespaceManager));
48
                else if (childNode.LocalName == "extLst")
49
                    ctObj.extLst.Add(CT_Extension.Parse(childNode, namespaceManager));
50
            }
51
            return ctObj;
52
        }
53

54

55

56
        internal void Write(StreamWriter sw, string nodeName)
57
        {
58
            sw.Write(string.Format("<c:{0}", nodeName));
59
            sw.Write(">");
60
            if (this.varyColors != null)
61
                this.varyColors.Write(sw, "varyColors");
62
            if (this.dLbls != null)
63
                this.dLbls.Write(sw, "dLbls");
64
            if (this.ser != null)
65
            {
66
                foreach (CT_PieSer x in this.ser)
67
                {
68
                    x.Write(sw, "ser");
69
                }
70
            }
71
            if (this.extLst != null)
72
            {
73
                foreach (CT_Extension x in this.extLst)
74
                {
75
                    x.Write(sw, "extLst");
76
                }
77
            }
78
            sw.Write(string.Format("</c:{0}>", nodeName));
79
        }
80

81
        public int GetSeriesCount()
82
        {
83
            return this.serField == null ? 0 : this.serField.Count;
84
        }
85

86
        [XmlElement(Order = 0)]
87
        public CT_Boolean varyColors
88
        {
89
            get
90
            {
91
                return this.varyColorsField;
92
            }
93
            set
94
            {
95
                this.varyColorsField = value;
96
            }
97
        }
98

99
        [XmlElement("ser", Order = 1)]
100
        public List<CT_PieSer> ser
101
        {
102
            get
103
            {
104
                return this.serField;
105
            }
106
            set
107
            {
108
                this.serField = value;
109
            }
110
        }
111

112
        [XmlElement(Order = 2)]
113
        public CT_DLbls dLbls
114
        {
115
            get
116
            {
117
                return this.dLblsField;
118
            }
119
            set
120
            {
121
                this.dLblsField = value;
122
            }
123
        }
124

125
        [XmlElement(Order = 3)]
126
        public List<CT_Extension> extLst
127
        {
128
            get
129
            {
130
                return this.extLstField;
131
            }
132
            set
133
            {
134
                this.extLstField = value;
135
            }
136
        }
137
    }
138

139

140
    [Serializable]
141

142
    [System.ComponentModel.DesignerCategoryAttribute("code")]
143
    [XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart")]
144
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart", IsNullable = true)]
145
    public class CT_PieChart
146
    {
147

148
        private CT_Boolean varyColorsField;
149

150
        private List<CT_PieSer> serField;
151

152
        private CT_DLbls dLblsField;
153

154
        private CT_FirstSliceAng firstSliceAngField;
155

156
        private List<CT_Extension> extLstField;
157

158
        public CT_PieChart()
159
        {
160
        }
161
        public static CT_PieChart Parse(XmlNode node, XmlNamespaceManager namespaceManager)
162
        {
163
            if (node == null)
164
                return null;
165
            CT_PieChart ctObj = new CT_PieChart();
166
            ctObj.ser = new List<CT_PieSer>();
167
            ctObj.extLst = new List<CT_Extension>();
168
            foreach (XmlNode childNode in node.ChildNodes)
169
            {
170
                if (childNode.LocalName == "varyColors")
171
                    ctObj.varyColors = CT_Boolean.Parse(childNode, namespaceManager);
172
                else if (childNode.LocalName == "dLbls")
173
                    ctObj.dLbls = CT_DLbls.Parse(childNode, namespaceManager);
174
                else if (childNode.LocalName == "firstSliceAng")
175
                    ctObj.firstSliceAng = CT_FirstSliceAng.Parse(childNode, namespaceManager);
176
                else if (childNode.LocalName == "ser")
177
                    ctObj.ser.Add(CT_PieSer.Parse(childNode, namespaceManager));
178
                else if (childNode.LocalName == "extLst")
179
                    ctObj.extLst.Add(CT_Extension.Parse(childNode, namespaceManager));
180
            }
181
            return ctObj;
182
        }
183

184

185

186
        internal void Write(StreamWriter sw, string nodeName)
187
        {
188
            sw.Write(string.Format("<c:{0}", nodeName));
189
            sw.Write(">");
190
            if (this.varyColors != null)
191
                this.varyColors.Write(sw, "varyColors");
192
            if (this.dLbls != null)
193
                this.dLbls.Write(sw, "dLbls");
194
            if (this.firstSliceAng != null)
195
                this.firstSliceAng.Write(sw, "firstSliceAng");
196
            if (this.ser != null)
197
            {
198
                foreach (CT_PieSer x in this.ser)
199
                {
200
                    x.Write(sw, "ser");
201
                }
202
            }
203
            if (this.extLst != null)
204
            {
205
                foreach (CT_Extension x in this.extLst)
206
                {
207
                    x.Write(sw, "extLst");
208
                }
209
            }
210
            sw.Write(string.Format("</c:{0}>", nodeName));
211
        }
212

213
        public int GetSeriesCount()
214
        {
215
            return this.serField == null ? 0 : this.serField.Count;
216
        }
217

218
        [XmlElement(Order = 0)]
219
        public CT_Boolean varyColors
220
        {
221
            get
222
            {
223
                return this.varyColorsField;
224
            }
225
            set
226
            {
227
                this.varyColorsField = value;
228
            }
229
        }
230

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

244
        [XmlElement(Order = 2)]
245
        public CT_DLbls dLbls
246
        {
247
            get
248
            {
249
                return this.dLblsField;
250
            }
251
            set
252
            {
253
                this.dLblsField = value;
254
            }
255
        }
256

257
        [XmlElement(Order = 3)]
258
        public CT_FirstSliceAng firstSliceAng
259
        {
260
            get
261
            {
262
                return this.firstSliceAngField;
263
            }
264
            set
265
            {
266
                this.firstSliceAngField = value;
267
            }
268
        }
269

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

283
        public CT_PieSer AddNewSer()
284
        {
285
            CT_PieSer newSer = new CT_PieSer();
286
            if (this.serField == null)
287
            {
288
                this.serField = new List<CT_PieSer>();
289
            }
290
            this.serField.Add(newSer);
291
            return newSer;
292
        }
293

294
        public CT_Boolean AddNewVaryColors()
295
        {
296
            this.varyColorsField = new CT_Boolean();
297
            return this.varyColorsField;
298
        }
299
    }
300

301
    [Serializable]
302

303
    [System.ComponentModel.DesignerCategoryAttribute("code")]
304
    [XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart")]
305
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart", IsNullable = true)]
306
    public class CT_PieSer
307
    {
308

309
        private CT_UnsignedInt idxField;
310

311
        private CT_UnsignedInt orderField;
312

313
        private CT_SerTx txField;
314

315
        private CT_ShapeProperties spPrField;
316

317
        private CT_UnsignedInt explosionField;
318

319
        private List<CT_DPt> dPtField;
320

321
        private CT_DLbls dLblsField;
322

323
        private CT_AxDataSource catField;
324

325
        private CT_NumDataSource valField;
326

327
        private List<CT_Extension> extLstField;
328

329
        public CT_PieSer()
330
        {
331
            dPt = new List<CT_DPt>();
332
        }
333
        public static CT_PieSer Parse(XmlNode node, XmlNamespaceManager namespaceManager)
334
        {
335
            if (node == null)
336
                return null;
337
            CT_PieSer ctObj = new CT_PieSer();
338
            ctObj.dPt = new List<CT_DPt>();
339
            ctObj.extLst = new List<CT_Extension>();
340
            foreach (XmlNode childNode in node.ChildNodes)
341
            {
342
                if (childNode.LocalName == "idx")
343
                    ctObj.idx = CT_UnsignedInt.Parse(childNode, namespaceManager);
344
                else if (childNode.LocalName == "order")
345
                    ctObj.order = CT_UnsignedInt.Parse(childNode, namespaceManager);
346
                else if (childNode.LocalName == "tx")
347
                    ctObj.tx = CT_SerTx.Parse(childNode, namespaceManager);
348
                else if (childNode.LocalName == "spPr")
349
                    ctObj.spPr = CT_ShapeProperties.Parse(childNode, namespaceManager);
350
                else if (childNode.LocalName == "explosion")
351
                    ctObj.explosion = CT_UnsignedInt.Parse(childNode, namespaceManager);
352
                else if (childNode.LocalName == "dLbls")
353
                    ctObj.dLbls = CT_DLbls.Parse(childNode, namespaceManager);
354
                else if (childNode.LocalName == "cat")
355
                    ctObj.cat = CT_AxDataSource.Parse(childNode, namespaceManager);
356
                else if (childNode.LocalName == "val")
357
                    ctObj.val = CT_NumDataSource.Parse(childNode, namespaceManager);
358
                else if (childNode.LocalName == "dPt")
359
                    ctObj.dPt.Add(CT_DPt.Parse(childNode, namespaceManager));
360
                else if (childNode.LocalName == "extLst")
361
                    ctObj.extLst.Add(CT_Extension.Parse(childNode, namespaceManager));
362
            }
363
            return ctObj;
364
        }
365

366

367

368
        internal void Write(StreamWriter sw, string nodeName)
369
        {
370
            sw.Write(string.Format("<c:{0}", nodeName));
371
            sw.Write(">");
372
            if (this.idx != null)
373
                this.idx.Write(sw, "idx");
374
            if (this.order != null)
375
                this.order.Write(sw, "order");
376
            if (this.tx != null)
377
                this.tx.Write(sw, "tx");
378
            if (this.spPr != null)
379
                this.spPr.Write(sw, "spPr");
380
            if (this.explosion != null)
381
                this.explosion.Write(sw, "explosion");
382
            if (this.dLbls != null)
383
                this.dLbls.Write(sw, "dLbls");
384
            if (this.cat != null)
385
                this.cat.Write(sw, "cat");
386
            if (this.val != null)
387
                this.val.Write(sw, "val");
388
            if (this.dPt != null)
389
            {
390
                foreach (CT_DPt x in this.dPt)
391
                {
392
                    x.Write(sw, "dPt");
393
                }
394
            }
395
            if (this.extLst != null)
396
            {
397
                foreach (CT_Extension x in this.extLst)
398
                {
399
                    x.Write(sw, "extLst");
400
                }
401
            }
402
            sw.Write(string.Format("</c:{0}>", nodeName));
403
        }
404

405
        [XmlElement(Order = 0)]
406
        public CT_UnsignedInt idx
407
        {
408
            get
409
            {
410
                return this.idxField;
411
            }
412
            set
413
            {
414
                this.idxField = value;
415
            }
416
        }
417

418
        [XmlElement(Order = 1)]
419
        public CT_UnsignedInt order
420
        {
421
            get
422
            {
423
                return this.orderField;
424
            }
425
            set
426
            {
427
                this.orderField = value;
428
            }
429
        }
430

431
        [XmlElement(Order = 2)]
432
        public CT_SerTx tx
433
        {
434
            get
435
            {
436
                return this.txField;
437
            }
438
            set
439
            {
440
                this.txField = value;
441
            }
442
        }
443

444
        [XmlElement(Order = 3)]
445
        public CT_ShapeProperties spPr
446
        {
447
            get
448
            {
449
                return this.spPrField;
450
            }
451
            set
452
            {
453
                this.spPrField = value;
454
            }
455
        }
456

457
        [XmlElement(Order = 4)]
458
        public CT_UnsignedInt explosion
459
        {
460
            get
461
            {
462
                return this.explosionField;
463
            }
464
            set
465
            {
466
                this.explosionField = value;
467
            }
468
        }
469

470
        [XmlElement("dPt", Order = 5)]
471
        public List<CT_DPt> dPt
472
        {
473
            get
474
            {
475
                return this.dPtField;
476
            }
477
            set
478
            {
479
                this.dPtField = value;
480
            }
481
        }
482

483
        [XmlElement(Order = 6)]
484
        public CT_DLbls dLbls
485
        {
486
            get
487
            {
488
                return this.dLblsField;
489
            }
490
            set
491
            {
492
                this.dLblsField = value;
493
            }
494
        }
495

496
        [XmlElement(Order = 7)]
497
        public CT_AxDataSource cat
498
        {
499
            get
500
            {
501
                return this.catField;
502
            }
503
            set
504
            {
505
                this.catField = value;
506
            }
507
        }
508

509
        [XmlElement(Order = 8)]
510
        public CT_NumDataSource val
511
        {
512
            get
513
            {
514
                return this.valField;
515
            }
516
            set
517
            {
518
                this.valField = value;
519
            }
520
        }
521

522
        [XmlArray(Order = 9)]
523
        [XmlArrayItem("ext", IsNullable = false)]
524
        public List<CT_Extension> extLst
525
        {
526
            get
527
            {
528
                return this.extLstField;
529
            }
530
            set
531
            {
532
                this.extLstField = value;
533
            }
534
        }
535

536
        public CT_UnsignedInt AddNewIdx()
537
        {
538
            this.idxField = new CT_UnsignedInt();
539
            return this.idxField;
540
        }
541

542
        public CT_UnsignedInt AddNewOrder()
543
        {
544
            this.orderField = new CT_UnsignedInt();
545
            return this.orderField;
546
        }
547

548
        public CT_AxDataSource AddNewCat()
549
        {
550
            this.catField = new CT_AxDataSource();
551
            return this.catField;
552
        }
553

554
        public CT_NumDataSource AddNewVal()
555
        {
556
            this.valField = new CT_NumDataSource();
557
            return this.valField;
558
        }
559
    }
560

561

562

563

564
    [Serializable]
565

566
    [System.ComponentModel.DesignerCategoryAttribute("code")]
567
    [XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart")]
568
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart", IsNullable = true)]
569
    public class CT_HoleSize
570
    {
571

572
        private byte valField;
573

574
        public CT_HoleSize()
575
        {
576
            this.valField = ((byte)(10));
577
        }
578
        public static CT_HoleSize Parse(XmlNode node, XmlNamespaceManager namespaceManager)
579
        {
580
            if (node == null)
581
                return null;
582
            CT_HoleSize ctObj = new CT_HoleSize();
583
            if (node.Attributes["val"] != null)
584
                ctObj.val = XmlHelper.ReadByte(node.Attributes["val"]);
585
            return ctObj;
586
        }
587

588

589

590
        internal void Write(StreamWriter sw, string nodeName)
591
        {
592
            sw.Write(string.Format("<c:{0}", nodeName));
593
            XmlHelper.WriteAttribute(sw, "val", this.val);
594
            sw.Write(">");
595
            sw.Write(string.Format("</c:{0}>", nodeName));
596
        }
597

598
        [XmlAttribute]
599
        [DefaultValue(typeof(byte), "10")]
600
        public byte val
601
        {
602
            get
603
            {
604
                return this.valField;
605
            }
606
            set
607
            {
608
                this.valField = value;
609
            }
610
        }
611
    }
612

613

614
    [Serializable]
615

616
    [System.ComponentModel.DesignerCategoryAttribute("code")]
617
    [XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart")]
618
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart", IsNullable = true)]
619
    public class CT_FirstSliceAng
620
    {
621

622
        private ushort valField;
623

624
        public CT_FirstSliceAng()
625
        {
626
            this.valField = ((ushort)(0));
627
        }
628
        public static CT_FirstSliceAng Parse(XmlNode node, XmlNamespaceManager namespaceManager)
629
        {
630
            if (node == null)
631
                return null;
632
            CT_FirstSliceAng ctObj = new CT_FirstSliceAng();
633
            if (node.Attributes["val"] != null)
634
                ctObj.val = XmlHelper.ReadUShort(node.Attributes["val"]);
635
            return ctObj;
636
        }
637

638

639

640
        internal void Write(StreamWriter sw, string nodeName)
641
        {
642
            sw.Write(string.Format("<c:{0}", nodeName));
643
            XmlHelper.WriteAttribute(sw, "val", this.val);
644
            sw.Write(">");
645
            sw.Write(string.Format("</c:{0}>", nodeName));
646
        }
647

648
        [XmlAttribute]
649
        [DefaultValue(typeof(ushort), "0")]
650
        public ushort val
651
        {
652
            get
653
            {
654
                return this.valField;
655
            }
656
            set
657
            {
658
                this.valField = value;
659
            }
660
        }
661
    }
662

663

664
    [Serializable]
665

666
    [System.ComponentModel.DesignerCategoryAttribute("code")]
667
    [XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart")]
668
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart", IsNullable = true)]
669
    public class CT_DoughnutChart
670
    {
671

672
        private CT_Boolean varyColorsField;
673

674
        private List<CT_PieSer> serField;
675

676
        private CT_DLbls dLblsField;
677

678
        private CT_FirstSliceAng firstSliceAngField;
679

680
        private CT_HoleSize holeSizeField;
681

682
        private List<CT_Extension> extLstField;
683

684
        public CT_DoughnutChart()
685
        {
686
        }
687
        public static CT_DoughnutChart Parse(XmlNode node, XmlNamespaceManager namespaceManager)
688
        {
689
            if (node == null)
690
                return null;
691
            CT_DoughnutChart ctObj = new CT_DoughnutChart();
692
            ctObj.ser = new List<CT_PieSer>();
693
            ctObj.extLst = new List<CT_Extension>();
694
            foreach (XmlNode childNode in node.ChildNodes)
695
            {
696
                if (childNode.LocalName == "varyColors")
697
                    ctObj.varyColors = CT_Boolean.Parse(childNode, namespaceManager);
698
                else if (childNode.LocalName == "dLbls")
699
                    ctObj.dLbls = CT_DLbls.Parse(childNode, namespaceManager);
700
                else if (childNode.LocalName == "firstSliceAng")
701
                    ctObj.firstSliceAng = CT_FirstSliceAng.Parse(childNode, namespaceManager);
702
                else if (childNode.LocalName == "holeSize")
703
                    ctObj.holeSize = CT_HoleSize.Parse(childNode, namespaceManager);
704
                else if (childNode.LocalName == "ser")
705
                    ctObj.ser.Add(CT_PieSer.Parse(childNode, namespaceManager));
706
                else if (childNode.LocalName == "extLst")
707
                    ctObj.extLst.Add(CT_Extension.Parse(childNode, namespaceManager));
708
            }
709
            return ctObj;
710
        }
711

712

713

714
        internal void Write(StreamWriter sw, string nodeName)
715
        {
716
            sw.Write(string.Format("<c:{0}", nodeName));
717
            sw.Write(">");
718
            if (this.varyColors != null)
719
                this.varyColors.Write(sw, "varyColors");
720
            if (this.dLbls != null)
721
                this.dLbls.Write(sw, "dLbls");
722
            if (this.firstSliceAng != null)
723
                this.firstSliceAng.Write(sw, "firstSliceAng");
724
            if (this.holeSize != null)
725
                this.holeSize.Write(sw, "holeSize");
726
            if (this.ser != null)
727
            {
728
                foreach (CT_PieSer x in this.ser)
729
                {
730
                    x.Write(sw, "ser");
731
                }
732
            }
733
            if (this.extLst != null)
734
            {
735
                foreach (CT_Extension x in this.extLst)
736
                {
737
                    x.Write(sw, "extLst");
738
                }
739
            }
740
            sw.Write(string.Format("</c:{0}>", nodeName));
741
        }
742

743
        public int GetSeriesCount()
744
        {
745
            return this.serField == null ? 0 : this.serField.Count;
746
        }
747

748
        [XmlElement(Order = 0)]
749
        public CT_Boolean varyColors
750
        {
751
            get
752
            {
753
                return this.varyColorsField;
754
            }
755
            set
756
            {
757
                this.varyColorsField = value;
758
            }
759
        }
760

761
        [XmlElement("ser", Order = 1)]
762
        public List<CT_PieSer> ser
763
        {
764
            get
765
            {
766
                return this.serField;
767
            }
768
            set
769
            {
770
                this.serField = value;
771
            }
772
        }
773

774
        [XmlElement(Order = 2)]
775
        public CT_DLbls dLbls
776
        {
777
            get
778
            {
779
                return this.dLblsField;
780
            }
781
            set
782
            {
783
                this.dLblsField = value;
784
            }
785
        }
786

787
        [XmlElement(Order = 3)]
788
        public CT_FirstSliceAng firstSliceAng
789
        {
790
            get
791
            {
792
                return this.firstSliceAngField;
793
            }
794
            set
795
            {
796
                this.firstSliceAngField = value;
797
            }
798
        }
799

800
        [XmlElement(Order = 4)]
801
        public CT_HoleSize holeSize
802
        {
803
            get
804
            {
805
                return this.holeSizeField;
806
            }
807
            set
808
            {
809
                this.holeSizeField = value;
810
            }
811
        }
812

813
        [XmlArray(Order = 5)]
814
        [XmlArrayItem("ext", IsNullable = false)]
815
        public List<CT_Extension> extLst
816
        {
817
            get
818
            {
819
                return this.extLstField;
820
            }
821
            set
822
            {
823
                this.extLstField = value;
824
            }
825
        }
826
    }
827

828
    [Serializable]
829

830
    [System.ComponentModel.DesignerCategoryAttribute("code")]
831
    [XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart")]
832
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart", IsNullable = true)]
833
    public class CT_OfPieType
834
    {
835

836
        private ST_OfPieType valField;
837

838
        public CT_OfPieType()
839
        {
840
            this.valField = ST_OfPieType.pie;
841
        }
842
        public static CT_OfPieType Parse(XmlNode node, XmlNamespaceManager namespaceManager)
843
        {
844
            if (node == null)
845
                return null;
846
            CT_OfPieType ctObj = new CT_OfPieType();
847
            if (node.Attributes["val"] != null)
848
                ctObj.val = (ST_OfPieType)Enum.Parse(typeof(ST_OfPieType), node.Attributes["val"].Value);
849
            return ctObj;
850
        }
851

852

853

854
        internal void Write(StreamWriter sw, string nodeName)
855
        {
856
            sw.Write(string.Format("<c:{0}", nodeName));
857
            XmlHelper.WriteAttribute(sw, "val", this.val.ToString());
858
            sw.Write(">");
859
            sw.Write(string.Format("</c:{0}>", nodeName));
860
        }
861

862
        [XmlAttribute]
863
        [DefaultValue(ST_OfPieType.pie)]
864
        public ST_OfPieType val
865
        {
866
            get
867
            {
868
                return this.valField;
869
            }
870
            set
871
            {
872
                this.valField = value;
873
            }
874
        }
875
    }
876

877

878
    [Serializable]
879
    [XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart")]
880
    public enum ST_OfPieType
881
    {
882

883
        /// <remarks/>
884
        pie,
885

886
        /// <remarks/>
887
        bar,
888
    }
889

890

891
    [Serializable]
892

893
    [System.ComponentModel.DesignerCategoryAttribute("code")]
894
    [XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart")]
895
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart", IsNullable = true)]
896
    public class CT_OfPieChart
897
    {
898

899
        private CT_OfPieType ofPieTypeField;
900

901
        private CT_Boolean varyColorsField;
902

903
        private List<CT_PieSer> serField;
904

905
        private CT_DLbls dLblsField;
906

907
        private CT_GapAmount gapWidthField;
908

909
        private CT_SplitType splitTypeField;
910

911
        private CT_Double splitPosField;
912

913
        private List<CT_UnsignedInt> custSplitField;
914

915
        private CT_SecondPieSize secondPieSizeField;
916

917
        private List<CT_ChartLines> serLinesField;
918

919
        private List<CT_Extension> extLstField;
920

921
        public CT_OfPieChart()
922
        {
923
        }
924

925
        public static CT_OfPieChart Parse(XmlNode node, XmlNamespaceManager namespaceManager)
926
        {
927
            if (node == null)
928
                return null;
929
            CT_OfPieChart ctObj = new CT_OfPieChart();
930
            ctObj.ser = new List<CT_PieSer>();
931
            ctObj.custSplit = new List<CT_UnsignedInt>();
932
            ctObj.serLines = new List<CT_ChartLines>();
933
            ctObj.extLst = new List<CT_Extension>();
934
            foreach (XmlNode childNode in node.ChildNodes)
935
            {
936
                if (childNode.LocalName == "ofPieType")
937
                    ctObj.ofPieType = CT_OfPieType.Parse(childNode, namespaceManager);
938
                else if (childNode.LocalName == "varyColors")
939
                    ctObj.varyColors = CT_Boolean.Parse(childNode, namespaceManager);
940
                else if (childNode.LocalName == "dLbls")
941
                    ctObj.dLbls = CT_DLbls.Parse(childNode, namespaceManager);
942
                else if (childNode.LocalName == "gapWidth")
943
                    ctObj.gapWidth = CT_GapAmount.Parse(childNode, namespaceManager);
944
                else if (childNode.LocalName == "splitType")
945
                    ctObj.splitType = CT_SplitType.Parse(childNode, namespaceManager);
946
                else if (childNode.LocalName == "splitPos")
947
                    ctObj.splitPos = CT_Double.Parse(childNode, namespaceManager);
948
                else if (childNode.LocalName == "secondPieSize")
949
                    ctObj.secondPieSize = CT_SecondPieSize.Parse(childNode, namespaceManager);
950
                else if (childNode.LocalName == "ser")
951
                    ctObj.ser.Add(CT_PieSer.Parse(childNode, namespaceManager));
952
                else if (childNode.LocalName == "custSplit")
953
                    ctObj.custSplit.Add(CT_UnsignedInt.Parse(childNode, namespaceManager));
954
                else if (childNode.LocalName == "serLines")
955
                    ctObj.serLines.Add(CT_ChartLines.Parse(childNode, namespaceManager));
956
                else if (childNode.LocalName == "extLst")
957
                    ctObj.extLst.Add(CT_Extension.Parse(childNode, namespaceManager));
958
            }
959
            return ctObj;
960
        }
961

962

963

964
        internal void Write(StreamWriter sw, string nodeName)
965
        {
966
            sw.Write(string.Format("<c:{0}", nodeName));
967
            sw.Write(">");
968
            if (this.ofPieType != null)
969
                this.ofPieType.Write(sw, "ofPieType");
970
            if (this.varyColors != null)
971
                this.varyColors.Write(sw, "varyColors");
972
            if (this.dLbls != null)
973
                this.dLbls.Write(sw, "dLbls");
974
            if (this.gapWidth != null)
975
                this.gapWidth.Write(sw, "gapWidth");
976
            if (this.splitType != null)
977
                this.splitType.Write(sw, "splitType");
978
            if (this.splitPos != null)
979
                this.splitPos.Write(sw, "splitPos");
980
            if (this.secondPieSize != null)
981
                this.secondPieSize.Write(sw, "secondPieSize");
982
            if (this.ser != null)
983
            {
984
                foreach (CT_PieSer x in this.ser)
985
                {
986
                    x.Write(sw, "ser");
987
                }
988
            }
989
            if (this.custSplit != null)
990
            {
991
                foreach (CT_UnsignedInt x in this.custSplit)
992
                {
993
                    x.Write(sw, "custSplit");
994
                }
995
            }
996
            if (this.serLines != null)
997
            {
998
                foreach (CT_ChartLines x in this.serLines)
999
                {
1000
                    x.Write(sw, "serLines");
1001
                }
1002
            }
1003
            if (this.extLst != null)
1004
            {
1005
                foreach (CT_Extension x in this.extLst)
1006
                {
1007
                    x.Write(sw, "extLst");
1008
                }
1009
            }
1010
            sw.Write(string.Format("</c:{0}>", nodeName));
1011
        }
1012

1013
        public int GetSeriesCount()
1014
        {
1015
            return this.serField == null ? 0 : this.serField.Count;
1016
        }
1017

1018
        [XmlElement(Order = 0)]
1019
        public CT_OfPieType ofPieType
1020
        {
1021
            get
1022
            {
1023
                return this.ofPieTypeField;
1024
            }
1025
            set
1026
            {
1027
                this.ofPieTypeField = value;
1028
            }
1029
        }
1030

1031
        [XmlElement(Order = 1)]
1032
        public CT_Boolean varyColors
1033
        {
1034
            get
1035
            {
1036
                return this.varyColorsField;
1037
            }
1038
            set
1039
            {
1040
                this.varyColorsField = value;
1041
            }
1042
        }
1043

1044
        [XmlElement("ser", Order = 2)]
1045
        public List<CT_PieSer> ser
1046
        {
1047
            get
1048
            {
1049
                return this.serField;
1050
            }
1051
            set
1052
            {
1053
                this.serField = value;
1054
            }
1055
        }
1056

1057
        [XmlElement(Order = 3)]
1058
        public CT_DLbls dLbls
1059
        {
1060
            get
1061
            {
1062
                return this.dLblsField;
1063
            }
1064
            set
1065
            {
1066
                this.dLblsField = value;
1067
            }
1068
        }
1069

1070
        [XmlElement(Order = 4)]
1071
        public CT_GapAmount gapWidth
1072
        {
1073
            get
1074
            {
1075
                return this.gapWidthField;
1076
            }
1077
            set
1078
            {
1079
                this.gapWidthField = value;
1080
            }
1081
        }
1082

1083
        [XmlElement(Order = 5)]
1084
        public CT_SplitType splitType
1085
        {
1086
            get
1087
            {
1088
                return this.splitTypeField;
1089
            }
1090
            set
1091
            {
1092
                this.splitTypeField = value;
1093
            }
1094
        }
1095

1096
        [XmlElement(Order = 6)]
1097
        public CT_Double splitPos
1098
        {
1099
            get
1100
            {
1101
                return this.splitPosField;
1102
            }
1103
            set
1104
            {
1105
                this.splitPosField = value;
1106
            }
1107
        }
1108

1109
        [XmlElement(Order = 7)]
1110
        public List<CT_UnsignedInt> custSplit
1111
        {
1112
            get
1113
            {
1114
                return this.custSplitField;
1115
            }
1116
            set
1117
            {
1118
                this.custSplitField = value;
1119
            }
1120
        }
1121

1122
        [XmlElement(Order = 8)]
1123
        public CT_SecondPieSize secondPieSize
1124
        {
1125
            get
1126
            {
1127
                return this.secondPieSizeField;
1128
            }
1129
            set
1130
            {
1131
                this.secondPieSizeField = value;
1132
            }
1133
        }
1134

1135
        [XmlElement("serLines", Order = 9)]
1136
        public List<CT_ChartLines> serLines
1137
        {
1138
            get
1139
            {
1140
                return this.serLinesField;
1141
            }
1142
            set
1143
            {
1144
                this.serLinesField = value;
1145
            }
1146
        }
1147

1148
        [XmlArray(Order = 10)]
1149
        [XmlArrayItem("ext", IsNullable = false)]
1150
        public List<CT_Extension> extLst
1151
        {
1152
            get
1153
            {
1154
                return this.extLstField;
1155
            }
1156
            set
1157
            {
1158
                this.extLstField = value;
1159
            }
1160
        }
1161
    }
1162

1163
}
1164

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

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

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

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