npoi

Форк
0
1495 строк · 38.9 Кб
1

2
using NPOI.OpenXml4Net.Util;
3
using System;
4
using System.Collections.Generic;
5
using System.ComponentModel;
6
using System.IO;
7
using System.Text;
8
using System.Xml;
9
using System.Xml.Serialization;
10

11
namespace NPOI.OpenXmlFormats.Dml 
12
{
13
    
14

15
    [Serializable]
16
    [XmlType(Namespace="http://schemas.openxmlformats.org/drawingml/2006/main")]
17
    [XmlRoot(Namespace="http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable=false)]
18
    public enum ST_TextAnchoringType {
19
        
20
    
21
        t,
22
        
23
    
24
        ctr,
25
        
26
    
27
        b,
28
        
29
    
30
        just,
31
        
32
    
33
        dist,
34
    }
35
    
36

37
    [Serializable]
38
    [XmlType(Namespace="http://schemas.openxmlformats.org/drawingml/2006/main")]
39
    [XmlRoot(Namespace="http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable=false)]
40
    public enum ST_TextVertOverflowType {
41
        
42
    
43
        overflow,
44
        
45
    
46
        ellipsis,
47
        
48
    
49
        clip,
50
    }
51
    
52

53
    [Serializable]
54
    [XmlType(Namespace="http://schemas.openxmlformats.org/drawingml/2006/main")]
55
    [XmlRoot(Namespace="http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable=false)]
56
    public enum ST_TextHorzOverflowType {
57
        
58
    
59
        overflow,
60
        
61
    
62
        clip,
63
    }
64
    
65

66
    [Serializable]
67
    [XmlType(Namespace="http://schemas.openxmlformats.org/drawingml/2006/main")]
68
    [XmlRoot(Namespace="http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable=false)]
69
    public enum ST_TextVerticalType {
70
        
71
    
72
        horz,
73
        
74
    
75
        vert,
76
        
77
    
78
        vert270,
79
        
80
    
81
        wordArtVert,
82
        
83
    
84
        eaVert,
85
        
86
    
87
        mongolianVert,
88
        
89
    
90
        wordArtVertRtl,
91
    }
92
    
93

94
    [Serializable]
95
    [XmlType(Namespace="http://schemas.openxmlformats.org/drawingml/2006/main")]
96
    [XmlRoot(Namespace="http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable=false)]
97
    public enum ST_TextWrappingType {
98
        
99
    
100
        none,
101
        
102
    
103
        square,
104
    }
105
    
106

107
    [Serializable]
108
    
109
    [System.ComponentModel.DesignerCategory("code")]
110
    [XmlType(Namespace="http://schemas.openxmlformats.org/drawingml/2006/main")]
111
    [XmlRoot(Namespace="http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable=true)]
112
    public class CT_TextListStyle {
113
        
114
        private CT_TextParagraphProperties defPPrField;
115
        
116
        private CT_TextParagraphProperties lvl1pPrField;
117
        
118
        private CT_TextParagraphProperties lvl2pPrField;
119
        
120
        private CT_TextParagraphProperties lvl3pPrField;
121
        
122
        private CT_TextParagraphProperties lvl4pPrField;
123
        
124
        private CT_TextParagraphProperties lvl5pPrField;
125
        
126
        private CT_TextParagraphProperties lvl6pPrField;
127
        
128
        private CT_TextParagraphProperties lvl7pPrField;
129
        
130
        private CT_TextParagraphProperties lvl8pPrField;
131
        
132
        private CT_TextParagraphProperties lvl9pPrField;
133
        
134
        private CT_OfficeArtExtensionList extLstField;
135

136
        public static CT_TextListStyle Parse(XmlNode node, XmlNamespaceManager namespaceManager)
137
        {
138
            if (node == null)
139
                return null;
140
            CT_TextListStyle ctObj = new CT_TextListStyle();
141
            foreach (XmlNode childNode in node.ChildNodes)
142
            {
143
                if (childNode.LocalName == "defPPr")
144
                    ctObj.defPPr = CT_TextParagraphProperties.Parse(childNode, namespaceManager);
145
                else if (childNode.LocalName == "lvl1pPr")
146
                    ctObj.lvl1pPr = CT_TextParagraphProperties.Parse(childNode, namespaceManager);
147
                else if (childNode.LocalName == "lvl2pPr")
148
                    ctObj.lvl2pPr = CT_TextParagraphProperties.Parse(childNode, namespaceManager);
149
                else if (childNode.LocalName == "lvl3pPr")
150
                    ctObj.lvl3pPr = CT_TextParagraphProperties.Parse(childNode, namespaceManager);
151
                else if (childNode.LocalName == "lvl4pPr")
152
                    ctObj.lvl4pPr = CT_TextParagraphProperties.Parse(childNode, namespaceManager);
153
                else if (childNode.LocalName == "lvl5pPr")
154
                    ctObj.lvl5pPr = CT_TextParagraphProperties.Parse(childNode, namespaceManager);
155
                else if (childNode.LocalName == "lvl6pPr")
156
                    ctObj.lvl6pPr = CT_TextParagraphProperties.Parse(childNode, namespaceManager);
157
                else if (childNode.LocalName == "lvl7pPr")
158
                    ctObj.lvl7pPr = CT_TextParagraphProperties.Parse(childNode, namespaceManager);
159
                else if (childNode.LocalName == "lvl8pPr")
160
                    ctObj.lvl8pPr = CT_TextParagraphProperties.Parse(childNode, namespaceManager);
161
                else if (childNode.LocalName == "lvl9pPr")
162
                    ctObj.lvl9pPr = CT_TextParagraphProperties.Parse(childNode, namespaceManager);
163
                else if (childNode.LocalName == "extLst")
164
                    ctObj.extLst = CT_OfficeArtExtensionList.Parse(childNode, namespaceManager);
165
            }
166
            return ctObj;
167
        }
168

169

170

171
        internal void Write(StreamWriter sw, string nodeName)
172
        {
173
            sw.Write(string.Format("<a:{0}", nodeName));
174
            sw.Write(">");
175
            if (this.defPPr != null)
176
                this.defPPr.Write(sw, "defPPr");
177
            if (this.lvl1pPr != null)
178
                this.lvl1pPr.Write(sw, "lvl1pPr");
179
            if (this.lvl2pPr != null)
180
                this.lvl2pPr.Write(sw, "lvl2pPr");
181
            if (this.lvl3pPr != null)
182
                this.lvl3pPr.Write(sw, "lvl3pPr");
183
            if (this.lvl4pPr != null)
184
                this.lvl4pPr.Write(sw, "lvl4pPr");
185
            if (this.lvl5pPr != null)
186
                this.lvl5pPr.Write(sw, "lvl5pPr");
187
            if (this.lvl6pPr != null)
188
                this.lvl6pPr.Write(sw, "lvl6pPr");
189
            if (this.lvl7pPr != null)
190
                this.lvl7pPr.Write(sw, "lvl7pPr");
191
            if (this.lvl8pPr != null)
192
                this.lvl8pPr.Write(sw, "lvl8pPr");
193
            if (this.lvl9pPr != null)
194
                this.lvl9pPr.Write(sw, "lvl9pPr");
195
            if (this.extLst != null)
196
                this.extLst.Write(sw, "extLst");
197
            sw.Write(string.Format("</a:{0}>", nodeName));
198
        }
199

200
        public CT_TextParagraphProperties defPPr {
201
            get {
202
                return this.defPPrField;
203
            }
204
            set {
205
                this.defPPrField = value;
206
            }
207
        }
208
        
209
    
210
        public CT_TextParagraphProperties lvl1pPr {
211
            get {
212
                return this.lvl1pPrField;
213
            }
214
            set {
215
                this.lvl1pPrField = value;
216
            }
217
        }
218
        
219
    
220
        public CT_TextParagraphProperties lvl2pPr {
221
            get {
222
                return this.lvl2pPrField;
223
            }
224
            set {
225
                this.lvl2pPrField = value;
226
            }
227
        }
228
        
229
    
230
        public CT_TextParagraphProperties lvl3pPr {
231
            get {
232
                return this.lvl3pPrField;
233
            }
234
            set {
235
                this.lvl3pPrField = value;
236
            }
237
        }
238
        
239
    
240
        public CT_TextParagraphProperties lvl4pPr {
241
            get {
242
                return this.lvl4pPrField;
243
            }
244
            set {
245
                this.lvl4pPrField = value;
246
            }
247
        }
248
        
249
    
250
        public CT_TextParagraphProperties lvl5pPr {
251
            get {
252
                return this.lvl5pPrField;
253
            }
254
            set {
255
                this.lvl5pPrField = value;
256
            }
257
        }
258
        
259
    
260
        public CT_TextParagraphProperties lvl6pPr {
261
            get {
262
                return this.lvl6pPrField;
263
            }
264
            set {
265
                this.lvl6pPrField = value;
266
            }
267
        }
268
        
269
    
270
        public CT_TextParagraphProperties lvl7pPr {
271
            get {
272
                return this.lvl7pPrField;
273
            }
274
            set {
275
                this.lvl7pPrField = value;
276
            }
277
        }
278
        
279
    
280
        public CT_TextParagraphProperties lvl8pPr {
281
            get {
282
                return this.lvl8pPrField;
283
            }
284
            set {
285
                this.lvl8pPrField = value;
286
            }
287
        }
288
        
289
    
290
        public CT_TextParagraphProperties lvl9pPr {
291
            get {
292
                return this.lvl9pPrField;
293
            }
294
            set {
295
                this.lvl9pPrField = value;
296
            }
297
        }
298
        
299
    
300
        public CT_OfficeArtExtensionList extLst {
301
            get {
302
                return this.extLstField;
303
            }
304
            set {
305
                this.extLstField = value;
306
            }
307
        }
308
    }
309
    
310

311
    [Serializable]
312
    
313
    [System.ComponentModel.DesignerCategory("code")]
314
    [XmlType(Namespace="http://schemas.openxmlformats.org/drawingml/2006/main")]
315
    [XmlRoot(Namespace="http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable=true)]
316
    public class CT_TextNormalAutofit {
317
        
318
        private int fontScaleField;
319
        
320
        private int lnSpcReductionField;
321
        
322
        public CT_TextNormalAutofit() {
323
            this.fontScaleField = 100000;
324
            this.lnSpcReductionField = 0;
325
        }
326
        public static CT_TextNormalAutofit Parse(XmlNode node, XmlNamespaceManager namespaceManager)
327
        {
328
            if (node == null)
329
                return null;
330
            CT_TextNormalAutofit ctObj = new CT_TextNormalAutofit();
331
            ctObj.fontScale = XmlHelper.ReadInt(node.Attributes["fontScale"]);
332
            ctObj.lnSpcReduction = XmlHelper.ReadInt(node.Attributes["lnSpcReduction"]);
333
            return ctObj;
334
        }
335

336

337

338
        internal void Write(StreamWriter sw, string nodeName)
339
        {
340
            sw.Write(string.Format("<a:{0}", nodeName));
341
            XmlHelper.WriteAttribute(sw, "fontScale", this.fontScale);
342
            XmlHelper.WriteAttribute(sw, "lnSpcReduction", this.lnSpcReduction);
343
            sw.Write(">");
344
            sw.Write(string.Format("</a:{0}>", nodeName));
345
        }
346
    
347
        [XmlAttribute]
348
        [DefaultValue(100000)]
349
        public int fontScale {
350
            get {
351
                return this.fontScaleField;
352
            }
353
            set {
354
                this.fontScaleField = value;
355
            }
356
        }
357
        
358
    
359
        [XmlAttribute]
360
        [DefaultValue(0)]
361
        public int lnSpcReduction {
362
            get {
363
                return this.lnSpcReductionField;
364
            }
365
            set {
366
                this.lnSpcReductionField = value;
367
            }
368
        }
369
    }
370
    
371

372
    [Serializable]
373
    
374
    [System.ComponentModel.DesignerCategory("code")]
375
    [XmlType(Namespace="http://schemas.openxmlformats.org/drawingml/2006/main")]
376
    [XmlRoot(Namespace="http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable=true)]
377
    public class CT_TextShapeAutofit {
378
    }
379
    
380

381
    [Serializable]
382
    
383
    [System.ComponentModel.DesignerCategory("code")]
384
    [XmlType(Namespace="http://schemas.openxmlformats.org/drawingml/2006/main")]
385
    [XmlRoot(Namespace="http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable=true)]
386
    public class CT_TextNoAutofit {
387
    }
388

389

390
    [Serializable]
391
    
392
    [System.ComponentModel.DesignerCategory("code")]
393
    [XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main")]
394
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable = true)]
395
    public class CT_TextBodyProperties
396
    {
397

398
        private CT_PresetTextShape prstTxWarpField;
399

400
        private CT_TextNoAutofit noAutofitField;
401

402
        private CT_TextNormalAutofit normAutofitField;
403

404
        private CT_TextShapeAutofit spAutoFitField;
405

406
        private CT_Scene3D scene3dField;
407

408
        private CT_Shape3D sp3dField;
409

410
        private CT_FlatText flatTxField;
411

412
        private CT_OfficeArtExtensionList extLstField;
413

414
        private int rotField;
415

416
        private bool rotFieldSpecified;
417

418
        private bool spcFirstLastParaField;
419

420
        private bool spcFirstLastParaFieldSpecified;
421

422
        private ST_TextVertOverflowType vertOverflowField;
423

424
        private bool vertOverflowFieldSpecified;
425

426
        private ST_TextHorzOverflowType horzOverflowField;
427

428
        private bool horzOverflowFieldSpecified;
429

430
        private ST_TextVerticalType vertField;
431

432
        private bool vertFieldSpecified;
433

434
        private ST_TextWrappingType wrapField;
435

436
        private bool wrapFieldSpecified;
437

438
        private int lInsField;
439

440
        private bool lInsFieldSpecified;
441

442
        private int tInsField;
443

444
        private bool tInsFieldSpecified;
445

446
        private int rInsField;
447

448
        private bool rInsFieldSpecified;
449

450
        private int bInsField;
451

452
        private bool bInsFieldSpecified;
453

454
        private int numColField;
455

456
        private bool numColFieldSpecified;
457

458
        private int spcColField;
459

460
        private bool spcColFieldSpecified;
461

462
        private bool rtlColField;
463

464
        private bool rtlColFieldSpecified;
465

466
        private bool fromWordArtField;
467

468
        private bool fromWordArtFieldSpecified;
469

470
        private ST_TextAnchoringType anchorField;
471

472
        private bool anchorFieldSpecified;
473

474
        private bool anchorCtrField;
475

476
        private bool anchorCtrFieldSpecified;
477

478
        private bool forceAAField;
479

480
        private bool forceAAFieldSpecified;
481

482
        private bool uprightField;
483

484
        private bool compatLnSpcField;
485

486
        private bool compatLnSpcFieldSpecified;
487

488
        public CT_TextBodyProperties()
489
        {
490
            this.uprightField = false;
491
            this.vertField = ST_TextVerticalType.horz;
492
            this.wrapField = ST_TextWrappingType.none;
493
            this.spcFirstLastParaField = false;
494
        }
495
        public static CT_TextBodyProperties Parse(XmlNode node, XmlNamespaceManager namespaceManager)
496
        {
497
            if (node == null)
498
                return null;
499
            CT_TextBodyProperties ctObj = new CT_TextBodyProperties();
500
            ctObj.rotFieldSpecified = node.Attributes["rot"] != null;
501
            ctObj.rotField = XmlHelper.ReadInt(node.Attributes["rot"]);
502
            ctObj.spcFirstLastPara = XmlHelper.ReadBool(node.Attributes["spcFirstLastPara"]);
503

504
            ctObj.vertOverflowFieldSpecified = node.Attributes["vertOverflow"] != null;
505
            if (node.Attributes["vertOverflow"] != null)
506
                ctObj.vertOverflowField = (ST_TextVertOverflowType)Enum.Parse(typeof(ST_TextVertOverflowType), node.Attributes["vertOverflow"].Value);
507
            ctObj.horzOverflowFieldSpecified = node.Attributes["horzOverflow"] != null;
508
            if (node.Attributes["horzOverflow"] != null)
509
                ctObj.horzOverflowField = (ST_TextHorzOverflowType)Enum.Parse(typeof(ST_TextHorzOverflowType), node.Attributes["horzOverflow"].Value);
510
            ctObj.vertFieldSpecified = node.Attributes["vert"] != null;
511
            if (node.Attributes["vert"] != null)
512
                ctObj.vertField = (ST_TextVerticalType)Enum.Parse(typeof(ST_TextVerticalType), node.Attributes["vert"].Value);
513
            ctObj.wrapFieldSpecified = node.Attributes["wrap"] != null;
514
            if (node.Attributes["wrap"] != null)
515
                ctObj.wrapField = (ST_TextWrappingType)Enum.Parse(typeof(ST_TextWrappingType), node.Attributes["wrap"].Value);
516
            ctObj.lIns = XmlHelper.ReadInt(node.Attributes["lIns"], 91440);
517
            ctObj.tIns = XmlHelper.ReadInt(node.Attributes["tIns"], 45720);
518
            ctObj.rIns = XmlHelper.ReadInt(node.Attributes["rIns"], 91440);
519
            ctObj.bIns = XmlHelper.ReadInt(node.Attributes["bIns"], 45720);
520
            ctObj.numCol = XmlHelper.ReadInt(node.Attributes["numCol"]);
521
            ctObj.spcCol = XmlHelper.ReadInt(node.Attributes["spcCol"]);
522
            ctObj.rtlCol = XmlHelper.ReadBool(node.Attributes["rtlCol"]);
523
            ctObj.fromWordArt = XmlHelper.ReadBool(node.Attributes["fromWordArt"]);
524
            ctObj.anchorFieldSpecified = node.Attributes["anchor"] != null;
525
            if (node.Attributes["anchor"] != null)
526
                ctObj.anchorField = (ST_TextAnchoringType)Enum.Parse(typeof(ST_TextAnchoringType), node.Attributes["anchor"].Value);
527
            ctObj.anchorCtr = XmlHelper.ReadBool(node.Attributes["anchorCtr"]);
528
            ctObj.forceAA = XmlHelper.ReadBool(node.Attributes["forceAA"]);
529
            ctObj.upright = XmlHelper.ReadBool(node.Attributes["upright"]);
530
            ctObj.compatLnSpc = XmlHelper.ReadBool(node.Attributes["compatLnSpc"]);
531
            foreach (XmlNode childNode in node.ChildNodes)
532
            {
533
                if (childNode.LocalName == "prstTxWarp")
534
                    ctObj.prstTxWarp = CT_PresetTextShape.Parse(childNode, namespaceManager);
535
                else if (childNode.LocalName == "noAutofit")
536
                    ctObj.noAutofit = new CT_TextNoAutofit();
537
                else if (childNode.LocalName == "normAutofit")
538
                    ctObj.normAutofit = CT_TextNormalAutofit.Parse(childNode, namespaceManager);
539
                else if (childNode.LocalName == "spAutoFit")
540
                    ctObj.spAutoFit = new CT_TextShapeAutofit();
541
                else if (childNode.LocalName == "scene3d")
542
                    ctObj.scene3d = CT_Scene3D.Parse(childNode, namespaceManager);
543
                else if (childNode.LocalName == "sp3d")
544
                    ctObj.sp3d = CT_Shape3D.Parse(childNode, namespaceManager);
545
                else if (childNode.LocalName == "flatTx")
546
                    ctObj.flatTx = CT_FlatText.Parse(childNode, namespaceManager);
547
                else if (childNode.LocalName == "extLst")
548
                    ctObj.extLst = CT_OfficeArtExtensionList.Parse(childNode, namespaceManager);
549
            }
550
            return ctObj;
551
        }
552

553

554

555
        internal void Write(StreamWriter sw, string nodeName)
556
        {
557
            sw.Write(string.Format("<a:{0}", nodeName));
558
            if(this.rotFieldSpecified)
559
                XmlHelper.WriteAttribute(sw, "rot", this.rotField,true);
560
            if(spcFirstLastPara)
561
                XmlHelper.WriteAttribute(sw, "spcFirstLastPara", this.spcFirstLastPara);
562
            if(this.vertOverflowFieldSpecified)
563
                XmlHelper.WriteAttribute(sw, "vertOverflow", this.vertOverflowField.ToString());
564
            if(this.horzOverflowFieldSpecified)
565
                XmlHelper.WriteAttribute(sw, "horzOverflow", this.horzOverflowField.ToString());
566
            if(this.vertFieldSpecified)
567
                XmlHelper.WriteAttribute(sw, "vert", this.vert.ToString());
568
            if(this.wrapFieldSpecified && this.wrap == ST_TextWrappingType.none)
569
                XmlHelper.WriteAttribute(sw, "wrap", this.wrap.ToString());
570
            XmlHelper.WriteAttribute(sw, "lIns", this.lIns, 91440);
571
            XmlHelper.WriteAttribute(sw, "tIns", this.tIns, 45720);
572
            XmlHelper.WriteAttribute(sw, "rIns", this.rIns, 91440);
573
            XmlHelper.WriteAttribute(sw, "bIns", this.bIns, 45720);
574
            XmlHelper.WriteAttribute(sw, "numCol", this.numCol);
575
            XmlHelper.WriteAttribute(sw, "spcCol", this.spcCol);
576
            XmlHelper.WriteAttribute(sw, "rtlCol", this.rtlCol);
577
            XmlHelper.WriteAttribute(sw, "fromWordArt", this.fromWordArt, false);
578
            if(this.anchorFieldSpecified)
579
                XmlHelper.WriteAttribute(sw, "anchor", this.anchorField.ToString());
580
            XmlHelper.WriteAttribute(sw, "anchorCtr", this.anchorCtr, false);
581
            XmlHelper.WriteAttribute(sw, "forceAA", this.forceAA, false);
582
            if(upright)
583
                XmlHelper.WriteAttribute(sw, "upright", this.upright);
584
            if (compatLnSpc)
585
                XmlHelper.WriteAttribute(sw, "compatLnSpc", this.compatLnSpc);
586
            sw.Write(">");
587
            if (this.prstTxWarp != null)
588
                this.prstTxWarp.Write(sw, "prstTxWarp");
589
            if (this.noAutofit != null)
590
                sw.Write("<a:noAutofit/>");
591
            if (this.normAutofit != null)
592
                this.normAutofit.Write(sw, "normAutofit");
593
            if (this.spAutoFit != null)
594
                sw.Write("<a:spAutoFit/>");
595
            if (this.scene3d != null)
596
                this.scene3d.Write(sw, "scene3d");
597
            if (this.sp3d != null)
598
                this.sp3d.Write(sw, "sp3d");
599
            if (this.flatTx != null)
600
                this.flatTx.Write(sw, "flatTx");
601
            if (this.extLst != null)
602
                this.extLst.Write(sw, "extLst");
603
            sw.Write(string.Format("</a:{0}>", nodeName));
604
        }
605

606
        public CT_PresetTextShape prstTxWarp
607
        {
608
            get
609
            {
610
                return this.prstTxWarpField;
611
            }
612
            set
613
            {
614
                this.prstTxWarpField = value;
615
            }
616
        }
617

618
        public CT_TextNoAutofit noAutofit
619
        {
620
            get
621
            {
622
                return this.noAutofitField;
623
            }
624
            set
625
            {
626
                this.noAutofitField = value;
627
            }
628
        }
629

630
        public CT_TextNormalAutofit normAutofit
631
        {
632
            get
633
            {
634
                return this.normAutofitField;
635
            }
636
            set
637
            {
638
                this.normAutofitField = value;
639
            }
640
        }
641
        public CT_TextShapeAutofit spAutoFit
642
        {
643
            get
644
            {
645
                return this.spAutoFitField;
646
            }
647
            set
648
            {
649
                this.spAutoFitField = value;
650
            }
651
        }
652

653

654
        public CT_Scene3D scene3d
655
        {
656
            get
657
            {
658
                return this.scene3dField;
659
            }
660
            set
661
            {
662
                this.scene3dField = value;
663
            }
664
        }
665

666

667
        public CT_Shape3D sp3d
668
        {
669
            get
670
            {
671
                return this.sp3dField;
672
            }
673
            set
674
            {
675
                this.sp3dField = value;
676
            }
677
        }
678

679

680
        public CT_FlatText flatTx
681
        {
682
            get
683
            {
684
                return this.flatTxField;
685
            }
686
            set
687
            {
688
                this.flatTxField = value;
689
            }
690
        }
691

692

693
        public CT_OfficeArtExtensionList extLst
694
        {
695
            get
696
            {
697
                return this.extLstField;
698
            }
699
            set
700
            {
701
                this.extLstField = value;
702
            }
703
        }
704

705

706
        [XmlAttribute]
707
        public int rot
708
        {
709
            get
710
            {
711
                return this.rotField;
712
            }
713
            set
714
            {
715
                this.rotField = value;
716
                this.rotFieldSpecified = true;
717
            }
718
        }
719

720

721
        [XmlIgnore]
722
        public bool rotSpecified
723
        {
724
            get
725
            {
726
                return this.rotFieldSpecified;
727
            }
728
            set
729
            {
730
                this.rotFieldSpecified = value;
731
            }
732
        }
733

734

735
        [XmlAttribute]
736
        public bool spcFirstLastPara
737
        {
738
            get
739
            {
740
                return this.spcFirstLastParaField;
741
            }
742
            set
743
            {
744
                this.spcFirstLastParaField = value;
745
                this.spcFirstLastParaFieldSpecified = value;
746
            }
747
        }
748

749

750
        [XmlIgnore]
751
        public bool spcFirstLastParaSpecified
752
        {
753
            get
754
            {
755
                return this.spcFirstLastParaFieldSpecified;
756
            }
757
            set
758
            {
759
                this.spcFirstLastParaFieldSpecified = value;
760
            }
761
        }
762

763

764
        [XmlAttribute]
765
        public ST_TextVertOverflowType vertOverflow
766
        {
767
            get
768
            {
769
                return this.vertOverflowField;
770
            }
771
            set
772
            {
773
                this.vertOverflowField = value;
774
                this.vertOverflowFieldSpecified = true;
775
            }
776
        }
777

778

779
        [XmlIgnore]
780
        public bool vertOverflowSpecified
781
        {
782
            get
783
            {
784
                return this.vertOverflowFieldSpecified;
785
            }
786
            set
787
            {
788
                this.vertOverflowFieldSpecified = value;
789
            }
790
        }
791

792

793
        [XmlAttribute]
794
        public ST_TextHorzOverflowType horzOverflow
795
        {
796
            get
797
            {
798
                return this.horzOverflowField;
799
            }
800
            set
801
            {
802
                this.horzOverflowField = value;
803
                this.horzOverflowFieldSpecified = true;
804
            }
805
        }
806

807

808
        [XmlIgnore]
809
        public bool horzOverflowSpecified
810
        {
811
            get
812
            {
813
                return this.horzOverflowFieldSpecified;
814
            }
815
            set
816
            {
817
                this.horzOverflowFieldSpecified = value;
818
            }
819
        }
820

821

822
        [XmlAttribute]
823
        public ST_TextVerticalType vert
824
        {
825
            get
826
            {
827
                return this.vertField;
828
            }
829
            set
830
            {
831
                this.vertField = value;
832
                this.vertFieldSpecified = true;
833
            }
834
        }
835

836

837
        [XmlIgnore]
838
        public bool vertSpecified
839
        {
840
            get
841
            {
842
                return this.vertFieldSpecified;
843
            }
844
            set
845
            {
846
                this.vertFieldSpecified = value;
847
            }
848
        }
849

850

851
        [XmlAttribute]
852
        public ST_TextWrappingType wrap
853
        {
854
            get
855
            {
856
                return this.wrapField;
857
            }
858
            set
859
            {
860
                this.wrapField = value;
861
                this.wrapFieldSpecified = true;
862
            }
863
        }
864

865

866
        [XmlIgnore]
867
        public bool wrapSpecified
868
        {
869
            get
870
            {
871
                return this.wrapFieldSpecified;
872
            }
873
            set
874
            {
875
                this.wrapFieldSpecified = value;
876
            }
877
        }
878

879

880
        [XmlAttribute]
881
        public int lIns
882
        {
883
            get
884
            {
885
                return this.lInsField;
886
            }
887
            set
888
            {
889
                this.lInsField = value;
890
                this.lInsFieldSpecified = value == 91440 ? false : true;
891
            }
892
        }
893

894

895
        [XmlIgnore]
896
        public bool lInsSpecified
897
        {
898
            get
899
            {
900
                return this.lInsFieldSpecified;
901
            }
902
            set
903
            {
904
                this.lInsFieldSpecified = value;
905
            }
906
        }
907

908

909
        [XmlAttribute]
910
        public int tIns
911
        {
912
            get
913
            {
914
                return this.tInsField;
915
            }
916
            set
917
            {
918
                this.tInsField = value;
919
                this.tInsFieldSpecified = value == 45720 ? false : true;
920
            }
921
        }
922

923

924
        [XmlIgnore]
925
        public bool tInsSpecified
926
        {
927
            get
928
            {
929
                return this.tInsFieldSpecified;
930
            }
931
            set
932
            {
933
                this.tInsFieldSpecified = value;
934
            }
935
        }
936

937

938
        [XmlAttribute]
939
        public int rIns
940
        {
941
            get
942
            {
943
                return this.rInsField;
944
            }
945
            set
946
            {
947
                this.rInsField = value;
948
                this.rInsFieldSpecified = value == 91440 ? false : true;
949
            }
950
        }
951

952

953
        [XmlIgnore]
954
        public bool rInsSpecified
955
        {
956
            get
957
            {
958
                return this.rInsFieldSpecified;
959
            }
960
            set
961
            {
962
                this.rInsFieldSpecified = value;
963
            }
964
        }
965

966

967
        [XmlAttribute]
968
        public int bIns
969
        {
970
            get
971
            {
972
                return this.bInsField;
973
            }
974
            set
975
            {
976
                this.bInsField = value;
977
                this.bInsFieldSpecified = value == 45720 ? false : true;
978
            }
979
        }
980

981

982
        [XmlIgnore]
983
        public bool bInsSpecified
984
        {
985
            get
986
            {
987
                return this.bInsFieldSpecified;
988
            }
989
            set
990
            {
991
                this.bInsFieldSpecified = value;
992
            }
993
        }
994

995

996
        [XmlAttribute]
997
        public int numCol
998
        {
999
            get
1000
            {
1001
                return this.numColField;
1002
            }
1003
            set
1004
            {
1005
                this.numColField = value;
1006
                this.numColFieldSpecified = true;
1007
            }
1008
        }
1009

1010

1011
        [XmlIgnore]
1012
        public bool numColSpecified
1013
        {
1014
            get
1015
            {
1016
                return this.numColFieldSpecified;
1017
            }
1018
            set
1019
            {
1020
                this.numColFieldSpecified = value;
1021
            }
1022
        }
1023

1024

1025
        [XmlAttribute]
1026
        public int spcCol
1027
        {
1028
            get
1029
            {
1030
                return this.spcColField;
1031
            }
1032
            set
1033
            {
1034
                this.spcColField = value;
1035
                this.spcColFieldSpecified = true;
1036
            }
1037
        }
1038

1039

1040
        [XmlIgnore]
1041
        public bool spcColSpecified
1042
        {
1043
            get
1044
            {
1045
                return this.spcColFieldSpecified;
1046
            }
1047
            set
1048
            {
1049
                this.spcColFieldSpecified = value;
1050
            }
1051
        }
1052

1053

1054
        [XmlAttribute]
1055
        public bool rtlCol
1056
        {
1057
            get
1058
            {
1059
                return this.rtlColField;
1060
            }
1061
            set
1062
            {
1063
                this.rtlColField = value;
1064
                this.rtlColFieldSpecified = value;
1065
            }
1066
        }
1067

1068

1069
        [XmlIgnore]
1070
        public bool rtlColSpecified
1071
        {
1072
            get
1073
            {
1074
                return this.rtlColFieldSpecified;
1075
            }
1076
            set
1077
            {
1078
                this.rtlColFieldSpecified = value;
1079
            }
1080
        }
1081

1082

1083
        [XmlAttribute]
1084
        public bool fromWordArt
1085
        {
1086
            get
1087
            {
1088
                return this.fromWordArtField;
1089
            }
1090
            set
1091
            {
1092
                this.fromWordArtField = value;
1093
                this.fromWordArtFieldSpecified = value;
1094
            }
1095
        }
1096

1097

1098
        [XmlIgnore]
1099
        public bool fromWordArtSpecified
1100
        {
1101
            get
1102
            {
1103
                return this.fromWordArtFieldSpecified;
1104
            }
1105
            set
1106
            {
1107
                this.fromWordArtFieldSpecified = value;
1108
            }
1109
        }
1110

1111

1112
        [XmlAttribute]
1113
        public ST_TextAnchoringType anchor
1114
        {
1115
            get
1116
            {
1117
                return this.anchorField;
1118
            }
1119
            set
1120
            {
1121
                this.anchorField = value;
1122
                this.anchorFieldSpecified = true;
1123
            }
1124
        }
1125

1126

1127
        [XmlIgnore]
1128
        public bool anchorSpecified
1129
        {
1130
            get
1131
            {
1132
                return this.anchorFieldSpecified;
1133
            }
1134
            set
1135
            {
1136
                this.anchorFieldSpecified = value;
1137
            }
1138
        }
1139

1140

1141
        [XmlAttribute]
1142
        public bool anchorCtr
1143
        {
1144
            get
1145
            {
1146
                return this.anchorCtrField;
1147
            }
1148
            set
1149
            {
1150
                this.anchorCtrField = value;
1151
                this.anchorCtrFieldSpecified = value;
1152
            }
1153
        }
1154

1155

1156
        [XmlIgnore]
1157
        public bool anchorCtrSpecified
1158
        {
1159
            get
1160
            {
1161
                return this.anchorCtrFieldSpecified;
1162
            }
1163
            set
1164
            {
1165
                this.anchorCtrFieldSpecified = value;
1166
            }
1167
        }
1168

1169

1170
        [XmlAttribute]
1171
        public bool forceAA
1172
        {
1173
            get
1174
            {
1175
                return this.forceAAField;
1176
            }
1177
            set
1178
            {
1179
                this.forceAAField = value;
1180
                this.forceAAFieldSpecified = value;
1181
            }
1182
        }
1183

1184

1185
        [XmlIgnore]
1186
        public bool forceAASpecified
1187
        {
1188
            get
1189
            {
1190
                return this.forceAAFieldSpecified;
1191
            }
1192
            set
1193
            {
1194
                this.forceAAFieldSpecified = value;
1195
            }
1196
        }
1197

1198

1199
        [XmlAttribute]
1200
        [DefaultValue(false)]
1201
        public bool upright
1202
        {
1203
            get
1204
            {
1205
                return this.uprightField;
1206
            }
1207
            set
1208
            {
1209
                this.uprightField = value;
1210
            }
1211
        }
1212

1213

1214
        [XmlAttribute]
1215
        public bool compatLnSpc
1216
        {
1217
            get
1218
            {
1219
                return this.compatLnSpcField;
1220
            }
1221
            set
1222
            {
1223
                this.compatLnSpcField = value;
1224
                this.compatLnSpcFieldSpecified = value;
1225
            }
1226
        }
1227

1228

1229
        [XmlIgnore]
1230
        public bool compatLnSpcSpecified
1231
        {
1232
            get
1233
            {
1234
                return this.compatLnSpcFieldSpecified;
1235
            }
1236
            set
1237
            {
1238
                this.compatLnSpcFieldSpecified = value;
1239
            }
1240
        }
1241

1242
        public void UnsetTIns()
1243
        {
1244
            this.tInsFieldSpecified = false;
1245
        }
1246

1247
        public void UnsetVertOverflow()
1248
        {
1249
            this.vertOverflowFieldSpecified = false;
1250
        }
1251

1252
        public void UnsetVert()
1253
        {
1254
            this.vertFieldSpecified = false;
1255
        }
1256

1257
        public bool IsSetVert()
1258
        {
1259
            return this.vertFieldSpecified;
1260
        }
1261

1262
        public bool IsSetBIns()
1263
        {
1264
            return this.bInsFieldSpecified;
1265
        }
1266

1267
        public bool IsSetLIns()
1268
        {
1269
            return this.lInsFieldSpecified;
1270
        }
1271

1272
        public bool IsSetRIns()
1273
        {
1274
            return this.rInsFieldSpecified;
1275
        }
1276

1277
        public bool IsSetTIns()
1278
        {
1279
            return this.tInsFieldSpecified;
1280
        }
1281

1282
        public void UnsetBIns()
1283
        {
1284
            this.bInsFieldSpecified = false;
1285
        }
1286

1287
        public void UnsetLIns()
1288
        {
1289
            this.lInsFieldSpecified = false;
1290
        }
1291

1292
        public void UnsetRIns()
1293
        {
1294
            this.rInsFieldSpecified = false;
1295
        }
1296

1297
        public bool IsSetSpAutoFit()
1298
        {
1299
            return this.spAutoFitField != null;
1300
        }
1301

1302
        public bool IsSetNoAutofit()
1303
        {
1304
            return this.noAutofitField != null;
1305
        }
1306

1307
        public bool IsSetNormAutofit()
1308
        {
1309
            return this.normAutofitField != null;
1310
        }
1311

1312
        public void UnsetSpAutoFit()
1313
        {
1314
            this.spAutoFitField = null;
1315
        }
1316

1317
        public void UnsetNoAutofit()
1318
        {
1319
            this.noAutofitField = null;
1320
        }
1321

1322
        public void UnsetNormAutofit()
1323
        {
1324
            this.normAutofitField = null;
1325
        }
1326

1327
        public CT_TextNoAutofit AddNewNoAutofit()
1328
        {
1329
            this.noAutofitField = new CT_TextNoAutofit();
1330
            return this.noAutofitField;
1331
        }
1332

1333
        public CT_TextNormalAutofit AddNewNormAutofit()
1334
        {
1335
            this.normAutofitField = new CT_TextNormalAutofit();
1336
            return this.normAutofitField;
1337
        }
1338

1339
        public CT_TextShapeAutofit AddNewSpAutoFit()
1340
        {
1341
            this.spAutoFitField = new CT_TextShapeAutofit();
1342
            return this.spAutoFitField;
1343
        }
1344

1345
        public void UnsetHorzOverflow()
1346
        {
1347
            this.horzOverflowFieldSpecified = false;
1348
        }
1349

1350
        public bool IsSetHorzOverflow()
1351
        {
1352
            return this.horzOverflowFieldSpecified;
1353
        }
1354

1355

1356
        public bool IsSetVertOverflow()
1357
        {
1358
            return this.vertOverflowFieldSpecified;
1359
        }
1360

1361
        public bool IsSetAnchor()
1362
        {
1363
            return this.anchorFieldSpecified;
1364
        }
1365

1366
        public void UnsetAnchor()
1367
        {
1368
            this.anchorFieldSpecified = false;
1369
        }
1370

1371
        public bool IsSetWrap()
1372
        {
1373
            return this.wrapFieldSpecified;
1374
        }
1375
        public void UnsetWrap()
1376
        {
1377
            this.wrapFieldSpecified = false;
1378
        }
1379
    }
1380
    
1381

1382
    [Serializable]
1383
    
1384
    [System.ComponentModel.DesignerCategory("code")]
1385
    [XmlType(Namespace="http://schemas.openxmlformats.org/drawingml/2006/main")]
1386
    [XmlRoot(Namespace="http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable=true)]
1387
    public class CT_TextBody {
1388
        
1389
        private CT_TextBodyProperties bodyPrField;
1390
        
1391
        private CT_TextListStyle lstStyleField;
1392
        
1393
        private List<CT_TextParagraph> pField;
1394

1395
        public static CT_TextBody Parse(XmlNode node, XmlNamespaceManager namespaceManager)
1396
        {
1397
            if (node == null)
1398
                return null;
1399
            CT_TextBody ctObj = new CT_TextBody();
1400
            ctObj.p = new List<CT_TextParagraph>();
1401
            foreach (XmlNode childNode in node.ChildNodes)
1402
            {
1403
                if (childNode.LocalName == "bodyPr")
1404
                    ctObj.bodyPr = CT_TextBodyProperties.Parse(childNode, namespaceManager);
1405
                else if (childNode.LocalName == "lstStyle")
1406
                    ctObj.lstStyle = CT_TextListStyle.Parse(childNode, namespaceManager);
1407
                else if (childNode.LocalName == "p")
1408
                    ctObj.p.Add(CT_TextParagraph.Parse(childNode, namespaceManager));
1409
            }
1410
            return ctObj;
1411
        }
1412

1413

1414

1415
        internal void Write(StreamWriter sw, string nodeName)
1416
        {
1417
            sw.Write(string.Format("<a:{0}", nodeName));
1418
            sw.Write(">");
1419
            if (this.bodyPr != null)
1420
                this.bodyPr.Write(sw, "bodyPr");
1421
            if (this.lstStyle != null)
1422
                this.lstStyle.Write(sw, "lstStyle");
1423
            foreach (CT_TextParagraph x in this.p)
1424
            {
1425
                x.Write(sw, "p");
1426
            }
1427
            sw.Write(string.Format("</a:{0}>", nodeName));
1428
        }
1429

1430
        public void SetPArray(CT_TextParagraph[] array)
1431
        {
1432
            pField = new List<CT_TextParagraph>(array);
1433
        }
1434
        public CT_TextParagraph AddNewP()
1435
        {
1436
            if (this.pField == null)
1437
                pField = new List<CT_TextParagraph>();
1438
            CT_TextParagraph tp = new CT_TextParagraph();
1439
            pField.Add(tp);
1440
            return tp;
1441
        }
1442
        public CT_TextBodyProperties AddNewBodyPr()
1443
        {
1444
            this.bodyPrField = new CT_TextBodyProperties();
1445
            return this.bodyPrField;
1446
        }
1447
        public CT_TextListStyle AddNewLstStyle()
1448
        {
1449
                this.lstStyleField=new CT_TextListStyle();
1450
            return this.lstStyleField;   
1451
        }
1452
    
1453
        public CT_TextBodyProperties bodyPr {
1454
            get {
1455
                return this.bodyPrField;
1456
            }
1457
            set {
1458
                this.bodyPrField = value;
1459
            }
1460
        }
1461
        
1462
    
1463
        public CT_TextListStyle lstStyle {
1464
            get {
1465
                return this.lstStyleField;
1466
            }
1467
            set {
1468
                this.lstStyleField = value;
1469
            }
1470
        }
1471
        public override string ToString()
1472
        {
1473
            if (p == null||p.Count==0)
1474
                return string.Empty;
1475
            StringBuilder sb = new StringBuilder();
1476
            foreach (CT_TextParagraph tp in p)
1477
            {
1478
                foreach (CT_RegularTextRun tr in tp.r)
1479
                {
1480
                    sb.Append(tr.t);
1481
                }
1482
            }
1483
            return sb.ToString();
1484
        }
1485
    
1486
        [XmlElement("p")]
1487
        public List<CT_TextParagraph> p {
1488
            get {
1489
                return this.pField;
1490
            }
1491
            set {
1492
                this.pField = value;
1493
            }
1494
        }
1495
    }
1496
}
1497

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

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

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

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