npoi

Форк
0
6168 строк · 208.6 Кб
1
using System;
2
using System.Collections.Generic;
3
using System.Xml.Serialization;
4
using NPOI.OpenXmlFormats.Shared;
5
using System.IO;
6
using System.Xml;
7
using System.Collections;
8
using NPOI.OpenXml4Net.Util;
9
using System.Linq;
10
using NPOI.Util;
11

12
namespace NPOI.OpenXmlFormats.Wordprocessing
13
{
14

15

16
    [Serializable]
17
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
18
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
19
    public class CT_Tbl
20
    {
21
        //EG_RangeMarkupElements
22
        private ArrayList itemsField;
23

24
        private List<ItemsChoiceType30> itemsElementNameField;
25

26
        private CT_TblPr tblPrField;
27

28
        private CT_TblGrid tblGridField;
29

30
        private ArrayList items1Field;
31

32
        private List<Items1ChoiceType> items1ElementNameField;
33

34
        public CT_Tbl()
35
        {
36
            this.items1ElementNameField = new List<Items1ChoiceType>();
37
            this.items1Field = new ArrayList();
38
            //this.tblGridField = new CT_TblGrid();
39
            //this.tblPrField = new CT_TblPr();
40
            this.itemsElementNameField = new List<ItemsChoiceType30>();
41
            this.itemsField = new ArrayList();
42
        }
43
        public static CT_Tbl Parse(XmlNode node, XmlNamespaceManager namespaceManager)
44
        {
45
            if (node == null)
46
                return null;
47
            CT_Tbl ctObj = new CT_Tbl();
48
            foreach (XmlNode childNode in node.ChildNodes)
49
            {
50
                if (childNode.LocalName == "customXmlMoveToRangeEnd")
51
                {
52
                    ctObj.Items.Add(CT_Markup.Parse(childNode, namespaceManager));
53
                    ctObj.ItemsElementName.Add(ItemsChoiceType30.customXmlMoveToRangeEnd);
54
                }
55
                else if (childNode.LocalName == "tblPr")
56
                    ctObj.tblPr = CT_TblPr.Parse(childNode, namespaceManager);
57
                else if (childNode.LocalName == "tblGrid")
58
                    ctObj.tblGrid = CT_TblGrid.Parse(childNode, namespaceManager);
59

60
                else if (childNode.LocalName == "moveToRangeEnd")
61
                {
62
                    ctObj.Items.Add(CT_MarkupRange.Parse(childNode, namespaceManager));
63
                    ctObj.ItemsElementName.Add(ItemsChoiceType30.moveToRangeEnd);
64
                }
65
                else if (childNode.LocalName == "moveToRangeStart")
66
                {
67
                    ctObj.Items.Add(CT_MoveBookmark.Parse(childNode, namespaceManager));
68
                    ctObj.ItemsElementName.Add(ItemsChoiceType30.moveToRangeStart);
69
                }
70
                else if (childNode.LocalName == "customXmlDelRangeEnd")
71
                {
72
                    ctObj.Items.Add(CT_Markup.Parse(childNode, namespaceManager));
73
                    ctObj.ItemsElementName.Add(ItemsChoiceType30.customXmlDelRangeEnd);
74
                }
75
                else if (childNode.LocalName == "moveFromRangeStart")
76
                {
77
                    ctObj.Items.Add(CT_MoveBookmark.Parse(childNode, namespaceManager));
78
                    ctObj.ItemsElementName.Add(ItemsChoiceType30.moveFromRangeStart);
79
                }
80
                else if (childNode.LocalName == "bookmarkEnd")
81
                {
82
                    ctObj.Items.Add(CT_MarkupRange.Parse(childNode, namespaceManager));
83
                    ctObj.ItemsElementName.Add(ItemsChoiceType30.bookmarkEnd);
84
                }
85
                else if (childNode.LocalName == "bookmarkStart")
86
                {
87
                    ctObj.Items.Add(CT_Bookmark.Parse(childNode, namespaceManager));
88
                    ctObj.ItemsElementName.Add(ItemsChoiceType30.bookmarkStart);
89
                }
90
                else if (childNode.LocalName == "commentRangeEnd")
91
                {
92
                    ctObj.Items.Add(CT_MarkupRange.Parse(childNode, namespaceManager));
93
                    ctObj.ItemsElementName.Add(ItemsChoiceType30.commentRangeEnd);
94
                }
95
                else if (childNode.LocalName == "commentRangeStart")
96
                {
97
                    ctObj.Items.Add(CT_MarkupRange.Parse(childNode, namespaceManager));
98
                    ctObj.ItemsElementName.Add(ItemsChoiceType30.commentRangeStart);
99
                }
100
                else if (childNode.LocalName == "customXmlMoveToRangeStart")
101
                {
102
                    ctObj.Items.Add(CT_TrackChange.Parse(childNode, namespaceManager));
103
                    ctObj.ItemsElementName.Add(ItemsChoiceType30.customXmlMoveToRangeStart);
104
                }
105
                else if (childNode.LocalName == "customXmlInsRangeEnd")
106
                {
107
                    ctObj.Items.Add(CT_Markup.Parse(childNode, namespaceManager));
108
                    ctObj.ItemsElementName.Add(ItemsChoiceType30.customXmlInsRangeEnd);
109
                }
110
                else if (childNode.LocalName == "customXmlInsRangeStart")
111
                {
112
                    ctObj.Items.Add(CT_TrackChange.Parse(childNode, namespaceManager));
113
                    ctObj.ItemsElementName.Add(ItemsChoiceType30.customXmlInsRangeStart);
114
                }
115
                else if (childNode.LocalName == "customXmlDelRangeStart")
116
                {
117
                    ctObj.Items.Add(CT_TrackChange.Parse(childNode, namespaceManager));
118
                    ctObj.ItemsElementName.Add(ItemsChoiceType30.customXmlDelRangeStart);
119
                }
120
                else if (childNode.LocalName == "customXmlMoveFromRangeEnd")
121
                {
122
                    ctObj.Items.Add(CT_Markup.Parse(childNode, namespaceManager));
123
                    ctObj.ItemsElementName.Add(ItemsChoiceType30.customXmlMoveFromRangeEnd);
124
                }
125
                else if (childNode.LocalName == "customXmlMoveFromRangeStart")
126
                {
127
                    ctObj.Items.Add(CT_TrackChange.Parse(childNode, namespaceManager));
128
                    ctObj.ItemsElementName.Add(ItemsChoiceType30.customXmlMoveFromRangeStart);
129
                }
130
                else if (childNode.LocalName == "moveFromRangeEnd")
131
                {
132
                    ctObj.Items.Add(CT_MarkupRange.Parse(childNode, namespaceManager));
133
                    ctObj.ItemsElementName.Add(ItemsChoiceType30.moveFromRangeEnd);
134
                }
135
                else if (childNode.LocalName == "sdt")
136
                {
137
                    ctObj.Items1.Add(CT_SdtRow.Parse(childNode, namespaceManager));
138
                    ctObj.Items1ElementName.Add(Items1ChoiceType.sdt);
139
                }
140
                else if (childNode.LocalName == "customXml")
141
                {
142
                    ctObj.Items1.Add(CT_CustomXmlRow.Parse(childNode, namespaceManager));
143
                    ctObj.Items1ElementName.Add(Items1ChoiceType.customXml);
144
                }
145
                else if (childNode.LocalName == "customXmlInsRangeEnd")
146
                {
147
                    ctObj.Items1.Add(CT_Markup.Parse(childNode, namespaceManager));
148
                    ctObj.Items1ElementName.Add(Items1ChoiceType.customXmlInsRangeEnd);
149
                }
150
                else if (childNode.LocalName == "customXmlInsRangeStart")
151
                {
152
                    ctObj.Items1.Add(CT_TrackChange.Parse(childNode, namespaceManager));
153
                    ctObj.Items1ElementName.Add(Items1ChoiceType.customXmlInsRangeStart);
154
                }
155
                else if (childNode.LocalName == "customXmlMoveFromRangeEnd")
156
                {
157
                    ctObj.Items1.Add(CT_Markup.Parse(childNode, namespaceManager));
158
                    ctObj.Items1ElementName.Add(Items1ChoiceType.customXmlMoveFromRangeEnd);
159
                }
160
                else if (childNode.LocalName == "customXmlMoveFromRangeStart")
161
                {
162
                    ctObj.Items1.Add(CT_TrackChange.Parse(childNode, namespaceManager));
163
                    ctObj.Items1ElementName.Add(Items1ChoiceType.customXmlMoveFromRangeStart);
164
                }
165
                else if (childNode.LocalName == "customXmlMoveToRangeEnd")
166
                {
167
                    ctObj.Items1.Add(CT_Markup.Parse(childNode, namespaceManager));
168
                    ctObj.Items1ElementName.Add(Items1ChoiceType.customXmlMoveToRangeEnd);
169
                }
170
                else if (childNode.LocalName == "customXmlMoveToRangeStart")
171
                {
172
                    ctObj.Items1.Add(CT_TrackChange.Parse(childNode, namespaceManager));
173
                    ctObj.Items1ElementName.Add(Items1ChoiceType.customXmlMoveToRangeStart);
174
                }
175
                else if (childNode.LocalName == "del")
176
                {
177
                    ctObj.Items1.Add(CT_RunTrackChange.Parse(childNode, namespaceManager));
178
                    ctObj.Items1ElementName.Add(Items1ChoiceType.del);
179
                }
180
                else if (childNode.LocalName == "ins")
181
                {
182
                    ctObj.Items1.Add(CT_RunTrackChange.Parse(childNode, namespaceManager));
183
                    ctObj.Items1ElementName.Add(Items1ChoiceType.ins);
184
                }
185
                else if (childNode.LocalName == "moveFrom")
186
                {
187
                    ctObj.Items1.Add(CT_RunTrackChange.Parse(childNode, namespaceManager));
188
                    ctObj.Items1ElementName.Add(Items1ChoiceType.moveFrom);
189
                }
190
                else if (childNode.LocalName == "moveFromRangeEnd")
191
                {
192
                    ctObj.Items1.Add(CT_MarkupRange.Parse(childNode, namespaceManager));
193
                    ctObj.Items1ElementName.Add(Items1ChoiceType.moveFromRangeEnd);
194
                }
195
                else if (childNode.LocalName == "commentRangeStart")
196
                {
197
                    ctObj.Items1.Add(CT_MarkupRange.Parse(childNode, namespaceManager));
198
                    ctObj.Items1ElementName.Add(Items1ChoiceType.commentRangeStart);
199
                }
200
                else if (childNode.LocalName == "moveTo")
201
                {
202
                    ctObj.Items1.Add(CT_RunTrackChange.Parse(childNode, namespaceManager));
203
                    ctObj.Items1ElementName.Add(Items1ChoiceType.moveTo);
204
                }
205
                else if (childNode.LocalName == "moveToRangeEnd")
206
                {
207
                    ctObj.Items1.Add(CT_MarkupRange.Parse(childNode, namespaceManager));
208
                    ctObj.Items1ElementName.Add(Items1ChoiceType.moveToRangeEnd);
209
                }
210
                else if (childNode.LocalName == "moveToRangeStart")
211
                {
212
                    ctObj.Items1.Add(CT_MoveBookmark.Parse(childNode, namespaceManager));
213
                    ctObj.Items1ElementName.Add(Items1ChoiceType.moveToRangeStart);
214
                }
215
                else if (childNode.LocalName == "permEnd")
216
                {
217
                    ctObj.Items1.Add(CT_Perm.Parse(childNode, namespaceManager));
218
                    ctObj.Items1ElementName.Add(Items1ChoiceType.permEnd);
219
                }
220
                else if (childNode.LocalName == "permStart")
221
                {
222
                    ctObj.Items1.Add(CT_PermStart.Parse(childNode, namespaceManager));
223
                    ctObj.Items1ElementName.Add(Items1ChoiceType.permStart);
224
                }
225
                else if (childNode.LocalName == "proofErr")
226
                {
227
                    ctObj.Items1.Add(CT_ProofErr.Parse(childNode, namespaceManager));
228
                    ctObj.Items1ElementName.Add(Items1ChoiceType.proofErr);
229
                }
230
                else if (childNode.LocalName == "oMath")
231
                {
232
                    ctObj.Items1.Add(CT_OMath.Parse(childNode, namespaceManager));
233
                    ctObj.Items1ElementName.Add(Items1ChoiceType.oMath);
234
                }
235
                else if (childNode.LocalName == "tr")
236
                {
237
                    ctObj.Items1.Add(CT_Row.Parse(childNode, namespaceManager, ctObj));
238
                    ctObj.Items1ElementName.Add(Items1ChoiceType.tr);
239
                }
240
                else if (childNode.LocalName == "moveFromRangeStart")
241
                {
242
                    ctObj.Items1.Add(CT_MoveBookmark.Parse(childNode, namespaceManager));
243
                    ctObj.Items1ElementName.Add(Items1ChoiceType.moveFromRangeStart);
244
                }
245
                else if (childNode.LocalName == "customXmlDelRangeEnd")
246
                {
247
                    ctObj.Items1.Add(CT_Markup.Parse(childNode, namespaceManager));
248
                    ctObj.Items1ElementName.Add(Items1ChoiceType.customXmlDelRangeEnd);
249
                }
250
                else if (childNode.LocalName == "customXmlDelRangeStart")
251
                {
252
                    ctObj.Items1.Add(CT_TrackChange.Parse(childNode, namespaceManager));
253
                    ctObj.Items1ElementName.Add(Items1ChoiceType.customXmlDelRangeStart);
254
                }
255
                else if (childNode.LocalName == "oMathPara")
256
                {
257
                    ctObj.Items1.Add(CT_OMathPara.Parse(childNode, namespaceManager));
258
                    ctObj.Items1ElementName.Add(Items1ChoiceType.oMathPara);
259
                }
260
                else if (childNode.LocalName == "bookmarkEnd")
261
                {
262
                    ctObj.Items1.Add(CT_MarkupRange.Parse(childNode, namespaceManager));
263
                    ctObj.Items1ElementName.Add(Items1ChoiceType.bookmarkEnd);
264
                }
265
                else if (childNode.LocalName == "bookmarkStart")
266
                {
267
                    ctObj.Items1.Add(CT_Bookmark.Parse(childNode, namespaceManager));
268
                    ctObj.Items1ElementName.Add(Items1ChoiceType.bookmarkStart);
269
                }
270
                else if (childNode.LocalName == "commentRangeEnd")
271
                {
272
                    ctObj.Items1.Add(CT_MarkupRange.Parse(childNode, namespaceManager));
273
                    ctObj.Items1ElementName.Add(Items1ChoiceType.commentRangeEnd);
274
                }
275

276
            }
277
            return ctObj;
278
        }
279
        internal void Write(StreamWriter sw, string nodeName)
280
        {
281
            sw.Write(string.Format("<w:{0}", nodeName));
282
            sw.Write(">");
283
            foreach (object o in this.Items)
284
            {
285
                if (o is CT_Markup)
286
                    ((CT_Markup)o).Write(sw, "customXmlMoveToRangeEnd");
287

288
                else if (o is CT_MarkupRange)
289
                    ((CT_MarkupRange)o).Write(sw, "moveToRangeEnd");
290
                else if (o is CT_MoveBookmark)
291
                    ((CT_MoveBookmark)o).Write(sw, "moveToRangeStart");
292
                else if (o is CT_Markup)
293
                    ((CT_Markup)o).Write(sw, "customXmlDelRangeEnd");
294
                else if (o is CT_MoveBookmark)
295
                    ((CT_MoveBookmark)o).Write(sw, "moveFromRangeStart");
296
                else if (o is CT_MarkupRange)
297
                    ((CT_MarkupRange)o).Write(sw, "bookmarkEnd");
298
                else if (o is CT_Bookmark)
299
                    ((CT_Bookmark)o).Write(sw, "bookmarkStart");
300
                else if (o is CT_MarkupRange)
301
                    ((CT_MarkupRange)o).Write(sw, "commentRangeEnd");
302
                else if (o is CT_MarkupRange)
303
                    ((CT_MarkupRange)o).Write(sw, "commentRangeStart");
304
                else if (o is CT_TrackChange)
305
                    ((CT_TrackChange)o).Write(sw, "customXmlMoveToRangeStart");
306
                else if (o is CT_Markup)
307
                    ((CT_Markup)o).Write(sw, "customXmlInsRangeEnd");
308
                else if (o is CT_TrackChange)
309
                    ((CT_TrackChange)o).Write(sw, "customXmlInsRangeStart");
310
                else if (o is CT_TrackChange)
311
                    ((CT_TrackChange)o).Write(sw, "customXmlDelRangeStart");
312
                else if (o is CT_Markup)
313
                    ((CT_Markup)o).Write(sw, "customXmlMoveFromRangeEnd");
314
                else if (o is CT_TrackChange)
315
                    ((CT_TrackChange)o).Write(sw, "customXmlMoveFromRangeStart");
316
                else if (o is CT_MarkupRange)
317
                    ((CT_MarkupRange)o).Write(sw, "moveFromRangeEnd");
318
            }
319
            if (this.tblPr != null)
320
                this.tblPr.Write(sw, "tblPr");
321
            if (this.tblGrid != null)
322
                this.tblGrid.Write(sw, "tblGrid");
323
            foreach (object o in this.Items1)
324
            {
325
                if (o is CT_SdtRow)
326
                    ((CT_SdtRow)o).Write(sw, "sdt");
327
                else if (o is CT_CustomXmlRow)
328
                    ((CT_CustomXmlRow)o).Write(sw, "customXml");
329
                else if (o is CT_Markup)
330
                    ((CT_Markup)o).Write(sw, "customXmlInsRangeEnd");
331
                else if (o is CT_TrackChange)
332
                    ((CT_TrackChange)o).Write(sw, "customXmlInsRangeStart");
333
                else if (o is CT_Markup)
334
                    ((CT_Markup)o).Write(sw, "customXmlMoveFromRangeEnd");
335
                else if (o is CT_TrackChange)
336
                    ((CT_TrackChange)o).Write(sw, "customXmlMoveFromRangeStart");
337
                else if (o is CT_Markup)
338
                    ((CT_Markup)o).Write(sw, "customXmlMoveToRangeEnd");
339
                else if (o is CT_TrackChange)
340
                    ((CT_TrackChange)o).Write(sw, "customXmlMoveToRangeStart");
341
                else if (o is CT_RunTrackChange)
342
                    ((CT_RunTrackChange)o).Write(sw, "del");
343
                else if (o is CT_RunTrackChange)
344
                    ((CT_RunTrackChange)o).Write(sw, "ins");
345
                else if (o is CT_RunTrackChange)
346
                    ((CT_RunTrackChange)o).Write(sw, "moveFrom");
347
                else if (o is CT_MarkupRange)
348
                    ((CT_MarkupRange)o).Write(sw, "moveFromRangeEnd");
349
                else if (o is CT_MarkupRange)
350
                    ((CT_MarkupRange)o).Write(sw, "commentRangeStart");
351
                else if (o is CT_RunTrackChange)
352
                    ((CT_RunTrackChange)o).Write(sw, "moveTo");
353
                else if (o is CT_MarkupRange)
354
                    ((CT_MarkupRange)o).Write(sw, "moveToRangeEnd");
355
                else if (o is CT_MoveBookmark)
356
                    ((CT_MoveBookmark)o).Write(sw, "moveToRangeStart");
357
                else if (o is CT_Perm)
358
                    ((CT_Perm)o).Write(sw, "permEnd");
359
                else if (o is CT_PermStart)
360
                    ((CT_PermStart)o).Write(sw, "permStart");
361
                else if (o is CT_ProofErr)
362
                    ((CT_ProofErr)o).Write(sw, "proofErr");
363
                else if (o is CT_OMath)
364
                    ((CT_OMath)o).Write(sw, "oMath");
365
                else if (o is CT_Row)
366
                    ((CT_Row)o).Write(sw, "tr");
367
                else if (o is CT_MoveBookmark)
368
                    ((CT_MoveBookmark)o).Write(sw, "moveFromRangeStart");
369
                else if (o is CT_Markup)
370
                    ((CT_Markup)o).Write(sw, "customXmlDelRangeEnd");
371
                else if (o is CT_TrackChange)
372
                    ((CT_TrackChange)o).Write(sw, "customXmlDelRangeStart");
373
                else if (o is CT_OMathPara)
374
                    ((CT_OMathPara)o).Write(sw, "oMathPara");
375
                else if (o is CT_MarkupRange)
376
                    ((CT_MarkupRange)o).Write(sw, "bookmarkEnd");
377
                else if (o is CT_Bookmark)
378
                    ((CT_Bookmark)o).Write(sw, "bookmarkStart");
379
                else if (o is CT_MarkupRange)
380
                    ((CT_MarkupRange)o).Write(sw, "commentRangeEnd");
381
            }
382
            sw.WriteEndW(nodeName);
383
        }
384

385
        [XmlElement("bookmarkEnd", typeof(CT_MarkupRange), Order = 0)]
386
        [XmlElement("bookmarkStart", typeof(CT_Bookmark), Order = 0)]
387
        [XmlElement("commentRangeEnd", typeof(CT_MarkupRange), Order = 0)]
388
        [XmlElement("commentRangeStart", typeof(CT_MarkupRange), Order = 0)]
389
        [XmlElement("customXmlDelRangeEnd", typeof(CT_Markup), Order = 0)]
390
        [XmlElement("customXmlDelRangeStart", typeof(CT_TrackChange), Order = 0)]
391
        [XmlElement("customXmlInsRangeEnd", typeof(CT_Markup), Order = 0)]
392
        [XmlElement("customXmlInsRangeStart", typeof(CT_TrackChange), Order = 0)]
393
        [XmlElement("customXmlMoveFromRangeEnd", typeof(CT_Markup), Order = 0)]
394
        [XmlElement("customXmlMoveFromRangeStart", typeof(CT_TrackChange), Order = 0)]
395
        [XmlElement("customXmlMoveToRangeEnd", typeof(CT_Markup), Order = 0)]
396
        [XmlElement("customXmlMoveToRangeStart", typeof(CT_TrackChange), Order = 0)]
397
        [XmlElement("moveFromRangeEnd", typeof(CT_MarkupRange), Order = 0)]
398
        [XmlElement("moveFromRangeStart", typeof(CT_MoveBookmark), Order = 0)]
399
        [XmlElement("moveToRangeEnd", typeof(CT_MarkupRange), Order = 0)]
400
        [XmlElement("moveToRangeStart", typeof(CT_MoveBookmark), Order = 0)]
401
        [XmlChoiceIdentifier("ItemsElementName")]
402
        public ArrayList Items
403
        {
404
            get
405
            {
406
                return this.itemsField;
407
            }
408
            set
409
            {
410
                this.itemsField = value;
411
            }
412
        }
413

414
        [XmlElement("ItemsElementName", Order = 1)]
415
        [XmlIgnore]
416
        public List<ItemsChoiceType30> ItemsElementName
417
        {
418
            get
419
            {
420
                return this.itemsElementNameField;
421
            }
422
            set
423
            {
424
               this.itemsElementNameField = value;
425
            }
426

427
        }
428

429
        [XmlElement(Order = 2)]
430
        public CT_TblPr tblPr
431
        {
432
            get
433
            {
434
                return this.tblPrField;
435
            }
436
            set
437
            {
438
                this.tblPrField = value;
439
            }
440
        }
441

442
        [XmlElement(Order = 3)]
443
        public CT_TblGrid tblGrid
444
        {
445
            get
446
            {
447
                return this.tblGridField;
448
            }
449
            set
450
            {
451
                this.tblGridField = value;
452
            }
453
        }
454

455
        //EG_ContentRowContent
456

457
        [XmlElement("oMath", typeof(CT_OMath), Namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", Order = 4)]
458
        [XmlElement("oMathPara", typeof(CT_OMathPara), Namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", Order = 4)]
459
        [XmlElement("bookmarkEnd", typeof(CT_MarkupRange), Order = 4)]
460
        [XmlElement("bookmarkStart", typeof(CT_Bookmark), Order = 4)]
461
        [XmlElement("commentRangeEnd", typeof(CT_MarkupRange), Order = 4)]
462
        [XmlElement("commentRangeStart", typeof(CT_MarkupRange), Order = 4)]
463
        [XmlElement("customXml", typeof(CT_CustomXmlRow), Order = 4)]
464
        [XmlElement("customXmlDelRangeEnd", typeof(CT_Markup), Order = 4)]
465
        [XmlElement("customXmlDelRangeStart", typeof(CT_TrackChange), Order = 4)]
466
        [XmlElement("customXmlInsRangeEnd", typeof(CT_Markup), Order = 4)]
467
        [XmlElement("customXmlInsRangeStart", typeof(CT_TrackChange), Order = 4)]
468
        [XmlElement("customXmlMoveFromRangeEnd", typeof(CT_Markup), Order = 4)]
469
        [XmlElement("customXmlMoveFromRangeStart", typeof(CT_TrackChange), Order = 4)]
470
        [XmlElement("customXmlMoveToRangeEnd", typeof(CT_Markup), Order = 4)]
471
        [XmlElement("customXmlMoveToRangeStart", typeof(CT_TrackChange), Order = 4)]
472
        [XmlElement("del", typeof(CT_RunTrackChange), Order = 4)]
473
        [XmlElement("ins", typeof(CT_RunTrackChange), Order = 4)]
474
        [XmlElement("moveFrom", typeof(CT_RunTrackChange), Order = 4)]
475
        [XmlElement("moveFromRangeEnd", typeof(CT_MarkupRange), Order = 4)]
476
        [XmlElement("moveFromRangeStart", typeof(CT_MoveBookmark), Order = 4)]
477
        [XmlElement("moveTo", typeof(CT_RunTrackChange), Order = 4)]
478
        [XmlElement("moveToRangeEnd", typeof(CT_MarkupRange), Order = 4)]
479
        [XmlElement("moveToRangeStart", typeof(CT_MoveBookmark), Order = 4)]
480
        [XmlElement("permEnd", typeof(CT_Perm), Order = 4)]
481
        [XmlElement("permStart", typeof(CT_PermStart), Order = 4)]
482
        [XmlElement("proofErr", typeof(CT_ProofErr), Order = 4)]
483
        [XmlElement("sdt", typeof(CT_SdtRow), Order = 4)]
484
        [XmlElement("tr", typeof(CT_Row), Order = 4)]
485
        [XmlChoiceIdentifier("Items1ElementName")]
486
        public ArrayList Items1
487
        {
488
            get
489
            {
490
                return this.items1Field;
491
            }
492
            set
493
            {
494
                this.items1Field = value;
495
            }
496
        }
497

498
        [XmlElement("Items1ElementName", Order = 5)]
499
        [XmlIgnore]
500
        public List<Items1ChoiceType> Items1ElementName
501
        {
502
            get
503
            {
504
                return this.items1ElementNameField;
505
            }
506
            set
507
            {
508
                this.items1ElementNameField = value;
509
            }
510
        }
511

512
        public void Set(CT_Tbl table)
513
        {
514
            this.items1ElementNameField = new List<Items1ChoiceType>(table.Items1ElementName);
515
            this.items1Field = new ArrayList(table.items1Field);
516
            this.itemsElementNameField = new List<ItemsChoiceType30>(table.itemsElementNameField);
517
            this.itemsField = new ArrayList(table.itemsField);
518
            this.tblGridField = table.tblGridField;
519
            this.tblPrField = table.tblPrField;
520
        }
521

522
        public void RemoveTr(int pos)
523
        {
524
            RemoveItems1(Items1ChoiceType.tr, pos);
525
        }
526

527
        public CT_Row InsertNewTr(int pos)
528
        {
529
            return InsertNewItems1<CT_Row>(Items1ChoiceType.tr, pos);
530
        }
531

532
        public void SetTrArray(int pos, CT_Row cT_Row)
533
        {
534
            SetItems1Array<CT_Row>(Items1ChoiceType.tr, pos, cT_Row);
535
        }
536

537
        public CT_Row AddNewTr()
538
        {
539
            return AddNewItems1<CT_Row>(Items1ChoiceType.tr);
540
        }
541

542
        public CT_TblPr AddNewTblPr()
543
        {
544
            if (this.tblPrField == null)
545
                this.tblPrField = new CT_TblPr();
546
            return this.tblPrField;
547
        }
548

549
        public int SizeOfTrArray()
550
        {
551
            return SizeOfItems1Array(Items1ChoiceType.tr);
552
        }
553

554
        public CT_Row GetTrArray(int p)
555
        {
556
            return GetItems1Array<CT_Row>(p, Items1ChoiceType.tr);
557
        }
558
        
559
        public List<CT_Row> GetTrList()
560
        {
561
            return GetItems1List<CT_Row>(Items1ChoiceType.tr);
562
        }
563
        #region Generic methods for object operation
564

565
        private List<T> GetItems1List<T>(Items1ChoiceType type) where T : class
566
        {
567
            lock (this)
568
            {
569
                List<T> list = new List<T>();
570
                for (int i = 0; i < items1ElementNameField.Count; i++)
571
                {
572
                    if (items1ElementNameField[i] == type)
573
                        list.Add(items1Field[i] as T);
574
                }
575
                return list;
576
            }
577
        }
578
        private int SizeOfItems1Array(Items1ChoiceType type)
579
        {
580
            lock (this)
581
            {
582
                int size = 0;
583
                for (int i = 0; i < items1ElementNameField.Count; i++)
584
                {
585
                    if (items1ElementNameField[i] == type)
586
                        size++;
587
                }
588
                return size;
589
            }
590
        }
591
        private T GetItems1Array<T>(int p, Items1ChoiceType type) where T : class
592
        {
593
            lock (this)
594
            {
595
                int pos = GetItems1Index(type, p);
596
                if (pos < 0 || pos >= this.items1Field.Count)
597
                    return null;
598
                return items1Field[pos] as T;
599
            }
600
        }
601
        private T InsertNewItems1<T>(Items1ChoiceType type, int p) where T : class, new()
602
        {
603
            T t = new T();
604
            lock (this)
605
            {
606
                int pos = GetItems1Index(type, p);
607
                this.items1ElementNameField.Insert(pos, type);
608
                this.items1Field.Insert(pos, t);
609
            }
610
            return t;
611
        }
612
        private T AddNewItems1<T>(Items1ChoiceType type) where T : class, new()
613
        {
614
            T t = new T();
615
            lock (this)
616
            {
617
                this.items1ElementNameField.Add(type);
618
                this.items1Field.Add(t);
619
            }
620
            return t;
621
        }
622
        private void SetItems1Array<T>(Items1ChoiceType type, int p, T obj) where T : class
623
        {
624
            lock (this)
625
            {
626
                int pos = GetItems1Index(type, p);
627
                if (pos < 0 || pos >= this.items1Field.Count)
628
                    return;
629
                if (this.items1Field[pos] is T)
630
                    this.items1Field[pos] = obj;
631
                else
632
                    throw new Exception(string.Format(@"object types are difference, itemsField[{0}] is {1}, and parameter obj is {2}",
633
                        pos, this.items1Field[pos].GetType().Name, typeof(T).Name));
634
            }
635
        }
636
        private int GetItems1Index(Items1ChoiceType type, int p)
637
        {
638
            int index = -1;
639
            int pos = 0;
640
            for (int i = 0; i < items1ElementNameField.Count; i++)
641
            {
642
                if (items1ElementNameField[i] == type)
643
                {
644
                    if (pos == p)
645
                    {
646
                        //return itemsField[p] as T;
647
                        index = i;
648
                        break;
649
                    }
650
                    else
651
                        pos++;
652
                }
653
            }
654
            // Check if the position should be the last position when index cannot be find in for loop
655
            if( index == -1&&pos == p)
656
                index = items1Field.Count;
657
            return index;
658
        }
659
        private void RemoveItems1(Items1ChoiceType type, int p)
660
        {
661
            lock (this)
662
            {
663
                int pos = GetItems1Index(type, p);
664
                if (pos < 0 || pos >= this.items1Field.Count)
665
                    return;
666
                items1ElementNameField.RemoveAt(pos);
667
                items1Field.RemoveAt(pos);
668
            }
669
        }
670
        #endregion
671

672
        public CT_TblGrid AddNewTblGrid()
673
        {
674
            this.tblGrid = new CT_TblGrid();
675
            return this.tblGrid;
676
        }
677
    }
678

679

680
    [Serializable]
681
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IncludeInSchema = false)]
682
    public enum ItemsChoiceType30
683
    {
684

685
    
686
        bookmarkEnd,
687

688
    
689
        bookmarkStart,
690

691
    
692
        commentRangeEnd,
693

694
    
695
        commentRangeStart,
696

697
    
698
        customXmlDelRangeEnd,
699

700
    
701
        customXmlDelRangeStart,
702

703
    
704
        customXmlInsRangeEnd,
705

706
    
707
        customXmlInsRangeStart,
708

709
    
710
        customXmlMoveFromRangeEnd,
711

712
    
713
        customXmlMoveFromRangeStart,
714

715
    
716
        customXmlMoveToRangeEnd,
717

718
    
719
        customXmlMoveToRangeStart,
720

721
    
722
        moveFromRangeEnd,
723

724
    
725
        moveFromRangeStart,
726

727
    
728
        moveToRangeEnd,
729

730
    
731
        moveToRangeStart,
732
    }
733
    [Serializable]
734
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
735
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
736
    public class CT_TblGridChange : CT_Markup
737
    {
738

739
        private List<CT_TblGridCol> tblGridField;
740

741
        public CT_TblGridChange()
742
        {
743
            //this.tblGridField = new List<CT_TblGridCol>();
744
        }
745
        public static new CT_TblGridChange Parse(XmlNode node, XmlNamespaceManager namespaceManager)
746
        {
747
            if (node == null)
748
                return null;
749
            CT_TblGridChange ctObj = new CT_TblGridChange();
750
            ctObj.id = XmlHelper.ReadString(node.Attributes["r:id"]);
751
            ctObj.tblGrid = new List<CT_TblGridCol>();
752
            foreach (XmlNode childNode in node.ChildNodes)
753
            {
754
                if (childNode.LocalName == "tblGrid")
755
                    ctObj.tblGrid.Add(CT_TblGridCol.Parse(childNode, namespaceManager));
756
            }
757
            return ctObj;
758
        }
759

760

761

762
        internal new void Write(StreamWriter sw, string nodeName)
763
        {
764
            sw.Write(string.Format("<w:{0}", nodeName));
765
            XmlHelper.WriteAttribute(sw, "r:id", this.id);
766
            sw.Write(">");
767
            if (this.tblGrid != null)
768
            {
769
                foreach (CT_TblGridCol x in this.tblGrid)
770
                {
771
                    x.Write(sw, "tblGrid");
772
                }
773
            }
774
            sw.WriteEndW(nodeName);
775
        }
776

777
        [XmlArray(Order = 0)]
778
        [XmlArrayItem("gridCol", IsNullable = false)]
779
        public List<CT_TblGridCol> tblGrid
780
        {
781
            get
782
            {
783
                return this.tblGridField;
784
            }
785
            set
786
            {
787
                this.tblGridField = value;
788
            }
789
        }
790
    }
791

792

793
    [Serializable]
794
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
795
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
796
    public class CT_TblGridCol
797
    {
798

799
        private ulong wField;
800

801
        private bool wFieldSpecified;
802
        public static CT_TblGridCol Parse(XmlNode node, XmlNamespaceManager namespaceManager)
803
        {
804
            if (node == null)
805
                return null;
806
            CT_TblGridCol ctObj = new CT_TblGridCol();
807
            ctObj.w = XmlHelper.ReadULong(node.Attributes["w:w"]);
808
            return ctObj;
809
        }
810

811

812

813
        internal void Write(StreamWriter sw, string nodeName)
814
        {
815
            sw.Write(string.Format("<w:{0}", nodeName));
816
            XmlHelper.WriteAttribute(sw, "w:w", this.w);
817
            sw.Write("/>");
818
        }
819

820
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
821
        public ulong w
822
        {
823
            get
824
            {
825
                return this.wField;
826
            }
827
            set
828
            {
829
                this.wField = value;
830
            }
831
        }
832
        public bool wSpecified
833
        {
834
            get { return this.wFieldSpecified; }
835
            set { this.wFieldSpecified = value; }
836
        }
837
    }
838
    [XmlInclude(typeof(CT_TblGrid))]
839
    [Serializable]
840
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
841
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
842
    public class CT_TblGridBase
843
    {
844

845
        private List<CT_TblGridCol> gridColField;
846

847
        public CT_TblGridBase()
848
        {
849
            this.gridColField = new List<CT_TblGridCol>();
850
        }
851

852
        [XmlElement("gridCol", Order = 0)]
853
        public List<CT_TblGridCol> gridCol
854
        {
855
            get
856
            {
857
                return this.gridColField;
858
            }
859
            set
860
            {
861
                this.gridColField = value;
862
            }
863
        }
864
    }
865

866

867
    [Serializable]
868

869
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
870
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
871
    public class CT_TblGrid : CT_TblGridBase
872
    {
873

874
        private CT_TblGridChange tblGridChangeField;
875

876
        public CT_TblGrid()
877
        {
878
            //this.tblGridChangeField = new CT_TblGridChange();
879
        }
880
        public static CT_TblGrid Parse(XmlNode node, XmlNamespaceManager namespaceManager)
881
        {
882
            if (node == null)
883
                return null;
884
            CT_TblGrid ctObj = new CT_TblGrid();
885
            ctObj.gridCol = new List<CT_TblGridCol>();
886
            foreach (XmlNode childNode in node.ChildNodes)
887
            {
888
                if (childNode.LocalName == "tblGridChange")
889
                    ctObj.tblGridChange = CT_TblGridChange.Parse(childNode, namespaceManager);
890
                else if (childNode.LocalName == "gridCol")
891
                    ctObj.gridCol.Add(CT_TblGridCol.Parse(childNode, namespaceManager));
892
            }
893
            return ctObj;
894
        }
895

896

897

898
        internal void Write(StreamWriter sw, string nodeName)
899
        {
900
            sw.Write(string.Format("<w:{0}", nodeName));
901
            sw.Write(">");
902
            if (this.tblGridChange != null)
903
                this.tblGridChange.Write(sw, "tblGridChange");
904
            if (this.gridCol != null)
905
            {
906
                foreach (CT_TblGridCol x in this.gridCol)
907
                {
908
                    x.Write(sw, "gridCol");
909
                }
910
            }
911
            sw.WriteEndW(nodeName);
912
        }
913

914
        [XmlElement(Order = 0)]
915
        public CT_TblGridChange tblGridChange
916
        {
917
            get
918
            {
919
                return this.tblGridChangeField;
920
            }
921
            set
922
            {
923
                this.tblGridChangeField = value;
924
            }
925
        }
926

927
        public CT_TblGridCol AddNewGridCol()
928
        {
929
            if (this.gridCol == null)
930
                gridCol = new List<CT_TblGridCol>();
931

932
            CT_TblGridCol col=new CT_TblGridCol();
933
            gridCol.Add(col);
934
            return col;
935
        }
936
    }
937

938
    [Serializable]
939

940
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
941
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
942
    public class CT_TblOverlap
943
    {
944
        public static CT_TblOverlap Parse(XmlNode node, XmlNamespaceManager namespaceManager)
945
        {
946
            if (node == null)
947
                return null;
948
            CT_TblOverlap ctObj = new CT_TblOverlap();
949
            if (node.Attributes["w:val"] != null)
950
                ctObj.val = (ST_TblOverlap)Enum.Parse(typeof(ST_TblOverlap), node.Attributes["w:val"].Value);
951
            return ctObj;
952
        }
953

954

955

956
        internal void Write(StreamWriter sw, string nodeName)
957
        {
958
            sw.Write(string.Format("<w:{0}", nodeName));
959
            XmlHelper.WriteAttribute(sw, "w:val", this.val.ToString());
960
            sw.Write(">");
961
            sw.WriteEndW(nodeName);
962
        }
963

964
        private ST_TblOverlap valField;
965

966
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
967
        public ST_TblOverlap val
968
        {
969
            get
970
            {
971
                return this.valField;
972
            }
973
            set
974
            {
975
                this.valField = value;
976
            }
977
        }
978
    }
979

980

981
    [Serializable]
982
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
983
    public enum ST_TblOverlap
984
    {
985

986
    
987
        never,
988

989
    
990
        overlap,
991
    }
992

993

994
    [Serializable]
995

996
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
997
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
998
    public class CT_TblWidth
999
    {
1000

1001
        private string wField;
1002

1003
        private ST_TblWidth typeField = ST_TblWidth.auto;
1004

1005
        private bool typeFieldSpecified = true;
1006
        public static CT_TblWidth Parse(XmlNode node, XmlNamespaceManager namespaceManager)
1007
        {
1008
            if (node == null)
1009
                return null;
1010
            CT_TblWidth ctObj = new CT_TblWidth();
1011
            ctObj.w = XmlHelper.ReadString(node.Attributes["w:w"]);
1012
            if (node.Attributes["w:type"] != null)
1013
                ctObj.type = (ST_TblWidth)Enum.Parse(typeof(ST_TblWidth), node.Attributes["w:type"].Value);
1014
            return ctObj;
1015
        }
1016

1017

1018

1019
        internal void Write(StreamWriter sw, string nodeName)
1020
        {
1021
            sw.Write(string.Format("<w:{0}", nodeName));
1022
            XmlHelper.WriteAttribute(sw, "w:w", this.w);
1023
            XmlHelper.WriteAttribute(sw, "w:type", this.type.ToString());
1024
            sw.Write("/>");
1025
        }
1026

1027
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified, DataType = "integer")]
1028
        public string w
1029
        {
1030
            get
1031
            {
1032
                return this.wField;
1033
            }
1034
            set
1035
            {
1036
                this.wField = value;
1037
            }
1038
        }
1039

1040
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
1041
        public ST_TblWidth type
1042
        {
1043
            get
1044
            {
1045
                return this.typeField;
1046
            }
1047
            set
1048
            {
1049
                this.typeField = value;
1050
            }
1051
        }
1052

1053
        [XmlIgnore]
1054
        public bool typeSpecified
1055
        {
1056
            get
1057
            {
1058
                return this.typeFieldSpecified;
1059
            }
1060
            set
1061
            {
1062
                this.typeFieldSpecified = value;
1063
            }
1064
        }
1065
    }
1066

1067

1068
    [Serializable]
1069
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
1070
    public enum ST_TblWidth
1071
    {
1072

1073
    
1074
        nil,
1075

1076
    
1077
        pct,
1078

1079
    
1080
        dxa,
1081

1082
    
1083
        auto,
1084
    }
1085

1086

1087
    [Serializable]
1088

1089
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
1090
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
1091
    public class CT_TblPrChange : CT_TrackChange
1092
    {
1093
        public static new CT_TblPrChange Parse(XmlNode node, XmlNamespaceManager namespaceManager)
1094
        {
1095
            if (node == null)
1096
                return null;
1097
            CT_TblPrChange ctObj = new CT_TblPrChange();
1098
            ctObj.author = XmlHelper.ReadString(node.Attributes["w:author"]);
1099
            ctObj.date = XmlHelper.ReadString(node.Attributes["w:date"]);
1100
            ctObj.id = XmlHelper.ReadString(node.Attributes["r:id"]);
1101
            foreach (XmlNode childNode in node.ChildNodes)
1102
            {
1103
                if (childNode.LocalName == "tblPr")
1104
                    ctObj.tblPr = CT_TblPrBase.Parse(childNode, namespaceManager);
1105
            }
1106
            return ctObj;
1107
        }
1108

1109

1110

1111
        internal new void Write(StreamWriter sw, string nodeName)
1112
        {
1113
            sw.Write(string.Format("<w:{0}", nodeName));
1114
            XmlHelper.WriteAttribute(sw, "w:author", this.author);
1115
            XmlHelper.WriteAttribute(sw, "w:date", this.date);
1116
            XmlHelper.WriteAttribute(sw, "r:id", this.id);
1117
            sw.Write(">");
1118
            if (this.tblPr != null)
1119
                this.tblPr.Write(sw, "tblPr");
1120
            sw.WriteEndW(nodeName);
1121
        }
1122

1123
        private CT_TblPrBase tblPrField;
1124

1125
        public CT_TblPrChange()
1126
        {
1127
            //this.tblPrField = new CT_TblPrBase();
1128
        }
1129

1130
        [XmlElement(Order = 0)]
1131
        public CT_TblPrBase tblPr
1132
        {
1133
            get
1134
            {
1135
                return this.tblPrField;
1136
            }
1137
            set
1138
            {
1139
                this.tblPrField = value;
1140
            }
1141
        }
1142
    }
1143

1144
    [XmlInclude(typeof(CT_TblPr))]
1145

1146
    [Serializable]
1147

1148
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
1149
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
1150
    public class CT_TblPrBase
1151
    {
1152

1153
        private CT_String tblStyleField;
1154

1155
        private CT_TblPPr tblpPrField;
1156

1157
        private CT_TblOverlap tblOverlapField;
1158

1159
        private CT_OnOff bidiVisualField;
1160

1161
        private CT_DecimalNumber tblStyleRowBandSizeField;
1162

1163
        private CT_DecimalNumber tblStyleColBandSizeField;
1164

1165
        private CT_TblWidth tblWField;
1166

1167
        private CT_Jc jcField;
1168

1169
        private CT_TblWidth tblCellSpacingField;
1170

1171
        private CT_TblWidth tblIndField;
1172

1173
        private CT_TblBorders tblBordersField;
1174

1175
        private CT_Shd shdField;
1176

1177
        private CT_TblLayoutType tblLayoutField;
1178

1179
        private CT_TblCellMar tblCellMarField;
1180

1181
        private CT_ShortHexNumber tblLookField;
1182

1183
        private CT_String tblCaptionField;
1184

1185
        private CT_String tblDescriptionField;
1186

1187
        public CT_TblPrBase()
1188
        {
1189
        }
1190
        public static CT_TblPrBase Parse(XmlNode node, XmlNamespaceManager namespaceManager)
1191
        {
1192
            if (node == null)
1193
                return null;
1194
            CT_TblPrBase ctObj = new CT_TblPrBase();
1195
            foreach (XmlNode childNode in node.ChildNodes)
1196
            {
1197
                if (childNode.LocalName == "tblStyle")
1198
                    ctObj.tblStyle = CT_String.Parse(childNode, namespaceManager);
1199
                else if (childNode.LocalName == "tblpPr")
1200
                    ctObj.tblpPr = CT_TblPPr.Parse(childNode, namespaceManager);
1201
                else if (childNode.LocalName == "tblOverlap")
1202
                    ctObj.tblOverlap = CT_TblOverlap.Parse(childNode, namespaceManager);
1203
                else if (childNode.LocalName == "bidiVisual")
1204
                    ctObj.bidiVisual = CT_OnOff.Parse(childNode, namespaceManager);
1205
                else if (childNode.LocalName == "tblStyleRowBandSize")
1206
                    ctObj.tblStyleRowBandSize = CT_DecimalNumber.Parse(childNode, namespaceManager);
1207
                else if (childNode.LocalName == "tblStyleColBandSize")
1208
                    ctObj.tblStyleColBandSize = CT_DecimalNumber.Parse(childNode, namespaceManager);
1209
                else if (childNode.LocalName == "tblW")
1210
                    ctObj.tblW = CT_TblWidth.Parse(childNode, namespaceManager);
1211
                else if (childNode.LocalName == "jc")
1212
                    ctObj.jc = CT_Jc.Parse(childNode, namespaceManager);
1213
                else if (childNode.LocalName == "tblCellSpacing")
1214
                    ctObj.tblCellSpacing = CT_TblWidth.Parse(childNode, namespaceManager);
1215
                else if (childNode.LocalName == "tblInd")
1216
                    ctObj.tblInd = CT_TblWidth.Parse(childNode, namespaceManager);
1217
                else if (childNode.LocalName == "tblBorders")
1218
                    ctObj.tblBorders = CT_TblBorders.Parse(childNode, namespaceManager);
1219
                else if (childNode.LocalName == "shd")
1220
                    ctObj.shd = CT_Shd.Parse(childNode, namespaceManager);
1221
                else if (childNode.LocalName == "tblLayout")
1222
                    ctObj.tblLayout = CT_TblLayoutType.Parse(childNode, namespaceManager);
1223
                else if (childNode.LocalName == "tblCellMar")
1224
                    ctObj.tblCellMar = CT_TblCellMar.Parse(childNode, namespaceManager);
1225
                else if (childNode.LocalName == "tblLook")
1226
                    ctObj.tblLook = CT_ShortHexNumber.Parse(childNode, namespaceManager);
1227
                else if (childNode.LocalName == "tblCaption")
1228
                    ctObj.tblCaption = CT_String.Parse(childNode, namespaceManager);
1229
                else if (childNode.LocalName == "tblDescription")
1230
                    ctObj.tblDescription = CT_String.Parse(childNode, namespaceManager);
1231
            }
1232
            return ctObj;
1233
        }
1234

1235

1236

1237
        internal void Write(StreamWriter sw, string nodeName)
1238
        {
1239
            sw.Write(string.Format("<w:{0}", nodeName));
1240
            sw.Write(">");
1241
            if (this.tblStyle != null)
1242
                this.tblStyle.Write(sw, "tblStyle");
1243
            if (this.tblpPr != null)
1244
                this.tblpPr.Write(sw, "tblpPr");
1245
            if (this.tblOverlap != null)
1246
                this.tblOverlap.Write(sw, "tblOverlap");
1247
            if (this.bidiVisual != null)
1248
                this.bidiVisual.Write(sw, "bidiVisual");
1249
            if (this.tblStyleRowBandSize != null)
1250
                this.tblStyleRowBandSize.Write(sw, "tblStyleRowBandSize");
1251
            if (this.tblStyleColBandSize != null)
1252
                this.tblStyleColBandSize.Write(sw, "tblStyleColBandSize");
1253
            if (this.tblW != null)
1254
                this.tblW.Write(sw, "tblW");
1255
            if (this.jc != null)
1256
                this.jc.Write(sw, "jc");
1257
            if (this.tblCellSpacing != null)
1258
                this.tblCellSpacing.Write(sw, "tblCellSpacing");
1259
            if (this.tblInd != null)
1260
                this.tblInd.Write(sw, "tblInd");
1261
            if (this.tblBorders != null)
1262
                this.tblBorders.Write(sw, "tblBorders");
1263
            if (this.shd != null)
1264
                this.shd.Write(sw, "shd");
1265
            if (this.tblLayout != null)
1266
                this.tblLayout.Write(sw, "tblLayout");
1267
            if (this.tblCellMar != null)
1268
                this.tblCellMar.Write(sw, "tblCellMar");
1269
            if (this.tblLook != null)
1270
                this.tblLook.Write(sw, "tblLook");
1271
            if (this.tblCaption != null)
1272
                this.tblCaption.Write(sw, "tblCaption");
1273
            if (this.tblDescription != null)
1274
                this.tblDescription.Write(sw, "tblDescription");
1275
            sw.WriteEndW(nodeName);
1276
        }
1277

1278
        [XmlElement(Order = 0)]
1279
        public CT_String tblStyle
1280
        {
1281
            get
1282
            {
1283
                return this.tblStyleField;
1284
            }
1285
            set
1286
            {
1287
                this.tblStyleField = value;
1288
            }
1289
        }
1290

1291
        [XmlElement(Order = 1)]
1292
        public CT_TblPPr tblpPr
1293
        {
1294
            get
1295
            {
1296
                return this.tblpPrField;
1297
            }
1298
            set
1299
            {
1300
                this.tblpPrField = value;
1301
            }
1302
        }
1303

1304
        [XmlElement(Order = 2)]
1305
        public CT_TblOverlap tblOverlap
1306
        {
1307
            get
1308
            {
1309
                return this.tblOverlapField;
1310
            }
1311
            set
1312
            {
1313
                this.tblOverlapField = value;
1314
            }
1315
        }
1316

1317
        [XmlElement(Order = 3)]
1318
        public CT_OnOff bidiVisual
1319
        {
1320
            get
1321
            {
1322
                return this.bidiVisualField;
1323
            }
1324
            set
1325
            {
1326
                this.bidiVisualField = value;
1327
            }
1328
        }
1329

1330
        [XmlElement(Order = 4)]
1331
        public CT_DecimalNumber tblStyleRowBandSize
1332
        {
1333
            get
1334
            {
1335
                return this.tblStyleRowBandSizeField;
1336
            }
1337
            set
1338
            {
1339
                this.tblStyleRowBandSizeField = value;
1340
            }
1341
        }
1342

1343
        [XmlElement(Order = 5)]
1344
        public CT_DecimalNumber tblStyleColBandSize
1345
        {
1346
            get
1347
            {
1348
                return this.tblStyleColBandSizeField;
1349
            }
1350
            set
1351
            {
1352
                this.tblStyleColBandSizeField = value;
1353
            }
1354
        }
1355

1356
        [XmlElement(Order = 6)]
1357
        public CT_TblWidth tblW
1358
        {
1359
            get
1360
            {
1361
                return this.tblWField;
1362
            }
1363
            set
1364
            {
1365
                this.tblWField = value;
1366
            }
1367
        }
1368

1369
        [XmlElement(Order = 7)]
1370
        public CT_Jc jc
1371
        {
1372
            get
1373
            {
1374
                return this.jcField;
1375
            }
1376
            set
1377
            {
1378
                this.jcField = value;
1379
            }
1380
        }
1381

1382
        [XmlElement(Order = 8)]
1383
        public CT_TblWidth tblCellSpacing
1384
        {
1385
            get
1386
            {
1387
                return this.tblCellSpacingField;
1388
            }
1389
            set
1390
            {
1391
                this.tblCellSpacingField = value;
1392
            }
1393
        }
1394

1395
        [XmlElement(Order = 9)]
1396
        public CT_TblWidth tblInd
1397
        {
1398
            get
1399
            {
1400
                return this.tblIndField;
1401
            }
1402
            set
1403
            {
1404
                this.tblIndField = value;
1405
            }
1406
        }
1407

1408
        [XmlElement(Order = 10)]
1409
        public CT_TblBorders tblBorders
1410
        {
1411
            get
1412
            {
1413
                return this.tblBordersField;
1414
            }
1415
            set
1416
            {
1417
                this.tblBordersField = value;
1418
            }
1419
        }
1420

1421
        [XmlElement(Order = 11)]
1422
        public CT_Shd shd
1423
        {
1424
            get
1425
            {
1426
                return this.shdField;
1427
            }
1428
            set
1429
            {
1430
                this.shdField = value;
1431
            }
1432
        }
1433

1434
        [XmlElement(Order = 12)]
1435
        public CT_TblLayoutType tblLayout
1436
        {
1437
            get
1438
            {
1439
                return this.tblLayoutField;
1440
            }
1441
            set
1442
            {
1443
                this.tblLayoutField = value;
1444
            }
1445
        }
1446

1447
        [XmlElement(Order = 13)]
1448
        public CT_TblCellMar tblCellMar
1449
        {
1450
            get
1451
            {
1452
                return this.tblCellMarField;
1453
            }
1454
            set
1455
            {
1456
                this.tblCellMarField = value;
1457
            }
1458
        }
1459

1460
        [XmlElement(Order = 14)]
1461
        public CT_ShortHexNumber tblLook
1462
        {
1463
            get
1464
            {
1465
                return this.tblLookField;
1466
            }
1467
            set
1468
            {
1469
                this.tblLookField = value;
1470
            }
1471
        }
1472

1473
        [XmlElement(Order = 15)]
1474
        public CT_String tblCaption
1475
        {
1476
            get
1477
            {
1478
                return this.tblCaptionField;
1479
            }
1480
            set
1481
            {
1482
                this.tblCaptionField = value;
1483
            }
1484
        }
1485

1486
        [XmlElement(Order = 16)]
1487
        public CT_String tblDescription
1488
        {
1489
            get
1490
            {
1491
                return this.tblDescriptionField;
1492
            }
1493
            set
1494
            {
1495
                this.tblDescriptionField = value;
1496
            }
1497
        }
1498

1499
        public bool IsSetTblW()
1500
        {
1501
            return this.tblW != null;
1502
        }
1503

1504
        public CT_TblWidth AddNewTblW()
1505
        {
1506
            if (this.tblWField == null)
1507
                this.tblWField = new CT_TblWidth();
1508
            return this.tblWField;
1509
        }
1510

1511
        public CT_TblBorders AddNewTblBorders()
1512
        {
1513
            if (tblBordersField == null)
1514
                this.tblBordersField = new CT_TblBorders();
1515
            return this.tblBordersField;
1516
        }
1517
        public CT_String AddNewTblStyle()
1518
        {
1519
            this.tblStyleField = new CT_String();
1520
            return this.tblStyleField;
1521
        }
1522

1523
        public bool IsSetTblBorders()
1524
        {
1525
            return this.tblBordersField != null;
1526
        }
1527

1528
        public bool IsSetTblStyleRowBandSize()
1529
        {
1530
            return this.tblStyleRowBandSizeField != null;
1531
        }
1532

1533
        public CT_DecimalNumber AddNewTblStyleRowBandSize()
1534
        {
1535
            this.tblStyleRowBandSizeField = new CT_DecimalNumber();
1536
            return this.tblStyleRowBandSizeField;
1537
        }
1538

1539
        public bool IsSetTblStyleColBandSize()
1540
        {
1541
            return this.tblStyleColBandSizeField != null;
1542
        }
1543

1544
        public CT_DecimalNumber AddNewTblStyleColBandSize()
1545
        {
1546
            this.tblStyleColBandSizeField = new CT_DecimalNumber();
1547
            return this.tblStyleColBandSizeField;
1548
        }
1549

1550
        public bool IsSetTblCellMar()
1551
        {
1552
            return this.tblCellMarField != null;
1553
        }
1554

1555
        public CT_TblCellMar AddNewTblCellMar()
1556
        {
1557
            this.tblCellMarField = new CT_TblCellMar();
1558
            return this.tblCellMarField;
1559
        }
1560
    }
1561

1562

1563
    [Serializable]
1564

1565
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
1566
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
1567
    public class CT_TblPPr
1568
    {
1569

1570
        private ulong leftFromTextField;
1571

1572
        private bool leftFromTextFieldSpecified;
1573

1574
        private ulong rightFromTextField;
1575

1576
        private bool rightFromTextFieldSpecified;
1577

1578
        private ulong topFromTextField;
1579

1580
        private bool topFromTextFieldSpecified;
1581

1582
        private ulong bottomFromTextField;
1583

1584
        private bool bottomFromTextFieldSpecified;
1585

1586
        private ST_VAnchor vertAnchorField;
1587

1588
        private bool vertAnchorFieldSpecified;
1589

1590
        private ST_HAnchor horzAnchorField;
1591

1592
        private bool horzAnchorFieldSpecified;
1593

1594
        private ST_XAlign tblpXSpecField;
1595

1596
        private bool tblpXSpecFieldSpecified;
1597

1598
        private string tblpXField;
1599

1600
        private ST_YAlign tblpYSpecField;
1601

1602
        private bool tblpYSpecFieldSpecified;
1603

1604
        private string tblpYField;
1605

1606
        public static CT_TblPPr Parse(XmlNode node, XmlNamespaceManager namespaceManager)
1607
        {
1608
            if (node == null)
1609
                return null;
1610
            CT_TblPPr ctObj = new CT_TblPPr();
1611
            ctObj.leftFromText = XmlHelper.ReadULong(node.Attributes["w:leftFromText"]);
1612
            ctObj.rightFromText = XmlHelper.ReadULong(node.Attributes["w:rightFromText"]);
1613
            ctObj.topFromText = XmlHelper.ReadULong(node.Attributes["w:topFromText"]);
1614
            ctObj.bottomFromText = XmlHelper.ReadULong(node.Attributes["w:bottomFromText"]);
1615
            if (node.Attributes["w:vertAnchor"] != null)
1616
                ctObj.vertAnchor = (ST_VAnchor)Enum.Parse(typeof(ST_VAnchor), node.Attributes["w:vertAnchor"].Value);
1617
            if (node.Attributes["w:horzAnchor"] != null)
1618
                ctObj.horzAnchor = (ST_HAnchor)Enum.Parse(typeof(ST_HAnchor), node.Attributes["w:horzAnchor"].Value);
1619
            if (node.Attributes["w:tblpXSpec"] != null)
1620
                ctObj.tblpXSpec = (ST_XAlign)Enum.Parse(typeof(ST_XAlign), node.Attributes["w:tblpXSpec"].Value);
1621
            ctObj.tblpX = XmlHelper.ReadString(node.Attributes["w:tblpX"]);
1622
            if (node.Attributes["w:tblpYSpec"] != null)
1623
                ctObj.tblpYSpec = (ST_YAlign)Enum.Parse(typeof(ST_YAlign), node.Attributes["w:tblpYSpec"].Value);
1624
            ctObj.tblpY = XmlHelper.ReadString(node.Attributes["w:tblpY"]);
1625
            return ctObj;
1626
        }
1627

1628

1629

1630
        internal void Write(StreamWriter sw, string nodeName)
1631
        {
1632
            sw.Write(string.Format("<w:{0}", nodeName));
1633
            XmlHelper.WriteAttribute(sw, "w:leftFromText", this.leftFromText);
1634
            XmlHelper.WriteAttribute(sw, "w:rightFromText", this.rightFromText);
1635
            XmlHelper.WriteAttribute(sw, "w:topFromText", this.topFromText);
1636
            XmlHelper.WriteAttribute(sw, "w:bottomFromText", this.bottomFromText);
1637
            XmlHelper.WriteAttribute(sw, "w:vertAnchor", this.vertAnchor.ToString());
1638
            XmlHelper.WriteAttribute(sw, "w:horzAnchor", this.horzAnchor.ToString());
1639
            if (this.tblpXSpecFieldSpecified)
1640
                XmlHelper.WriteAttribute(sw, "w:tblpXSpec", this.tblpXSpec.ToString());
1641
            XmlHelper.WriteAttribute(sw, "w:tblpX", this.tblpX);
1642
            if (this.tblpYSpecFieldSpecified)
1643
                XmlHelper.WriteAttribute(sw, "w:tblpYSpec", this.tblpYSpec.ToString());
1644
            XmlHelper.WriteAttribute(sw, "w:tblpY", this.tblpY);
1645
            sw.Write(">");
1646
            sw.WriteEndW(nodeName);
1647
        }
1648

1649
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
1650
        public ulong leftFromText
1651
        {
1652
            get
1653
            {
1654
                return this.leftFromTextField;
1655
            }
1656
            set
1657
            {
1658
                this.leftFromTextField = value;
1659
            }
1660
        }
1661

1662
        [XmlIgnore]
1663
        public bool leftFromTextSpecified
1664
        {
1665
            get
1666
            {
1667
                return this.leftFromTextFieldSpecified;
1668
            }
1669
            set
1670
            {
1671
                this.leftFromTextFieldSpecified = value;
1672
            }
1673
        }
1674

1675
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
1676
        public ulong rightFromText
1677
        {
1678
            get
1679
            {
1680
                return this.rightFromTextField;
1681
            }
1682
            set
1683
            {
1684
                this.rightFromTextField = value;
1685
            }
1686
        }
1687

1688
        [XmlIgnore]
1689
        public bool rightFromTextSpecified
1690
        {
1691
            get
1692
            {
1693
                return this.rightFromTextFieldSpecified;
1694
            }
1695
            set
1696
            {
1697
                this.rightFromTextFieldSpecified = value;
1698
            }
1699
        }
1700

1701
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
1702
        public ulong topFromText
1703
        {
1704
            get
1705
            {
1706
                return this.topFromTextField;
1707
            }
1708
            set
1709
            {
1710
                this.topFromTextField = value;
1711
            }
1712
        }
1713

1714
        [XmlIgnore]
1715
        public bool topFromTextSpecified
1716
        {
1717
            get
1718
            {
1719
                return this.topFromTextFieldSpecified;
1720
            }
1721
            set
1722
            {
1723
                this.topFromTextFieldSpecified = value;
1724
            }
1725
        }
1726

1727
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
1728
        public ulong bottomFromText
1729
        {
1730
            get
1731
            {
1732
                return this.bottomFromTextField;
1733
            }
1734
            set
1735
            {
1736
                this.bottomFromTextField = value;
1737
            }
1738
        }
1739

1740
        [XmlIgnore]
1741
        public bool bottomFromTextSpecified
1742
        {
1743
            get
1744
            {
1745
                return this.bottomFromTextFieldSpecified;
1746
            }
1747
            set
1748
            {
1749
                this.bottomFromTextFieldSpecified = value;
1750
            }
1751
        }
1752

1753
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
1754
        public ST_VAnchor vertAnchor
1755
        {
1756
            get
1757
            {
1758
                return this.vertAnchorField;
1759
            }
1760
            set
1761
            {
1762
                this.vertAnchorField = value;
1763
            }
1764
        }
1765

1766
        [XmlIgnore]
1767
        public bool vertAnchorSpecified
1768
        {
1769
            get
1770
            {
1771
                return this.vertAnchorFieldSpecified;
1772
            }
1773
            set
1774
            {
1775
                this.vertAnchorFieldSpecified = value;
1776
            }
1777
        }
1778

1779
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
1780
        public ST_HAnchor horzAnchor
1781
        {
1782
            get
1783
            {
1784
                return this.horzAnchorField;
1785
            }
1786
            set
1787
            {
1788
                this.horzAnchorField = value;
1789
            }
1790
        }
1791

1792
        [XmlIgnore]
1793
        public bool horzAnchorSpecified
1794
        {
1795
            get
1796
            {
1797
                return this.horzAnchorFieldSpecified;
1798
            }
1799
            set
1800
            {
1801
                this.horzAnchorFieldSpecified = value;
1802
            }
1803
        }
1804

1805
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
1806
        public ST_XAlign tblpXSpec
1807
        {
1808
            get
1809
            {
1810
                return this.tblpXSpecField;
1811
            }
1812
            set
1813
            {
1814
                this.tblpXSpecFieldSpecified = true;
1815
                this.tblpXSpecField = value;
1816
            }
1817
        }
1818

1819
        [XmlIgnore]
1820
        public bool tblpXSpecSpecified
1821
        {
1822
            get
1823
            {
1824
                return this.tblpXSpecFieldSpecified;
1825
            }
1826
            set
1827
            {
1828
                this.tblpXSpecFieldSpecified = value;
1829
            }
1830
        }
1831

1832
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified, DataType = "integer")]
1833
        public string tblpX
1834
        {
1835
            get
1836
            {
1837
                return this.tblpXField;
1838
            }
1839
            set
1840
            {
1841
                this.tblpXField = value;
1842
            }
1843
        }
1844

1845
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
1846
        public ST_YAlign tblpYSpec
1847
        {
1848
            get
1849
            {
1850
                return this.tblpYSpecField;
1851
            }
1852
            set
1853
            {
1854
                this.tblpYSpecFieldSpecified = true;
1855
                this.tblpYSpecField = value;
1856
            }
1857
        }
1858

1859
        [XmlIgnore]
1860
        public bool tblpYSpecSpecified
1861
        {
1862
            get
1863
            {
1864
                return this.tblpYSpecFieldSpecified;
1865
            }
1866
            set
1867
            {
1868
                this.tblpYSpecFieldSpecified = value;
1869
            }
1870
        }
1871

1872
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified, DataType = "integer")]
1873
        public string tblpY
1874
        {
1875
            get
1876
            {
1877
                return this.tblpYField;
1878
            }
1879
            set
1880
            {
1881
                this.tblpYField = value;
1882
            }
1883
        }
1884
    }
1885

1886

1887
    [Serializable]
1888

1889
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
1890
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
1891
    public class CT_Height
1892
    {
1893

1894
        private ulong valField;
1895

1896

1897
        private ST_HeightRule hRuleField= ST_HeightRule.auto;
1898

1899
        public static CT_Height Parse(XmlNode node, XmlNamespaceManager namespaceManager)
1900
        {
1901
            if (node == null)
1902
                return null;
1903
            CT_Height ctObj = new CT_Height();
1904
            ctObj.val = XmlHelper.ReadULong(node.Attributes["w:val"]);
1905
            if (node.Attributes["w:hRule"] != null)
1906
                ctObj.hRule = (ST_HeightRule)Enum.Parse(typeof(ST_HeightRule), node.Attributes["w:hRule"].Value);
1907
            return ctObj;
1908
        }
1909

1910

1911

1912
        internal void Write(StreamWriter sw, string nodeName)
1913
        {
1914
            sw.Write(string.Format("<w:{0}", nodeName));
1915
            if(this.hRule!= ST_HeightRule.auto)
1916
                XmlHelper.WriteAttribute(sw, "w:hRule", this.hRule.ToString());
1917
            XmlHelper.WriteAttribute(sw, "w:val", this.val);
1918
            sw.Write("/>");
1919
        }
1920

1921
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
1922
        public ulong val
1923
        {
1924
            get
1925
            {
1926
                return this.valField;
1927
            }
1928
            set
1929
            {
1930
                this.valField = value;
1931
            }
1932
        }
1933

1934
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
1935
        public ST_HeightRule hRule
1936
        {
1937
            get
1938
            {
1939
                return this.hRuleField;
1940
            }
1941
            set
1942
            {
1943
                this.hRuleField = value;
1944
            }
1945
        }
1946
    }
1947

1948

1949
    [Serializable]
1950
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IncludeInSchema = false)]
1951
    public enum ItemsChoiceType2
1952
    {
1953

1954
    
1955
        cantSplit,
1956

1957
    
1958
        cnfStyle,
1959

1960
    
1961
        divId,
1962

1963
    
1964
        gridAfter,
1965

1966
    
1967
        gridBefore,
1968

1969
    
1970
        hidden,
1971

1972
    
1973
        jc,
1974

1975
    
1976
        tblCellSpacing,
1977

1978
    
1979
        tblHeader,
1980

1981
    
1982
        trHeight,
1983

1984
    
1985
        wAfter,
1986

1987
    
1988
        wBefore,
1989
    }
1990

1991
    [Serializable]
1992

1993
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
1994
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
1995
    public class CT_TblPrExChange : CT_TrackChange
1996
    {
1997

1998
        private CT_TblPrExBase tblPrExField;
1999

2000
        public CT_TblPrExChange()
2001
        {
2002
            
2003
        }
2004
        public static new CT_TblPrExChange Parse(XmlNode node, XmlNamespaceManager namespaceManager)
2005
        {
2006
            if (node == null)
2007
                return null;
2008
            CT_TblPrExChange ctObj = new CT_TblPrExChange();
2009
            ctObj.author = XmlHelper.ReadString(node.Attributes["w:author"]);
2010
            ctObj.date = XmlHelper.ReadString(node.Attributes["w:date"]);
2011
            ctObj.id = XmlHelper.ReadString(node.Attributes["w:id"]);
2012
            foreach (XmlNode childNode in node.ChildNodes)
2013
            {
2014
                if (childNode.LocalName == "tblPrEx")
2015
                    ctObj.tblPrEx = CT_TblPrExBase.Parse(childNode, namespaceManager);
2016
            }
2017
            return ctObj;
2018
        }
2019

2020

2021

2022
        internal new void Write(StreamWriter sw, string nodeName)
2023
        {
2024
            sw.Write(string.Format("<w:{0}", nodeName));
2025
            XmlHelper.WriteAttribute(sw, "w:author", this.author);
2026
            XmlHelper.WriteAttribute(sw, "w:date", this.date);
2027
            XmlHelper.WriteAttribute(sw, "w:id", this.id);
2028
            sw.Write(">");
2029
            if (this.tblPrEx != null)
2030
                this.tblPrEx.Write(sw, "tblPrEx");
2031
            sw.WriteEndW(nodeName);
2032
        }
2033

2034
        [XmlElement(Order = 0)]
2035
        public CT_TblPrExBase tblPrEx
2036
        {
2037
            get
2038
            {
2039
                return this.tblPrExField;
2040
            }
2041
            set
2042
            {
2043
                this.tblPrExField = value;
2044
            }
2045
        }
2046
    }
2047

2048
    [XmlInclude(typeof(CT_TblPrEx))]
2049

2050
    [Serializable]
2051

2052
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
2053
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
2054
    public class CT_TblPrExBase
2055
    {
2056

2057
        private CT_TblWidth tblWField;
2058

2059
        private CT_Jc jcField;
2060

2061
        private CT_TblWidth tblCellSpacingField;
2062

2063
        private CT_TblWidth tblIndField;
2064

2065
        private CT_TblBorders tblBordersField;
2066

2067
        private CT_Shd shdField;
2068

2069
        private CT_TblLayoutType tblLayoutField;
2070

2071
        private CT_TblCellMar tblCellMarField;
2072

2073
        private CT_ShortHexNumber tblLookField;
2074
        public static CT_TblPrExBase Parse(XmlNode node, XmlNamespaceManager namespaceManager)
2075
        {
2076
            if (node == null)
2077
                return null;
2078
            CT_TblPrExBase ctObj = new CT_TblPrExBase();
2079
            foreach (XmlNode childNode in node.ChildNodes)
2080
            {
2081
                if (childNode.LocalName == "tblW")
2082
                    ctObj.tblW = CT_TblWidth.Parse(childNode, namespaceManager);
2083
                else if (childNode.LocalName == "jc")
2084
                    ctObj.jc = CT_Jc.Parse(childNode, namespaceManager);
2085
                else if (childNode.LocalName == "tblCellSpacing")
2086
                    ctObj.tblCellSpacing = CT_TblWidth.Parse(childNode, namespaceManager);
2087
                else if (childNode.LocalName == "tblInd")
2088
                    ctObj.tblInd = CT_TblWidth.Parse(childNode, namespaceManager);
2089
                else if (childNode.LocalName == "tblBorders")
2090
                    ctObj.tblBorders = CT_TblBorders.Parse(childNode, namespaceManager);
2091
                else if (childNode.LocalName == "shd")
2092
                    ctObj.shd = CT_Shd.Parse(childNode, namespaceManager);
2093
                else if (childNode.LocalName == "tblLayout")
2094
                    ctObj.tblLayout = CT_TblLayoutType.Parse(childNode, namespaceManager);
2095
                else if (childNode.LocalName == "tblCellMar")
2096
                    ctObj.tblCellMar = CT_TblCellMar.Parse(childNode, namespaceManager);
2097
                else if (childNode.LocalName == "tblLook")
2098
                    ctObj.tblLook = CT_ShortHexNumber.Parse(childNode, namespaceManager);
2099
            }
2100
            return ctObj;
2101
        }
2102

2103

2104

2105
        internal void Write(StreamWriter sw, string nodeName)
2106
        {
2107
            sw.Write(string.Format("<w:{0}", nodeName));
2108
            sw.Write(">");
2109
            if (this.tblW != null)
2110
                this.tblW.Write(sw, "tblW");
2111
            if (this.jc != null)
2112
                this.jc.Write(sw, "jc");
2113
            if (this.tblCellSpacing != null)
2114
                this.tblCellSpacing.Write(sw, "tblCellSpacing");
2115
            if (this.tblInd != null)
2116
                this.tblInd.Write(sw, "tblInd");
2117
            if (this.tblBorders != null)
2118
                this.tblBorders.Write(sw, "tblBorders");
2119
            if (this.shd != null)
2120
                this.shd.Write(sw, "shd");
2121
            if (this.tblLayout != null)
2122
                this.tblLayout.Write(sw, "tblLayout");
2123
            if (this.tblCellMar != null)
2124
                this.tblCellMar.Write(sw, "tblCellMar");
2125
            if (this.tblLook != null)
2126
                this.tblLook.Write(sw, "tblLook");
2127
            sw.WriteEndW(nodeName);
2128
        }
2129

2130
        public CT_TblPrExBase()
2131
        {
2132
            //this.tblLookField = new CT_ShortHexNumber();
2133
            //this.tblCellMarField = new CT_TblCellMar();
2134
            //this.tblLayoutField = new CT_TblLayoutType();
2135
            //this.shdField = new CT_Shd();
2136
            //this.tblBordersField = new CT_TblBorders();
2137
            //this.tblIndField = new CT_TblWidth();
2138
            //this.tblCellSpacingField = new CT_TblWidth();
2139
            //this.jcField = new CT_Jc();
2140
            //this.tblWField = new CT_TblWidth();
2141
        }
2142

2143
        [XmlElement(Order = 0)]
2144
        public CT_TblWidth tblW
2145
        {
2146
            get
2147
            {
2148
                return this.tblWField;
2149
            }
2150
            set
2151
            {
2152
                this.tblWField = value;
2153
            }
2154
        }
2155

2156
        [XmlElement(Order = 1)]
2157
        public CT_Jc jc
2158
        {
2159
            get
2160
            {
2161
                return this.jcField;
2162
            }
2163
            set
2164
            {
2165
                this.jcField = value;
2166
            }
2167
        }
2168

2169
        [XmlElement(Order = 2)]
2170
        public CT_TblWidth tblCellSpacing
2171
        {
2172
            get
2173
            {
2174
                return this.tblCellSpacingField;
2175
            }
2176
            set
2177
            {
2178
                this.tblCellSpacingField = value;
2179
            }
2180
        }
2181

2182
        [XmlElement(Order = 3)]
2183
        public CT_TblWidth tblInd
2184
        {
2185
            get
2186
            {
2187
                return this.tblIndField;
2188
            }
2189
            set
2190
            {
2191
                this.tblIndField = value;
2192
            }
2193
        }
2194

2195
        [XmlElement(Order = 4)]
2196
        public CT_TblBorders tblBorders
2197
        {
2198
            get
2199
            {
2200
                return this.tblBordersField;
2201
            }
2202
            set
2203
            {
2204
                this.tblBordersField = value;
2205
            }
2206
        }
2207

2208
        [XmlElement(Order = 5)]
2209
        public CT_Shd shd
2210
        {
2211
            get
2212
            {
2213
                return this.shdField;
2214
            }
2215
            set
2216
            {
2217
                this.shdField = value;
2218
            }
2219
        }
2220

2221
        [XmlElement(Order = 6)]
2222
        public CT_TblLayoutType tblLayout
2223
        {
2224
            get
2225
            {
2226
                return this.tblLayoutField;
2227
            }
2228
            set
2229
            {
2230
                this.tblLayoutField = value;
2231
            }
2232
        }
2233

2234
        [XmlElement(Order = 7)]
2235
        public CT_TblCellMar tblCellMar
2236
        {
2237
            get
2238
            {
2239
                return this.tblCellMarField;
2240
            }
2241
            set
2242
            {
2243
                this.tblCellMarField = value;
2244
            }
2245
        }
2246

2247
        [XmlElement(Order = 8)]
2248
        public CT_ShortHexNumber tblLook
2249
        {
2250
            get
2251
            {
2252
                return this.tblLookField;
2253
            }
2254
            set
2255
            {
2256
                this.tblLookField = value;
2257
            }
2258
        }
2259
    }
2260

2261

2262
    [Serializable]
2263

2264
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
2265
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
2266
    public class CT_TblPrEx : CT_TblPrExBase
2267
    {
2268

2269
        private CT_TblPrExChange tblPrExChangeField;
2270
        public static new CT_TblPrEx Parse(XmlNode node, XmlNamespaceManager namespaceManager)
2271
        {
2272
            if (node == null)
2273
                return null;
2274
            CT_TblPrEx ctObj = new CT_TblPrEx();
2275
            foreach (XmlNode childNode in node.ChildNodes)
2276
            {
2277
                if (childNode.LocalName == "tblPrExChange")
2278
                    ctObj.tblPrExChange = CT_TblPrExChange.Parse(childNode, namespaceManager);
2279
                else if (childNode.LocalName == "tblW")
2280
                    ctObj.tblW = CT_TblWidth.Parse(childNode, namespaceManager);
2281
                else if (childNode.LocalName == "jc")
2282
                    ctObj.jc = CT_Jc.Parse(childNode, namespaceManager);
2283
                else if (childNode.LocalName == "tblCellSpacing")
2284
                    ctObj.tblCellSpacing = CT_TblWidth.Parse(childNode, namespaceManager);
2285
                else if (childNode.LocalName == "tblInd")
2286
                    ctObj.tblInd = CT_TblWidth.Parse(childNode, namespaceManager);
2287
                else if (childNode.LocalName == "tblBorders")
2288
                    ctObj.tblBorders = CT_TblBorders.Parse(childNode, namespaceManager);
2289
                else if (childNode.LocalName == "shd")
2290
                    ctObj.shd = CT_Shd.Parse(childNode, namespaceManager);
2291
                else if (childNode.LocalName == "tblLayout")
2292
                    ctObj.tblLayout = CT_TblLayoutType.Parse(childNode, namespaceManager);
2293
                else if (childNode.LocalName == "tblCellMar")
2294
                    ctObj.tblCellMar = CT_TblCellMar.Parse(childNode, namespaceManager);
2295
                else if (childNode.LocalName == "tblLook")
2296
                    ctObj.tblLook = CT_ShortHexNumber.Parse(childNode, namespaceManager);
2297
            }
2298
            return ctObj;
2299
        }
2300

2301

2302

2303
        internal new void Write(StreamWriter sw, string nodeName)
2304
        {
2305
            sw.Write(string.Format("<w:{0}", nodeName));
2306
            sw.Write(">");
2307
            if (this.tblPrExChange != null)
2308
                this.tblPrExChange.Write(sw, "tblPrExChange");
2309
            if (this.tblW != null)
2310
                this.tblW.Write(sw, "tblW");
2311
            if (this.jc != null)
2312
                this.jc.Write(sw, "jc");
2313
            if (this.tblCellSpacing != null)
2314
                this.tblCellSpacing.Write(sw, "tblCellSpacing");
2315
            if (this.tblInd != null)
2316
                this.tblInd.Write(sw, "tblInd");
2317
            if (this.tblBorders != null)
2318
                this.tblBorders.Write(sw, "tblBorders");
2319
            if (this.shd != null)
2320
                this.shd.Write(sw, "shd");
2321
            if (this.tblLayout != null)
2322
                this.tblLayout.Write(sw, "tblLayout");
2323
            if (this.tblCellMar != null)
2324
                this.tblCellMar.Write(sw, "tblCellMar");
2325
            if (this.tblLook != null)
2326
                this.tblLook.Write(sw, "tblLook");
2327
            sw.WriteEndW(nodeName);
2328
        }
2329

2330
        public CT_TblPrEx()
2331
        {
2332
        }
2333

2334
        [XmlElement(Order = 0)]
2335
        public CT_TblPrExChange tblPrExChange
2336
        {
2337
            get
2338
            {
2339
                return this.tblPrExChangeField;
2340
            }
2341
            set
2342
            {
2343
                this.tblPrExChangeField = value;
2344
            }
2345
        }
2346
    }
2347

2348
    [Serializable]
2349

2350
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
2351
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
2352
    public class CT_TblBorders
2353
    {
2354

2355
        private CT_Border topField;
2356

2357
        private CT_Border leftField;
2358

2359
        private CT_Border bottomField;
2360

2361
        private CT_Border rightField;
2362

2363
        private CT_Border insideHField;
2364

2365
        private CT_Border insideVField;
2366

2367
        public CT_TblBorders()
2368
        {
2369
        }
2370
        public static CT_TblBorders Parse(XmlNode node, XmlNamespaceManager namespaceManager)
2371
        {
2372
            if (node == null)
2373
                return null;
2374
            CT_TblBorders ctObj = new CT_TblBorders();
2375
            foreach (XmlNode childNode in node.ChildNodes)
2376
            {
2377
                if (childNode.LocalName == "top")
2378
                    ctObj.top = CT_Border.Parse(childNode, namespaceManager);
2379
                else if (childNode.LocalName == "left")
2380
                    ctObj.left = CT_Border.Parse(childNode, namespaceManager);
2381
                else if (childNode.LocalName == "bottom")
2382
                    ctObj.bottom = CT_Border.Parse(childNode, namespaceManager);
2383
                else if (childNode.LocalName == "right")
2384
                    ctObj.right = CT_Border.Parse(childNode, namespaceManager);
2385
                else if (childNode.LocalName == "insideH")
2386
                    ctObj.insideH = CT_Border.Parse(childNode, namespaceManager);
2387
                else if (childNode.LocalName == "insideV")
2388
                    ctObj.insideV = CT_Border.Parse(childNode, namespaceManager);
2389
            }
2390
            return ctObj;
2391
        }
2392

2393

2394

2395
        internal void Write(StreamWriter sw, string nodeName)
2396
        {
2397
            sw.Write(string.Format("<w:{0}", nodeName));
2398
            sw.Write(">");
2399
            if (this.top != null)
2400
                this.top.Write(sw, "top");
2401
            if (this.left != null)
2402
                this.left.Write(sw, "left");
2403
            if (this.bottom != null)
2404
                this.bottom.Write(sw, "bottom");
2405
            if (this.right != null)
2406
                this.right.Write(sw, "right");
2407
            if (this.insideH != null)
2408
                this.insideH.Write(sw, "insideH");
2409
            if (this.insideV != null)
2410
                this.insideV.Write(sw, "insideV");
2411
            sw.WriteEndW(nodeName);
2412
        }
2413

2414
        [XmlElement(Order = 0)]
2415
        public CT_Border top
2416
        {
2417
            get
2418
            {
2419
                return this.topField;
2420
            }
2421
            set
2422
            {
2423
                this.topField = value;
2424
            }
2425
        }
2426

2427
        [XmlElement(Order = 1)]
2428
        public CT_Border left
2429
        {
2430
            get
2431
            {
2432
                return this.leftField;
2433
            }
2434
            set
2435
            {
2436
                this.leftField = value;
2437
            }
2438
        }
2439

2440
        [XmlElement(Order = 2)]
2441
        public CT_Border bottom
2442
        {
2443
            get
2444
            {
2445
                return this.bottomField;
2446
            }
2447
            set
2448
            {
2449
                this.bottomField = value;
2450
            }
2451
        }
2452

2453
        [XmlElement(Order = 3)]
2454
        public CT_Border right
2455
        {
2456
            get
2457
            {
2458
                return this.rightField;
2459
            }
2460
            set
2461
            {
2462
                this.rightField = value;
2463
            }
2464
        }
2465

2466
        [XmlElement(Order = 4)]
2467
        public CT_Border insideH
2468
        {
2469
            get
2470
            {
2471
                return this.insideHField;
2472
            }
2473
            set
2474
            {
2475
                this.insideHField = value;
2476
            }
2477
        }
2478

2479
        [XmlElement(Order = 5)]
2480
        public CT_Border insideV
2481
        {
2482
            get
2483
            {
2484
                return this.insideVField;
2485
            }
2486
            set
2487
            {
2488
                this.insideVField = value;
2489
            }
2490
        }
2491

2492
        public CT_Border AddNewBottom()
2493
        {
2494
            if (this.bottomField == null)
2495
                this.bottomField = new CT_Border();
2496
            return this.bottomField;
2497
        }
2498

2499
        public CT_Border AddNewLeft()
2500
        {
2501
            if (this.leftField == null)
2502
                this.leftField = new CT_Border();
2503
            return this.leftField;
2504
        }
2505

2506
        public CT_Border AddNewRight()
2507
        {
2508
            if (this.rightField == null)
2509
                this.rightField = new CT_Border();
2510
            return this.rightField;
2511
        }
2512

2513
        public CT_Border AddNewTop()
2514
        {
2515
            if (this.topField == null)
2516
                this.topField = new CT_Border();
2517
            return this.topField;
2518
        }
2519

2520
        public CT_Border AddNewInsideH()
2521
        {
2522
            if (this.insideHField == null)
2523
                this.insideHField = new CT_Border();
2524
            return this.insideHField;
2525
        }
2526

2527
        public CT_Border AddNewInsideV()
2528
        {
2529
            if (this.insideVField == null)
2530
                this.insideVField = new CT_Border();
2531
            return this.insideVField;
2532
        }
2533

2534
        public bool IsSetInsideH()
2535
        {
2536
            return this.insideH != null;
2537
        }
2538

2539
        public bool IsSetInsideV()
2540
        {
2541
            return this.insideV != null;
2542
        }
2543
    }
2544

2545

2546
    [Serializable]
2547

2548
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
2549
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
2550
    public class CT_TblLayoutType
2551
    {
2552

2553
        private ST_TblLayoutType typeField;
2554

2555
        private bool typeFieldSpecified;
2556
        public static CT_TblLayoutType Parse(XmlNode node, XmlNamespaceManager namespaceManager)
2557
        {
2558
            if (node == null)
2559
                return null;
2560
            CT_TblLayoutType ctObj = new CT_TblLayoutType();
2561
            if (node.Attributes["w:type"] != null)
2562
                ctObj.type = (ST_TblLayoutType)Enum.Parse(typeof(ST_TblLayoutType), node.Attributes["w:type"].Value);
2563
            return ctObj;
2564
        }
2565

2566

2567

2568
        internal void Write(StreamWriter sw, string nodeName)
2569
        {
2570
            sw.Write(string.Format("<w:{0}", nodeName));
2571
            XmlHelper.WriteAttribute(sw, "w:type", this.type.ToString());
2572
            sw.Write("/>");
2573
        }
2574

2575
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
2576
        public ST_TblLayoutType type
2577
        {
2578
            get
2579
            {
2580
                return this.typeField;
2581
            }
2582
            set
2583
            {
2584
                this.typeField = value;
2585
            }
2586
        }
2587

2588
        [XmlIgnore]
2589
        public bool typeSpecified
2590
        {
2591
            get
2592
            {
2593
                return this.typeFieldSpecified;
2594
            }
2595
            set
2596
            {
2597
                this.typeFieldSpecified = value;
2598
            }
2599
        }
2600
    }
2601

2602

2603
    [Serializable]
2604
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
2605
    public enum ST_TblLayoutType
2606
    {
2607

2608
    
2609
        @fixed,
2610

2611
    
2612
        autofit,
2613
    }
2614

2615

2616
    [Serializable]
2617

2618
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
2619
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
2620
    public class CT_TblCellMar
2621
    {
2622

2623
        private CT_TblWidth topField;
2624

2625
        private CT_TblWidth leftField;
2626

2627
        private CT_TblWidth bottomField;
2628

2629
        private CT_TblWidth rightField;
2630
        public static CT_TblCellMar Parse(XmlNode node, XmlNamespaceManager namespaceManager)
2631
        {
2632
            if (node == null)
2633
                return null;
2634
            CT_TblCellMar ctObj = new CT_TblCellMar();
2635
            foreach (XmlNode childNode in node.ChildNodes)
2636
            {
2637
                if (childNode.LocalName == "top")
2638
                    ctObj.top = CT_TblWidth.Parse(childNode, namespaceManager);
2639
                else if (childNode.LocalName == "left")
2640
                    ctObj.left = CT_TblWidth.Parse(childNode, namespaceManager);
2641
                else if (childNode.LocalName == "bottom")
2642
                    ctObj.bottom = CT_TblWidth.Parse(childNode, namespaceManager);
2643
                else if (childNode.LocalName == "right")
2644
                    ctObj.right = CT_TblWidth.Parse(childNode, namespaceManager);
2645
            }
2646
            return ctObj;
2647
        }
2648

2649

2650

2651
        internal void Write(StreamWriter sw, string nodeName)
2652
        {
2653
            sw.Write(string.Format("<w:{0}", nodeName));
2654
            sw.Write(">");
2655
            if (this.top != null)
2656
                this.top.Write(sw, "top");
2657
            if (this.left != null)
2658
                this.left.Write(sw, "left");
2659
            if (this.bottom != null)
2660
                this.bottom.Write(sw, "bottom");
2661
            if (this.right != null)
2662
                this.right.Write(sw, "right");
2663
            sw.WriteEndW(nodeName);
2664
        }
2665

2666
        public CT_TblCellMar()
2667
        {
2668
            //this.rightField = new CT_TblWidth();
2669
            //this.bottomField = new CT_TblWidth();
2670
            //this.leftField = new CT_TblWidth();
2671
            //this.topField = new CT_TblWidth();
2672
        }
2673

2674
        [XmlElement(Order = 0)]
2675
        public CT_TblWidth top
2676
        {
2677
            get
2678
            {
2679
                return this.topField;
2680
            }
2681
            set
2682
            {
2683
                this.topField = value;
2684
            }
2685
        }
2686

2687
        [XmlElement(Order = 1)]
2688
        public CT_TblWidth left
2689
        {
2690
            get
2691
            {
2692
                return this.leftField;
2693
            }
2694
            set
2695
            {
2696
                this.leftField = value;
2697
            }
2698
        }
2699

2700
        [XmlElement(Order = 2)]
2701
        public CT_TblWidth bottom
2702
        {
2703
            get
2704
            {
2705
                return this.bottomField;
2706
            }
2707
            set
2708
            {
2709
                this.bottomField = value;
2710
            }
2711
        }
2712

2713
        [XmlElement(Order = 3)]
2714
        public CT_TblWidth right
2715
        {
2716
            get
2717
            {
2718
                return this.rightField;
2719
            }
2720
            set
2721
            {
2722
                this.rightField = value;
2723
            }
2724
        }
2725

2726
        public bool IsSetLeft()
2727
        {
2728
            return this.leftField != null;
2729
        }
2730

2731
        public bool IsSetTop()
2732
        {
2733
            return this.topField != null;
2734
        }
2735

2736
        public bool IsSetBottom()
2737
        {
2738
            return this.bottomField != null;
2739
        }
2740

2741
        public bool IsSetRight()
2742
        {
2743
            return this.rightField != null;
2744
        }
2745

2746
        public CT_TblWidth AddNewLeft()
2747
        {
2748
            this.leftField = new CT_TblWidth();
2749
            return this.leftField;
2750
        }
2751

2752
        public CT_TblWidth AddNewTop()
2753
        {
2754
            this.topField = new CT_TblWidth();
2755
            return this.topField;
2756
        }
2757

2758
        public CT_TblWidth AddNewBottom()
2759
        {
2760
            this.bottomField = new CT_TblWidth();
2761
            return this.bottomField;
2762
        }
2763

2764
        public CT_TblWidth AddNewRight()
2765
        {
2766
            this.rightField = new CT_TblWidth();
2767
            return this.rightField;
2768
        }
2769
    }
2770

2771

2772

2773

2774
    [Serializable]
2775

2776
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
2777
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
2778
    public class CT_TblPr : CT_TblPrBase
2779
    {
2780

2781
        private CT_TblPrChange tblPrChangeField;
2782
        public static new CT_TblPr Parse(XmlNode node, XmlNamespaceManager namespaceManager)
2783
        {
2784
            if (node == null)
2785
                return null;
2786
            CT_TblPr ctObj = new CT_TblPr();
2787
            foreach (XmlNode childNode in node.ChildNodes)
2788
            {
2789
                if (childNode.LocalName == "tblPrChange")
2790
                    ctObj.tblPrChange = CT_TblPrChange.Parse(childNode, namespaceManager);
2791
                else if (childNode.LocalName == "tblStyle")
2792
                    ctObj.tblStyle = CT_String.Parse(childNode, namespaceManager);
2793
                else if (childNode.LocalName == "tblpPr")
2794
                    ctObj.tblpPr = CT_TblPPr.Parse(childNode, namespaceManager);
2795
                else if (childNode.LocalName == "tblOverlap")
2796
                    ctObj.tblOverlap = CT_TblOverlap.Parse(childNode, namespaceManager);
2797
                else if (childNode.LocalName == "bidiVisual")
2798
                    ctObj.bidiVisual = CT_OnOff.Parse(childNode, namespaceManager);
2799
                else if (childNode.LocalName == "tblStyleRowBandSize")
2800
                    ctObj.tblStyleRowBandSize = CT_DecimalNumber.Parse(childNode, namespaceManager);
2801
                else if (childNode.LocalName == "tblStyleColBandSize")
2802
                    ctObj.tblStyleColBandSize = CT_DecimalNumber.Parse(childNode, namespaceManager);
2803
                else if (childNode.LocalName == "tblW")
2804
                    ctObj.tblW = CT_TblWidth.Parse(childNode, namespaceManager);
2805
                else if (childNode.LocalName == "jc")
2806
                    ctObj.jc = CT_Jc.Parse(childNode, namespaceManager);
2807
                else if (childNode.LocalName == "tblCellSpacing")
2808
                    ctObj.tblCellSpacing = CT_TblWidth.Parse(childNode, namespaceManager);
2809
                else if (childNode.LocalName == "tblInd")
2810
                    ctObj.tblInd = CT_TblWidth.Parse(childNode, namespaceManager);
2811
                else if (childNode.LocalName == "tblBorders")
2812
                    ctObj.tblBorders = CT_TblBorders.Parse(childNode, namespaceManager);
2813
                else if (childNode.LocalName == "shd")
2814
                    ctObj.shd = CT_Shd.Parse(childNode, namespaceManager);
2815
                else if (childNode.LocalName == "tblLayout")
2816
                    ctObj.tblLayout = CT_TblLayoutType.Parse(childNode, namespaceManager);
2817
                else if (childNode.LocalName == "tblCellMar")
2818
                    ctObj.tblCellMar = CT_TblCellMar.Parse(childNode, namespaceManager);
2819
                else if (childNode.LocalName == "tblLook")
2820
                    ctObj.tblLook = CT_ShortHexNumber.Parse(childNode, namespaceManager);
2821
                else if (childNode.LocalName == "tblCaption")
2822
                    ctObj.tblCaption = CT_String.Parse(childNode, namespaceManager);
2823
                else if (childNode.LocalName == "tblDescription")
2824
                    ctObj.tblDescription = CT_String.Parse(childNode, namespaceManager);
2825
            }
2826
            return ctObj;
2827
        }
2828

2829

2830

2831
        internal new void Write(StreamWriter sw, string nodeName)
2832
        {
2833
            sw.Write(string.Format("<w:{0}", nodeName));
2834
            sw.Write(">");
2835
            if (this.tblPrChange != null)
2836
                this.tblPrChange.Write(sw, "tblPrChange");
2837
            if (this.tblStyle != null)
2838
                this.tblStyle.Write(sw, "tblStyle");
2839
            if (this.tblpPr != null)
2840
                this.tblpPr.Write(sw, "tblpPr");
2841
            if (this.tblOverlap != null)
2842
                this.tblOverlap.Write(sw, "tblOverlap");
2843
            if (this.bidiVisual != null)
2844
                this.bidiVisual.Write(sw, "bidiVisual");
2845
            if (this.tblStyleRowBandSize != null)
2846
                this.tblStyleRowBandSize.Write(sw, "tblStyleRowBandSize");
2847
            if (this.tblStyleColBandSize != null)
2848
                this.tblStyleColBandSize.Write(sw, "tblStyleColBandSize");
2849
            if (this.tblW != null)
2850
                this.tblW.Write(sw, "tblW");
2851
            if (this.jc != null)
2852
                this.jc.Write(sw, "jc");
2853
            if (this.tblCellSpacing != null)
2854
                this.tblCellSpacing.Write(sw, "tblCellSpacing");
2855
            if (this.tblInd != null)
2856
                this.tblInd.Write(sw, "tblInd");
2857
            if (this.tblBorders != null)
2858
                this.tblBorders.Write(sw, "tblBorders");
2859
            if (this.shd != null)
2860
                this.shd.Write(sw, "shd");
2861
            if (this.tblLayout != null)
2862
                this.tblLayout.Write(sw, "tblLayout");
2863
            if (this.tblCellMar != null)
2864
                this.tblCellMar.Write(sw, "tblCellMar");
2865
            if (this.tblLook != null)
2866
                this.tblLook.Write(sw, "tblLook");
2867
            if (this.tblCaption != null)
2868
                this.tblCaption.Write(sw, "tblCaption");
2869
            if (this.tblDescription != null)
2870
                this.tblDescription.Write(sw, "tblDescription");
2871
            sw.WriteEndW(nodeName);
2872
        }
2873

2874
        public CT_TblPr()
2875
        {
2876
            //this.tblPrChangeField = new CT_TblPrChange();
2877
        }
2878

2879
        [XmlElement(Order = 0)]
2880
        public CT_TblPrChange tblPrChange
2881
        {
2882
            get
2883
            {
2884
                return this.tblPrChangeField;
2885
            }
2886
            set
2887
            {
2888
                this.tblPrChangeField = value;
2889
            }
2890
        }
2891

2892
        public CT_TblLayoutType AddNewTblLayout()
2893
        {
2894
            this.tblLayout = new CT_TblLayoutType();
2895
            return this.tblLayout;
2896
        }
2897

2898
        public CT_TblPPr AddNewTblPPr()
2899
        {
2900
            this.tblpPr = new CT_TblPPr();
2901
            return this.tblpPr;
2902
        }
2903
    }
2904

2905

2906
    [Serializable]
2907

2908
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
2909
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
2910
    public class CT_TrPrChange : CT_TrackChange
2911
    {
2912

2913
        private CT_TrPrBase trPrField;
2914

2915
        public CT_TrPrChange()
2916
        {
2917
            
2918
        }
2919
        public static new CT_TrPrChange Parse(XmlNode node, XmlNamespaceManager namespaceManager)
2920
        {
2921
            if (node == null)
2922
                return null;
2923
            CT_TrPrChange ctObj = new CT_TrPrChange();
2924
            ctObj.author = XmlHelper.ReadString(node.Attributes["w:author"]);
2925
            ctObj.date = XmlHelper.ReadString(node.Attributes["w:date"]);
2926
            ctObj.id = XmlHelper.ReadString(node.Attributes["r:id"]);
2927
            foreach (XmlNode childNode in node.ChildNodes)
2928
            {
2929
                if (childNode.LocalName == "trPr")
2930
                    ctObj.trPr = CT_TrPrBase.Parse(childNode, namespaceManager);
2931
            }
2932
            return ctObj;
2933
        }
2934

2935

2936

2937
        internal new void Write(StreamWriter sw, string nodeName)
2938
        {
2939
            sw.Write(string.Format("<w:{0}", nodeName));
2940
            XmlHelper.WriteAttribute(sw, "w:author", this.author);
2941
            XmlHelper.WriteAttribute(sw, "w:date", this.date);
2942
            XmlHelper.WriteAttribute(sw, "r:id", this.id);
2943
            sw.Write(">");
2944
            if (this.trPr != null)
2945
                this.trPr.Write(sw, "trPr");
2946
            sw.WriteEndW(nodeName);
2947
        }
2948

2949
        [XmlElement(Order = 0)]
2950
        public CT_TrPrBase trPr
2951
        {
2952
            get
2953
            {
2954
                return this.trPrField;
2955
            }
2956
            set
2957
            {
2958
                this.trPrField = value;
2959
            }
2960
        }
2961
    }
2962

2963
    [XmlInclude(typeof(CT_TrPr))]
2964

2965
    [Serializable]
2966

2967
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
2968
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
2969
    public class CT_TrPrBase
2970
    {
2971

2972
        private ArrayList itemsField;
2973

2974
        private List<ItemsChoiceType2> itemsElementNameField;
2975

2976
        public CT_TrPrBase()
2977
        {
2978
            this.itemsElementNameField = new List<ItemsChoiceType2>();
2979
            this.itemsField = new ArrayList();
2980
        }
2981
        public static CT_TrPrBase Parse(XmlNode node, XmlNamespaceManager namespaceManager)
2982
        {
2983
            if (node == null)
2984
                return null;
2985
            CT_TrPrBase ctObj = new CT_TrPrBase();
2986
            foreach (XmlNode childNode in node.ChildNodes)
2987
            {
2988
                if (childNode.LocalName == "gridBefore")
2989
                {
2990
                    ctObj.Items.Add(CT_DecimalNumber.Parse(childNode, namespaceManager));
2991
                    ctObj.ItemsElementName.Add(ItemsChoiceType2.gridBefore);
2992
                }
2993
                else if (childNode.LocalName == "cantSplit")
2994
                {
2995
                    ctObj.Items.Add(CT_OnOff.Parse(childNode, namespaceManager));
2996
                    ctObj.ItemsElementName.Add(ItemsChoiceType2.cantSplit);
2997
                }
2998
                else if (childNode.LocalName == "cnfStyle")
2999
                {
3000
                    ctObj.Items.Add(CT_Cnf.Parse(childNode, namespaceManager));
3001
                    ctObj.ItemsElementName.Add(ItemsChoiceType2.cnfStyle);
3002
                }
3003
                else if (childNode.LocalName == "divId")
3004
                {
3005
                    ctObj.Items.Add(CT_DecimalNumber.Parse(childNode, namespaceManager));
3006
                    ctObj.ItemsElementName.Add(ItemsChoiceType2.divId);
3007
                }
3008
                else if (childNode.LocalName == "gridAfter")
3009
                {
3010
                    ctObj.Items.Add(CT_DecimalNumber.Parse(childNode, namespaceManager));
3011
                    ctObj.ItemsElementName.Add(ItemsChoiceType2.gridAfter);
3012
                }
3013
                else if (childNode.LocalName == "trHeight")
3014
                {
3015
                    ctObj.Items.Add(CT_Height.Parse(childNode, namespaceManager));
3016
                    ctObj.ItemsElementName.Add(ItemsChoiceType2.trHeight);
3017
                }
3018
                else if (childNode.LocalName == "hidden")
3019
                {
3020
                    ctObj.Items.Add(CT_OnOff.Parse(childNode, namespaceManager));
3021
                    ctObj.ItemsElementName.Add(ItemsChoiceType2.hidden);
3022
                }
3023
                else if (childNode.LocalName == "tblCellSpacing")
3024
                {
3025
                    ctObj.Items.Add(CT_TblWidth.Parse(childNode, namespaceManager));
3026
                    ctObj.ItemsElementName.Add(ItemsChoiceType2.tblCellSpacing);
3027
                }
3028
                else if (childNode.LocalName == "tblHeader")
3029
                {
3030
                    ctObj.Items.Add(CT_OnOff.Parse(childNode, namespaceManager));
3031
                    ctObj.ItemsElementName.Add(ItemsChoiceType2.tblHeader);
3032
                }
3033
                else if (childNode.LocalName == "jc")
3034
                {
3035
                    ctObj.Items.Add(CT_Jc.Parse(childNode, namespaceManager));
3036
                    ctObj.ItemsElementName.Add(ItemsChoiceType2.jc);
3037
                }
3038
                else if (childNode.LocalName == "wAfter")
3039
                {
3040
                    ctObj.Items.Add(CT_TblWidth.Parse(childNode, namespaceManager));
3041
                    ctObj.ItemsElementName.Add(ItemsChoiceType2.wAfter);
3042
                }
3043
                else if (childNode.LocalName == "wBefore")
3044
                {
3045
                    ctObj.Items.Add(CT_TblWidth.Parse(childNode, namespaceManager));
3046
                    ctObj.ItemsElementName.Add(ItemsChoiceType2.wBefore);
3047
                }
3048
            }
3049
            return ctObj;
3050
        }
3051

3052
        internal void Write(StreamWriter sw, string nodeName)
3053
        {
3054
            sw.Write(string.Format("<w:{0}", nodeName));
3055
            sw.Write(">");
3056
            for (int i = 0; i < this.Items.Count; i++)
3057
            {
3058
                object o = this.Items[i];
3059
                if (o is CT_DecimalNumber
3060
                    && this.ItemsElementName[i] == ItemsChoiceType2.gridBefore)
3061
                    ((CT_DecimalNumber)o).Write(sw, "gridBefore");
3062
                else if (o is CT_OnOff
3063
                    && this.ItemsElementName[i] == ItemsChoiceType2.cantSplit)
3064
                    ((CT_OnOff)o).Write(sw, "cantSplit");
3065
                else if (o is CT_Cnf
3066
                    && this.ItemsElementName[i] == ItemsChoiceType2.cnfStyle)
3067
                    ((CT_Cnf)o).Write(sw, "cnfStyle");
3068
                else if (o is CT_DecimalNumber
3069
                    && this.ItemsElementName[i] == ItemsChoiceType2.divId)
3070
                    ((CT_DecimalNumber)o).Write(sw, "divId");
3071
                else if (o is CT_DecimalNumber
3072
                    && this.ItemsElementName[i] == ItemsChoiceType2.gridAfter)
3073
                    ((CT_DecimalNumber)o).Write(sw, "gridAfter");
3074
                else if (o is CT_Height
3075
                    && this.ItemsElementName[i] == ItemsChoiceType2.trHeight)
3076
                    ((CT_Height)o).Write(sw, "trHeight");
3077
                else if (o is CT_OnOff
3078
                    && this.ItemsElementName[i] == ItemsChoiceType2.hidden)
3079
                    ((CT_OnOff)o).Write(sw, "hidden");
3080
                else if (o is CT_TblWidth
3081
                    && this.ItemsElementName[i] == ItemsChoiceType2.tblCellSpacing)
3082
                    ((CT_TblWidth)o).Write(sw, "tblCellSpacing");
3083
                else if (o is CT_OnOff
3084
                    && this.ItemsElementName[i] == ItemsChoiceType2.tblHeader)
3085
                    ((CT_OnOff)o).Write(sw, "tblHeader");
3086
                else if (o is CT_Jc
3087
                    && this.ItemsElementName[i] == ItemsChoiceType2.jc)
3088
                    ((CT_Jc)o).Write(sw, "jc");
3089
                else if (o is CT_TblWidth
3090
                    && this.ItemsElementName[i] == ItemsChoiceType2.wAfter)
3091
                    ((CT_TblWidth)o).Write(sw, "wAfter");
3092
                else if (o is CT_TblWidth
3093
                    && this.ItemsElementName[i] == ItemsChoiceType2.wBefore)
3094
                    ((CT_TblWidth)o).Write(sw, "wBefore");
3095
            }
3096
            sw.WriteEndW(nodeName);
3097
        }
3098

3099
        [XmlElement("cantSplit", typeof(CT_OnOff), Order = 0)]
3100
        [XmlElement("cnfStyle", typeof(CT_Cnf), Order = 0)]
3101
        [XmlElement("divId", typeof(CT_DecimalNumber), Order = 0)]
3102
        [XmlElement("gridAfter", typeof(CT_DecimalNumber), Order = 0)]
3103
        [XmlElement("gridBefore", typeof(CT_DecimalNumber), Order = 0)]
3104
        [XmlElement("hidden", typeof(CT_OnOff), Order = 0)]
3105
        [XmlElement("jc", typeof(CT_Jc), Order = 0)]
3106
        [XmlElement("tblCellSpacing", typeof(CT_TblWidth), Order = 0)]
3107
        [XmlElement("tblHeader", typeof(CT_OnOff), Order = 0)]
3108
        [XmlElement("trHeight", typeof(CT_Height), Order = 0)]
3109
        [XmlElement("wAfter", typeof(CT_TblWidth), Order = 0)]
3110
        [XmlElement("wBefore", typeof(CT_TblWidth), Order = 0)]
3111
        [XmlChoiceIdentifier("ItemsElementName")]
3112
        public ArrayList Items
3113
        {
3114
            get
3115
            {
3116
                return this.itemsField;
3117
            }
3118
            set
3119
            {
3120
                this.itemsField = value;
3121
            }
3122
        }
3123

3124
        [XmlElement("ItemsElementName", Order = 1)]
3125
        [XmlIgnore]
3126
        public List<ItemsChoiceType2> ItemsElementName
3127
        {
3128
            get
3129
            {
3130
                return this.itemsElementNameField;
3131
            }
3132
            set
3133
            {
3134
                this.itemsElementNameField = value;
3135
            }
3136
        }
3137

3138
        public List<CT_OnOff        > GetCantSplitList     () { return GetObjectList<CT_OnOff        >(ItemsChoiceType2.cantSplit     ); }
3139
        public List<CT_Cnf          > GetCnfStyleList      () { return GetObjectList<CT_Cnf          >(ItemsChoiceType2.cnfStyle      ); }
3140
        public List<CT_DecimalNumber> GetDivIdList         () { return GetObjectList<CT_DecimalNumber>(ItemsChoiceType2.divId         ); }
3141
        public List<CT_DecimalNumber> GetGridAfterList     () { return GetObjectList<CT_DecimalNumber>(ItemsChoiceType2.gridAfter     ); }
3142
        public List<CT_DecimalNumber> GetGridBeforeList    () { return GetObjectList<CT_DecimalNumber>(ItemsChoiceType2.gridBefore    ); }
3143
        public List<CT_OnOff        > GetHiddenList        () { return GetObjectList<CT_OnOff        >(ItemsChoiceType2.hidden        ); }
3144
        public List<CT_Jc           > GetJcList            () { return GetObjectList<CT_Jc           >(ItemsChoiceType2.jc            ); }
3145
        public List<CT_TblWidth     > GetTblCellSpacingList() { return GetObjectList<CT_TblWidth     >(ItemsChoiceType2.tblCellSpacing); }
3146
        public List<CT_OnOff        > GetTblHeaderList     () { return GetObjectList<CT_OnOff        >(ItemsChoiceType2.tblHeader     ); }
3147
        public List<CT_Height       > GetTrHeightList      () { return GetObjectList<CT_Height       >(ItemsChoiceType2.trHeight      ); }
3148
        public List<CT_TblWidth     > GetWAfterList        () { return GetObjectList<CT_TblWidth     >(ItemsChoiceType2.wAfter        ); }
3149
        public List<CT_TblWidth     > GetWBeforeList       () { return GetObjectList<CT_TblWidth     >(ItemsChoiceType2.wBefore       ); }
3150

3151
        public int SizeOfCantSplitArray     () { return SizeOfArray(ItemsChoiceType2.cantSplit     ); }
3152
        public int SizeOfCnfStyleArray      () { return SizeOfArray(ItemsChoiceType2.cnfStyle      ); }
3153
        public int SizeOfDivIdArray         () { return SizeOfArray(ItemsChoiceType2.divId         ); }
3154
        public int SizeOfGridAfterArray     () { return SizeOfArray(ItemsChoiceType2.gridAfter     ); }
3155
        public int SizeOfGridBeforeArray    () { return SizeOfArray(ItemsChoiceType2.gridBefore    ); }
3156
        public int SizeOfHiddenArray        () { return SizeOfArray(ItemsChoiceType2.hidden        ); }
3157
        public int SizeOfJcArray            () { return SizeOfArray(ItemsChoiceType2.jc            ); }
3158
        public int SizeOfTblCellSpacingArray() { return SizeOfArray(ItemsChoiceType2.tblCellSpacing); }
3159
        public int SizeOfTblHeaderArray     () { return SizeOfArray(ItemsChoiceType2.tblHeader     ); }
3160
        public int SizeOfTrHeightArray      () { return SizeOfArray(ItemsChoiceType2.trHeight      ); }
3161
        public int SizeOfWAfterArray        () { return SizeOfArray(ItemsChoiceType2.wAfter        ); }
3162
        public int SizeOfWBeforeArray       () { return SizeOfArray(ItemsChoiceType2.wBefore       ); }
3163

3164
        public CT_OnOff         GetCantSplitArray     (int p) { return GetObjectArray<CT_OnOff        >(p, ItemsChoiceType2.cantSplit     ); }
3165
        public CT_Cnf           GetCnfStyleArray      (int p) { return GetObjectArray<CT_Cnf          >(p, ItemsChoiceType2.cnfStyle      ); }
3166
        public CT_DecimalNumber GetDivIdArray         (int p) { return GetObjectArray<CT_DecimalNumber>(p, ItemsChoiceType2.divId         ); }
3167
        public CT_DecimalNumber GetGridAfterArray     (int p) { return GetObjectArray<CT_DecimalNumber>(p, ItemsChoiceType2.gridAfter     ); }
3168
        public CT_DecimalNumber GetGridBeforeArray    (int p) { return GetObjectArray<CT_DecimalNumber>(p, ItemsChoiceType2.gridBefore    ); }
3169
        public CT_OnOff         GetHiddenArray        (int p) { return GetObjectArray<CT_OnOff        >(p, ItemsChoiceType2.hidden        ); }
3170
        public CT_Jc            GetJcArray            (int p) { return GetObjectArray<CT_Jc           >(p, ItemsChoiceType2.jc            ); }
3171
        public CT_TblWidth      GetTblCellSpacingArray(int p) { return GetObjectArray<CT_TblWidth     >(p, ItemsChoiceType2.tblCellSpacing); }
3172
        public CT_OnOff         GetTblHeaderArray     (int p) { return GetObjectArray<CT_OnOff        >(p, ItemsChoiceType2.tblHeader     ); }
3173
        public CT_Height        GetTrHeightArray      (int p) { return GetObjectArray<CT_Height       >(p, ItemsChoiceType2.trHeight      ); }
3174
        public CT_TblWidth      GetWAfterArray        (int p) { return GetObjectArray<CT_TblWidth     >(p, ItemsChoiceType2.wAfter        ); }
3175
        public CT_TblWidth      GetWBeforeArray       (int p) { return GetObjectArray<CT_TblWidth     >(p, ItemsChoiceType2.wBefore       ); }
3176

3177
        public CT_OnOff         InsertNewNewCantSplit     (int p) { return InsertNewObject<CT_OnOff        >(ItemsChoiceType2.cantSplit     , p); }
3178
        public CT_Cnf           InsertNewNewCnfStyle      (int p) { return InsertNewObject<CT_Cnf          >(ItemsChoiceType2.cnfStyle      , p); }
3179
        public CT_DecimalNumber InsertNewNewDivId         (int p) { return InsertNewObject<CT_DecimalNumber>(ItemsChoiceType2.divId         , p); }
3180
        public CT_DecimalNumber InsertNewNewGridAfter     (int p) { return InsertNewObject<CT_DecimalNumber>(ItemsChoiceType2.gridAfter     , p); }
3181
        public CT_DecimalNumber InsertNewNewGridBefore    (int p) { return InsertNewObject<CT_DecimalNumber>(ItemsChoiceType2.gridBefore    , p); }
3182
        public CT_OnOff         InsertNewNewHidden        (int p) { return InsertNewObject<CT_OnOff        >(ItemsChoiceType2.hidden        , p); }
3183
        public CT_Jc            InsertNewNewJc            (int p) { return InsertNewObject<CT_Jc           >(ItemsChoiceType2.jc            , p); }
3184
        public CT_TblWidth      InsertNewNewTblCellSpacing(int p) { return InsertNewObject<CT_TblWidth     >(ItemsChoiceType2.tblCellSpacing, p); }
3185
        public CT_OnOff         InsertNewNewTblHeader     (int p) { return InsertNewObject<CT_OnOff        >(ItemsChoiceType2.tblHeader     , p); }
3186
        public CT_Height        InsertNewNewTrHeight      (int p) { return InsertNewObject<CT_Height       >(ItemsChoiceType2.trHeight      , p); }
3187
        public CT_TblWidth      InsertNewNewWAfter        (int p) { return InsertNewObject<CT_TblWidth     >(ItemsChoiceType2.wAfter        , p); }
3188
        public CT_TblWidth      InsertNewNewWBefore       (int p) { return InsertNewObject<CT_TblWidth     >(ItemsChoiceType2.wBefore       , p); }
3189

3190
        public CT_OnOff         AddNewCantSplit     () { return AddNewObject<CT_OnOff        >(ItemsChoiceType2.cantSplit     ); }
3191
        public CT_Cnf           AddNewCnfStyle      () { return AddNewObject<CT_Cnf          >(ItemsChoiceType2.cnfStyle      ); }
3192
        public CT_DecimalNumber AddNewDivId         () { return AddNewObject<CT_DecimalNumber>(ItemsChoiceType2.divId         ); }
3193
        public CT_DecimalNumber AddNewGridAfter     () { return AddNewObject<CT_DecimalNumber>(ItemsChoiceType2.gridAfter     ); }
3194
        public CT_DecimalNumber AddNewGridBefore    () { return AddNewObject<CT_DecimalNumber>(ItemsChoiceType2.gridBefore    ); }
3195
        public CT_OnOff         AddNewHidden        () { return AddNewObject<CT_OnOff        >(ItemsChoiceType2.hidden        ); }
3196
        public CT_Jc            AddNewJc            () { return AddNewObject<CT_Jc           >(ItemsChoiceType2.jc            ); }
3197
        public CT_TblWidth      AddNewTblCellSpacing() { return AddNewObject<CT_TblWidth     >(ItemsChoiceType2.tblCellSpacing); }
3198
        public CT_OnOff         AddNewTblHeader     () { return AddNewObject<CT_OnOff        >(ItemsChoiceType2.tblHeader     ); }
3199
        public CT_Height        AddNewTrHeight      () { return AddNewObject<CT_Height       >(ItemsChoiceType2.trHeight      ); }
3200
        public CT_TblWidth      AddNewWAfter        () { return AddNewObject<CT_TblWidth     >(ItemsChoiceType2.wAfter        ); }
3201
        public CT_TblWidth      AddNewWBefore       () { return AddNewObject<CT_TblWidth     >(ItemsChoiceType2.wBefore       ); }
3202

3203
        public void SetCantSplit     (int p, CT_OnOff         obj) { SetObject(ItemsChoiceType2.cantSplit     , p, obj); }
3204
        public void SetCnfStyle      (int p, CT_Cnf           obj) { SetObject(ItemsChoiceType2.cnfStyle      , p, obj); }
3205
        public void SetDivId         (int p, CT_DecimalNumber obj) { SetObject(ItemsChoiceType2.divId         , p, obj); }
3206
        public void SetGridAfter     (int p, CT_DecimalNumber obj) { SetObject(ItemsChoiceType2.gridAfter     , p, obj); }
3207
        public void SetGridBefore    (int p, CT_DecimalNumber obj) { SetObject(ItemsChoiceType2.gridBefore    , p, obj); }
3208
        public void SetHidden        (int p, CT_OnOff         obj) { SetObject(ItemsChoiceType2.hidden        , p, obj); }
3209
        public void SetJc            (int p, CT_Jc            obj) { SetObject(ItemsChoiceType2.jc            , p, obj); }
3210
        public void SetTblCellSpacing(int p, CT_TblWidth      obj) { SetObject(ItemsChoiceType2.tblCellSpacing, p, obj); }
3211
        public void SetTblHeader     (int p, CT_OnOff         obj) { SetObject(ItemsChoiceType2.tblHeader     , p, obj); }
3212
        public void SetTrHeight      (int p, CT_Height        obj) { SetObject(ItemsChoiceType2.trHeight      , p, obj); }
3213
        public void SetWAfter        (int p, CT_TblWidth      obj) { SetObject(ItemsChoiceType2.wAfter        , p, obj); }
3214
        public void SetWBefore       (int p, CT_TblWidth      obj) { SetObject(ItemsChoiceType2.wBefore       , p, obj); }
3215

3216
        public void RemoveCantSplit     (int p) { RemoveObject(ItemsChoiceType2.cantSplit     , p); }
3217
        public void RemoveCnfStyle      (int p) { RemoveObject(ItemsChoiceType2.cnfStyle      , p); }
3218
        public void RemoveDivId         (int p) { RemoveObject(ItemsChoiceType2.divId         , p); }
3219
        public void RemoveGridAfter     (int p) { RemoveObject(ItemsChoiceType2.gridAfter     , p); }
3220
        public void RemoveGridBefore    (int p) { RemoveObject(ItemsChoiceType2.gridBefore    , p); }
3221
        public void RemoveHidden        (int p) { RemoveObject(ItemsChoiceType2.hidden        , p); }
3222
        public void RemoveJc            (int p) { RemoveObject(ItemsChoiceType2.jc            , p); }
3223
        public void RemoveTblCellSpacing(int p) { RemoveObject(ItemsChoiceType2.tblCellSpacing, p); }
3224
        public void RemoveTblHeader     (int p) { RemoveObject(ItemsChoiceType2.tblHeader     , p); }
3225
        public void RemoveTrHeight      (int p) { RemoveObject(ItemsChoiceType2.trHeight      , p); }
3226
        public void RemoveWAfter        (int p) { RemoveObject(ItemsChoiceType2.wAfter        , p); }
3227
        public void RemoveWBefore       (int p) { RemoveObject(ItemsChoiceType2.wBefore       , p); }
3228

3229
        #region Generic methods for object operation
3230
        private List<T> GetObjectList<T>(ItemsChoiceType2 type) where T : class
3231
        {
3232
            lock (this)
3233
            {
3234
                List<T> list = new List<T>();
3235
                for (int i = 0; i < itemsElementNameField.Count; i++)
3236
                {
3237
                    if (itemsElementNameField[i] == type)
3238
                        list.Add(itemsField[i] as T);
3239
                }
3240
                return list;
3241
            }
3242
        }
3243
        private int SizeOfArray(ItemsChoiceType2 type)
3244
        {
3245
            lock (this)
3246
            {
3247
                int size = 0;
3248
                for (int i = 0; i < itemsElementNameField.Count; i++)
3249
                {
3250
                    if (itemsElementNameField[i] == type)
3251
                        size++;
3252
                }
3253
                return size;
3254
            }
3255
        }
3256
        private T GetObjectArray<T>(int p, ItemsChoiceType2 type) where T : class
3257
        {
3258
            lock (this)
3259
            {
3260
                int pos = GetObjectIndex(type, p);
3261
                if (pos < 0 || pos >= this.itemsField.Count)
3262
                    return null;
3263
                return itemsField[pos] as T;
3264
            }
3265
        }
3266
        private T InsertNewObject<T>(ItemsChoiceType2 type, int p) where T : class, new()
3267
        {
3268
            T t = new T();
3269
            lock (this)
3270
            {
3271
                int pos = GetObjectIndex(type, p);
3272
                this.itemsElementNameField.Insert(pos, type);
3273
                this.itemsField.Insert(pos, t);
3274
            }
3275
            return t;
3276
        }
3277
        private T AddNewObject<T>(ItemsChoiceType2 type) where T : class, new()
3278
        {
3279
            T t = new T();
3280
            lock (this)
3281
            {
3282
                this.itemsElementNameField.Add(type);
3283
                this.itemsField.Add(t);
3284
            }
3285
            return t;
3286
        }
3287
        private void SetObject<T>(ItemsChoiceType2 type, int p, T obj) where T : class
3288
        {
3289
            lock (this)
3290
            {
3291
                int pos = GetObjectIndex(type, p);
3292
                if (pos < 0 || pos >= this.itemsField.Count)
3293
                    return;
3294
                if (this.itemsField[pos] is T)
3295
                    this.itemsField[pos] = obj;
3296
                else
3297
                    throw new Exception(string.Format(@"object types are difference, itemsField[{0}] is {1}, and parameter obj is {2}",
3298
                        pos, this.itemsField[pos].GetType().Name, typeof(T).Name));
3299
            }
3300
        }
3301
        private int GetObjectIndex(ItemsChoiceType2 type, int p)
3302
        {
3303
            int index = -1;
3304
            int pos = 0;
3305
            for (int i = 0; i < itemsElementNameField.Count; i++)
3306
            {
3307
                if (itemsElementNameField[i] == type)
3308
                {
3309
                    if (pos == p)
3310
                    {
3311
                        index = i;
3312
                        break;
3313
                    }
3314
                    else
3315
                        pos++;
3316
                }
3317
            }
3318
            return index;
3319
        }
3320
        private void RemoveObject(ItemsChoiceType2 type, int p)
3321
        {
3322
            lock (this)
3323
            {
3324
                int pos = GetObjectIndex(type, p);
3325
                if (pos < 0 || pos >= this.itemsField.Count)
3326
                    return;
3327
                itemsElementNameField.RemoveAt(pos);
3328
                itemsField.RemoveAt(pos);
3329
            }
3330
        }
3331
        #endregion
3332
    }
3333

3334

3335
    #region Table Cell
3336
    [Serializable]
3337

3338
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
3339
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
3340
    public class CT_Tc
3341
    {
3342

3343
        private CT_TcPr tcPrField;
3344

3345
        private ArrayList itemsField;
3346

3347
        private List<ItemsChoiceTableCellType> itemsElementNameField;
3348

3349
        public CT_Tc()
3350
        {
3351
            this.itemsElementNameField = new List<ItemsChoiceTableCellType>();
3352
            this.itemsField = new ArrayList();
3353
            //this.tcPrField = new CT_TcPr();
3354
        }
3355

3356
        [XmlElement(Order = 0)]
3357
        public CT_TcPr tcPr
3358
        {
3359
            get
3360
            {
3361
                return this.tcPrField;
3362
            }
3363
            set
3364
            {
3365
                this.tcPrField = value;
3366
            }
3367
        }
3368
        public static CT_Tc Parse(XmlNode node, XmlNamespaceManager namespaceManager, object parent)
3369
        {
3370
            if (node == null)
3371
                return null;
3372
                
3373
            CT_Tc ctObj = new CT_Tc();
3374
            if (parent != null)
3375
            {
3376
                ctObj.parent = parent;
3377
            }
3378
            foreach (XmlNode childNode in node.ChildNodes)
3379
            {
3380
                if (childNode.LocalName == "commentRangeEnd")
3381
                {
3382
                    ctObj.Items.Add(CT_MarkupRange.Parse(childNode, namespaceManager));
3383
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.commentRangeEnd);
3384
                }
3385
                else if (childNode.LocalName == "tcPr")
3386
                {
3387
                    ctObj.tcPr = CT_TcPr.Parse(childNode, namespaceManager);
3388
                }
3389
                else if (childNode.LocalName == "oMath")
3390
                {
3391
                    ctObj.Items.Add(CT_OMath.Parse(childNode, namespaceManager));
3392
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.oMath);
3393
                }
3394
                else if (childNode.LocalName == "oMathPara")
3395
                {
3396
                    ctObj.Items.Add(CT_OMathPara.Parse(childNode, namespaceManager));
3397
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.oMathPara);
3398
                }
3399
                else if (childNode.LocalName == "altChunk")
3400
                {
3401
                    ctObj.Items.Add(CT_AltChunk.Parse(childNode, namespaceManager));
3402
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.altChunk);
3403
                }
3404
                else if (childNode.LocalName == "bookmarkEnd")
3405
                {
3406
                    ctObj.Items.Add(CT_MarkupRange.Parse(childNode, namespaceManager));
3407
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.bookmarkEnd);
3408
                }
3409
                else if (childNode.LocalName == "bookmarkStart")
3410
                {
3411
                    ctObj.Items.Add(CT_Bookmark.Parse(childNode, namespaceManager));
3412
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.bookmarkStart);
3413
                }
3414
                else if (childNode.LocalName == "moveFromRangeStart")
3415
                {
3416
                    ctObj.Items.Add(CT_MoveBookmark.Parse(childNode, namespaceManager));
3417
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.moveFromRangeStart);
3418
                }
3419
                else if (childNode.LocalName == "commentRangeStart")
3420
                {
3421
                    ctObj.Items.Add(CT_MarkupRange.Parse(childNode, namespaceManager));
3422
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.commentRangeStart);
3423
                }
3424
                else if (childNode.LocalName == "customXml")
3425
                {
3426
                    ctObj.Items.Add(CT_CustomXmlBlock.Parse(childNode, namespaceManager));
3427
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.customXml);
3428
                }
3429
                else if (childNode.LocalName == "customXmlDelRangeEnd")
3430
                {
3431
                    ctObj.Items.Add(CT_Markup.Parse(childNode, namespaceManager));
3432
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.customXmlDelRangeEnd);
3433
                }
3434
                else if (childNode.LocalName == "customXmlDelRangeStart")
3435
                {
3436
                    ctObj.Items.Add(CT_TrackChange.Parse(childNode, namespaceManager));
3437
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.customXmlDelRangeStart);
3438
                }
3439
                else if (childNode.LocalName == "customXmlInsRangeEnd")
3440
                {
3441
                    ctObj.Items.Add(CT_Markup.Parse(childNode, namespaceManager));
3442
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.customXmlInsRangeEnd);
3443
                }
3444
                else if (childNode.LocalName == "customXmlInsRangeStart")
3445
                {
3446
                    ctObj.Items.Add(CT_TrackChange.Parse(childNode, namespaceManager));
3447
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.customXmlInsRangeStart);
3448
                }
3449
                else if (childNode.LocalName == "customXmlMoveFromRangeEnd")
3450
                {
3451
                    ctObj.Items.Add(CT_Markup.Parse(childNode, namespaceManager));
3452
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.customXmlMoveFromRangeEnd);
3453
                }
3454
                else if (childNode.LocalName == "customXmlMoveFromRangeStart")
3455
                {
3456
                    ctObj.Items.Add(CT_TrackChange.Parse(childNode, namespaceManager));
3457
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.customXmlMoveFromRangeStart);
3458
                }
3459
                else if (childNode.LocalName == "customXmlMoveToRangeEnd")
3460
                {
3461
                    ctObj.Items.Add(CT_Markup.Parse(childNode, namespaceManager));
3462
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.customXmlMoveToRangeEnd);
3463
                }
3464
                else if (childNode.LocalName == "customXmlMoveToRangeStart")
3465
                {
3466
                    ctObj.Items.Add(CT_TrackChange.Parse(childNode, namespaceManager));
3467
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.customXmlMoveToRangeStart);
3468
                }
3469
                else if (childNode.LocalName == "del")
3470
                {
3471
                    ctObj.Items.Add(CT_RunTrackChange.Parse(childNode, namespaceManager));
3472
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.del);
3473
                }
3474
                else if (childNode.LocalName == "ins")
3475
                {
3476
                    ctObj.Items.Add(CT_RunTrackChange.Parse(childNode, namespaceManager));
3477
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.ins);
3478
                }
3479
                else if (childNode.LocalName == "moveFrom")
3480
                {
3481
                    ctObj.Items.Add(CT_RunTrackChange.Parse(childNode, namespaceManager));
3482
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.moveFrom);
3483
                }
3484
                else if (childNode.LocalName == "moveFromRangeEnd")
3485
                {
3486
                    ctObj.Items.Add(CT_MarkupRange.Parse(childNode, namespaceManager));
3487
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.moveFromRangeEnd);
3488
                }
3489
                else if (childNode.LocalName == "sdt")
3490
                {
3491
                    ctObj.Items.Add(CT_SdtBlock.Parse(childNode, namespaceManager));
3492
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.sdt);
3493
                }
3494
                else if (childNode.LocalName == "moveTo")
3495
                {
3496
                    ctObj.Items.Add(CT_RunTrackChange.Parse(childNode, namespaceManager));
3497
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.moveTo);
3498
                }
3499
                else if (childNode.LocalName == "moveToRangeEnd")
3500
                {
3501
                    ctObj.Items.Add(CT_MarkupRange.Parse(childNode, namespaceManager));
3502
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.moveToRangeEnd);
3503
                }
3504
                else if (childNode.LocalName == "moveToRangeStart")
3505
                {
3506
                    ctObj.Items.Add(CT_MoveBookmark.Parse(childNode, namespaceManager));
3507
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.moveToRangeStart);
3508
                }
3509
                else if (childNode.LocalName == "p")
3510
                {
3511
                    ctObj.Items.Add(CT_P.Parse(childNode, namespaceManager));
3512
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.p);
3513
                }
3514
                else if (childNode.LocalName == "permEnd")
3515
                {
3516
                    ctObj.Items.Add(CT_Perm.Parse(childNode, namespaceManager));
3517
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.permEnd);
3518
                }
3519
                else if (childNode.LocalName == "proofErr")
3520
                {
3521
                    ctObj.Items.Add(CT_ProofErr.Parse(childNode, namespaceManager));
3522
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.proofErr);
3523
                }
3524
                else if (childNode.LocalName == "permStart")
3525
                {
3526
                    ctObj.Items.Add(CT_PermStart.Parse(childNode, namespaceManager));
3527
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.permStart);
3528
                }
3529
                else if (childNode.LocalName == "tbl")
3530
                {
3531
                    ctObj.Items.Add(CT_Tbl.Parse(childNode, namespaceManager));
3532
                    ctObj.ItemsElementName.Add(ItemsChoiceTableCellType.tbl);
3533
                }
3534
            }
3535
            return ctObj;
3536
        }
3537

3538
        internal void Write(StreamWriter sw, string nodeName)
3539
        {
3540
            sw.Write(string.Format("<w:{0}", nodeName));
3541
            sw.Write(">");
3542
            if(this.tcPr!=null)
3543
                    this.tcPr.Write(sw, "tcPr");
3544
            foreach (object o in this.Items)
3545
            {
3546
                if (o is CT_MarkupRange)
3547
                    ((CT_MarkupRange)o).Write(sw, "commentRangeEnd");
3548
                else if (o is CT_OMath)
3549
                    ((CT_OMath)o).Write(sw, "oMath");
3550
                else if (o is CT_OMathPara)
3551
                    ((CT_OMathPara)o).Write(sw, "oMathPara");
3552
                else if (o is CT_AltChunk)
3553
                    ((CT_AltChunk)o).Write(sw, "altChunk");
3554
                else if (o is CT_MarkupRange)
3555
                    ((CT_MarkupRange)o).Write(sw, "bookmarkEnd");
3556
                else if (o is CT_Bookmark)
3557
                    ((CT_Bookmark)o).Write(sw, "bookmarkStart");
3558
                else if (o is CT_MoveBookmark)
3559
                    ((CT_MoveBookmark)o).Write(sw, "moveFromRangeStart");
3560
                else if (o is CT_MarkupRange)
3561
                    ((CT_MarkupRange)o).Write(sw, "commentRangeStart");
3562
                else if (o is CT_CustomXmlBlock)
3563
                    ((CT_CustomXmlBlock)o).Write(sw, "customXml");
3564
                else if (o is CT_Markup)
3565
                    ((CT_Markup)o).Write(sw, "customXmlDelRangeEnd");
3566
                else if (o is CT_TrackChange)
3567
                    ((CT_TrackChange)o).Write(sw, "customXmlDelRangeStart");
3568
                else if (o is CT_Markup)
3569
                    ((CT_Markup)o).Write(sw, "customXmlInsRangeEnd");
3570
                else if (o is CT_TrackChange)
3571
                    ((CT_TrackChange)o).Write(sw, "customXmlInsRangeStart");
3572
                else if (o is CT_Markup)
3573
                    ((CT_Markup)o).Write(sw, "customXmlMoveFromRangeEnd");
3574
                else if (o is CT_TrackChange)
3575
                    ((CT_TrackChange)o).Write(sw, "customXmlMoveFromRangeStart");
3576
                else if (o is CT_Markup)
3577
                    ((CT_Markup)o).Write(sw, "customXmlMoveToRangeEnd");
3578
                else if (o is CT_TrackChange)
3579
                    ((CT_TrackChange)o).Write(sw, "customXmlMoveToRangeStart");
3580
                else if (o is CT_RunTrackChange)
3581
                    ((CT_RunTrackChange)o).Write(sw, "del");
3582
                else if (o is CT_RunTrackChange)
3583
                    ((CT_RunTrackChange)o).Write(sw, "ins");
3584
                else if (o is CT_RunTrackChange)
3585
                    ((CT_RunTrackChange)o).Write(sw, "moveFrom");
3586
                else if (o is CT_MarkupRange)
3587
                    ((CT_MarkupRange)o).Write(sw, "moveFromRangeEnd");
3588
                else if (o is CT_SdtBlock)
3589
                    ((CT_SdtBlock)o).Write(sw, "sdt");
3590
                else if (o is CT_RunTrackChange)
3591
                    ((CT_RunTrackChange)o).Write(sw, "moveTo");
3592
                else if (o is CT_MarkupRange)
3593
                    ((CT_MarkupRange)o).Write(sw, "moveToRangeEnd");
3594
                else if (o is CT_MoveBookmark)
3595
                    ((CT_MoveBookmark)o).Write(sw, "moveToRangeStart");
3596
                else if (o is CT_P)
3597
                    ((CT_P)o).Write(sw, "p");
3598
                else if (o is CT_Perm)
3599
                    ((CT_Perm)o).Write(sw, "permEnd");
3600
                else if (o is CT_ProofErr)
3601
                    ((CT_ProofErr)o).Write(sw, "proofErr");
3602
                else if (o is CT_PermStart)
3603
                    ((CT_PermStart)o).Write(sw, "permStart");
3604
                else if (o is CT_Tbl)
3605
                    ((CT_Tbl)o).Write(sw, "tbl");
3606
            }
3607
            sw.WriteEndW(nodeName);
3608
        }
3609

3610
        [XmlElement("oMath", typeof(CT_OMath), Namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", Order = 1)]
3611
        [XmlElement("oMathPara", typeof(CT_OMathPara), Namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", Order = 1)]
3612
        [XmlElement("altChunk", typeof(CT_AltChunk), Order = 1)]
3613
        [XmlElement("bookmarkEnd", typeof(CT_MarkupRange), Order = 1)]
3614
        [XmlElement("bookmarkStart", typeof(CT_Bookmark), Order = 1)]
3615
        [XmlElement("commentRangeEnd", typeof(CT_MarkupRange), Order = 1)]
3616
        [XmlElement("commentRangeStart", typeof(CT_MarkupRange), Order = 1)]
3617
        [XmlElement("customXml", typeof(CT_CustomXmlBlock), Order = 1)]
3618
        [XmlElement("customXmlDelRangeEnd", typeof(CT_Markup), Order = 1)]
3619
        [XmlElement("customXmlDelRangeStart", typeof(CT_TrackChange), Order = 1)]
3620
        [XmlElement("customXmlInsRangeEnd", typeof(CT_Markup), Order = 1)]
3621
        [XmlElement("customXmlInsRangeStart", typeof(CT_TrackChange), Order = 1)]
3622
        [XmlElement("customXmlMoveFromRangeEnd", typeof(CT_Markup), Order = 1)]
3623
        [XmlElement("customXmlMoveFromRangeStart", typeof(CT_TrackChange), Order = 1)]
3624
        [XmlElement("customXmlMoveToRangeEnd", typeof(CT_Markup), Order = 1)]
3625
        [XmlElement("customXmlMoveToRangeStart", typeof(CT_TrackChange), Order = 1)]
3626
        [XmlElement("del", typeof(CT_RunTrackChange), Order = 1)]
3627
        [XmlElement("ins", typeof(CT_RunTrackChange), Order = 1)]
3628
        [XmlElement("moveFrom", typeof(CT_RunTrackChange), Order = 1)]
3629
        [XmlElement("moveFromRangeEnd", typeof(CT_MarkupRange), Order = 1)]
3630
        [XmlElement("moveFromRangeStart", typeof(CT_MoveBookmark), Order = 1)]
3631
        [XmlElement("moveTo", typeof(CT_RunTrackChange), Order = 1)]
3632
        [XmlElement("moveToRangeEnd", typeof(CT_MarkupRange), Order = 1)]
3633
        [XmlElement("moveToRangeStart", typeof(CT_MoveBookmark), Order = 1)]
3634
        [XmlElement("p", typeof(CT_P), Order = 1)]
3635
        [XmlElement("permEnd", typeof(CT_Perm), Order = 1)]
3636
        [XmlElement("permStart", typeof(CT_PermStart), Order = 1)]
3637
        [XmlElement("proofErr", typeof(CT_ProofErr), Order = 1)]
3638
        [XmlElement("sdt", typeof(CT_SdtBlock), Order = 1)]
3639
        [XmlElement("tbl", typeof(CT_Tbl), Order = 1)]
3640
        [XmlChoiceIdentifier("ItemsElementName")]
3641
        public ArrayList Items
3642
        {
3643
            get
3644
            {
3645
                return this.itemsField;
3646
            }
3647
            set
3648
            {
3649
                    this.itemsField = value;
3650
            }
3651
        }
3652

3653
        [XmlElement("ItemsElementName", Order = 2)]
3654
        [XmlIgnore]
3655
        public List<ItemsChoiceTableCellType> ItemsElementName
3656
        {
3657
            get
3658
            {
3659
                return this.itemsElementNameField;
3660
            }
3661
            set
3662
            {
3663
                this.itemsElementNameField = value;
3664
            }
3665
        }
3666
        object parent;
3667
        [XmlIgnore]
3668
        public object Parent
3669
        {
3670
            get { return parent; }
3671
        }
3672
        #region Generic methods for object operation
3673
        private List<T> GetObjectList<T>(ItemsChoiceTableCellType type) where T : class
3674
        {
3675
            lock (this)
3676
            {
3677
                List<T> list = new List<T>();
3678
                for (int i = 0; i < itemsElementNameField.Count; i++)
3679
                {
3680
                    if (itemsElementNameField[i] == type)
3681
                        list.Add(itemsField[i] as T);
3682
                }
3683
                return list;
3684
            }
3685
        }
3686
        private int SizeOfArray(ItemsChoiceTableCellType type)
3687
        {
3688
            lock (this)
3689
            {
3690
                int size = 0;
3691
                for (int i = 0; i < itemsElementNameField.Count; i++)
3692
                {
3693
                    if (itemsElementNameField[i] == type)
3694
                        size++;
3695
                }
3696
                return size;
3697
            }
3698
        }
3699
        private T GetObjectArray<T>(int p, ItemsChoiceTableCellType type) where T : class
3700
        {
3701
            lock (this)
3702
            {
3703
                int pos = GetObjectIndex(type, p);
3704
                if (pos < 0 || pos >= this.itemsField.Count)
3705
                    return null;
3706
                return itemsField[pos] as T;
3707
            }
3708
        }
3709
        private int GetObjectIndex(ItemsChoiceTableCellType type, int p)
3710
        {
3711
            int index = -1;
3712
            int pos = 0;
3713
            for (int i = 0; i < itemsElementNameField.Count; i++)
3714
            {
3715
                if (itemsElementNameField[i] == type)
3716
                {
3717
                    if (pos == p)
3718
                    {
3719
                        index = i;
3720
                        break;
3721
                    }
3722
                    else
3723
                        pos++;
3724
                }
3725
            }
3726
            return index;
3727
        }
3728
        private void RemoveObject(ItemsChoiceTableCellType type, int p)
3729
        {
3730
            lock (this)
3731
            {
3732
                int pos = GetObjectIndex(type, p);
3733
                if (pos < 0 || pos >= this.itemsField.Count)
3734
                    return;
3735
                itemsElementNameField.RemoveAt(pos);
3736
                itemsField.RemoveAt(pos);
3737
            }
3738
        }
3739
        private void SetObject<T>(ItemsChoiceTableCellType type, int p, T obj) where T : class
3740
        {
3741
            lock (this)
3742
            {
3743
                int pos = GetObjectIndex(type, p);
3744
                if (pos < 0 || pos >= this.itemsField.Count)
3745
                    return;
3746
                if (this.itemsField[pos] is T)
3747
                    this.itemsField[pos] = obj;
3748
                else
3749
                    throw new Exception(string.Format(@"object types are difference, itemsField[{0}] is {1}, and parameter obj is {2}",
3750
                        pos, this.itemsField[pos].GetType().Name, typeof(T).Name));
3751
            }
3752
        }
3753

3754
        private T AddNewObject<T>(ItemsChoiceTableCellType type) where T : class, new()
3755
        {
3756
            T t = new T();
3757
            lock (this)
3758
            {
3759
                this.itemsElementNameField.Add(type);
3760
                this.itemsField.Add(t);
3761
            }
3762
            return t;
3763
        }
3764
        #endregion
3765
        public CT_P AddNewP()
3766
        {
3767
            return AddNewObject<CT_P>(ItemsChoiceTableCellType.p);
3768
        }
3769

3770
        public IList<CT_P> GetPList()
3771
        {
3772
            return GetObjectList<CT_P>(ItemsChoiceTableCellType.p);
3773
        }
3774

3775
        public int SizeOfPArray()
3776
        {
3777
            return SizeOfArray(ItemsChoiceTableCellType.p);
3778
        }
3779

3780
        public void SetPArray(int p, CT_P cT_P)
3781
        {
3782
            SetObject<CT_P>(ItemsChoiceTableCellType.p, p, cT_P);
3783
        }
3784

3785
        public void RemoveP(int pos)
3786
        {
3787
            RemoveObject(ItemsChoiceTableCellType.p, pos);
3788
        }
3789

3790
        public CT_P GetPArray(int p)
3791
        {
3792
            return GetObjectArray<CT_P>(p, ItemsChoiceTableCellType.p);
3793
        }
3794

3795
        public IList<CT_Tbl> GetTblList()
3796
        {
3797
            return GetObjectList<CT_Tbl>(ItemsChoiceTableCellType.tbl);
3798
        }
3799

3800
        public CT_Tbl GetTblArray(int p)
3801
        {
3802
            return GetObjectArray<CT_Tbl>(p, ItemsChoiceTableCellType.tbl);
3803
        }
3804

3805
        public CT_TcPr AddNewTcPr()
3806
        {
3807
            this.tcPrField = new CT_TcPr();
3808
            return this.tcPrField;
3809
        }
3810

3811
        public bool IsSetTcPr()
3812
        {
3813
            return (this.tcPrField != null);
3814

3815
        }
3816

3817
        public CT_Tbl AddNewTbl()
3818
        {
3819
            return AddNewObject<CT_Tbl>(ItemsChoiceTableCellType.tbl);
3820
        }
3821
    }
3822

3823

3824
    [Serializable]
3825
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IncludeInSchema = false)]
3826
    public enum ItemsChoiceTableCellType
3827
    {
3828

3829
    
3830
        [XmlEnum("http://schemas.openxmlformats.org/officeDocument/2006/math:oMath")]
3831
        oMath,
3832

3833
    
3834
        [XmlEnum("http://schemas.openxmlformats.org/officeDocument/2006/math:oMathPara")]
3835
        oMathPara,
3836

3837
    
3838
        altChunk,
3839

3840
    
3841
        bookmarkEnd,
3842

3843
    
3844
        bookmarkStart,
3845

3846
    
3847
        commentRangeEnd,
3848

3849
    
3850
        commentRangeStart,
3851

3852
    
3853
        customXml,
3854

3855
    
3856
        customXmlDelRangeEnd,
3857

3858
    
3859
        customXmlDelRangeStart,
3860

3861
    
3862
        customXmlInsRangeEnd,
3863

3864
    
3865
        customXmlInsRangeStart,
3866

3867
    
3868
        customXmlMoveFromRangeEnd,
3869

3870
    
3871
        customXmlMoveFromRangeStart,
3872

3873
    
3874
        customXmlMoveToRangeEnd,
3875

3876
    
3877
        customXmlMoveToRangeStart,
3878

3879
    
3880
        del,
3881

3882
    
3883
        ins,
3884

3885
    
3886
        moveFrom,
3887

3888
    
3889
        moveFromRangeEnd,
3890

3891
    
3892
        moveFromRangeStart,
3893

3894
    
3895
        moveTo,
3896

3897
    
3898
        moveToRangeEnd,
3899

3900
    
3901
        moveToRangeStart,
3902

3903
    
3904
        p,
3905

3906
    
3907
        permEnd,
3908

3909
    
3910
        permStart,
3911

3912
    
3913
        proofErr,
3914

3915
    
3916
        sdt,
3917

3918
    
3919
        tbl,
3920
    }
3921

3922

3923
    [Serializable]
3924

3925
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
3926
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
3927
    public class CT_TrPr : CT_TrPrBase
3928
    {
3929

3930
        private CT_TrackChange insField;
3931

3932
        private CT_TrackChange delField;
3933

3934
        private CT_TrPrChange trPrChangeField;
3935

3936
        public CT_TrPr()
3937
        {
3938

3939
        }
3940
        public static new CT_TrPr Parse(XmlNode node, XmlNamespaceManager namespaceManager)
3941
        {
3942
            if (node == null)
3943
                return null;
3944
            CT_TrPr ctObj = new CT_TrPr();
3945
            foreach (XmlNode childNode in node.ChildNodes)
3946
            {
3947
                if (childNode.LocalName == "ins")
3948
                    ctObj.ins = CT_TrackChange.Parse(childNode, namespaceManager);
3949
                else if (childNode.LocalName == "del")
3950
                    ctObj.del = CT_TrackChange.Parse(childNode, namespaceManager);
3951
                else if (childNode.LocalName == "trPrChange")
3952
                    ctObj.trPrChange = CT_TrPrChange.Parse(childNode, namespaceManager);
3953
                else if (childNode.LocalName == "gridBefore")
3954
                {
3955
                    ctObj.Items.Add(CT_DecimalNumber.Parse(childNode, namespaceManager));
3956
                    ctObj.ItemsElementName.Add(ItemsChoiceType2.gridBefore);
3957
                }
3958
                else if (childNode.LocalName == "cantSplit")
3959
                {
3960
                    ctObj.Items.Add(CT_OnOff.Parse(childNode, namespaceManager));
3961
                    ctObj.ItemsElementName.Add(ItemsChoiceType2.cantSplit);
3962
                }
3963
                else if (childNode.LocalName == "cnfStyle")
3964
                {
3965
                    ctObj.Items.Add(CT_Cnf.Parse(childNode, namespaceManager));
3966
                    ctObj.ItemsElementName.Add(ItemsChoiceType2.cnfStyle);
3967
                }
3968
                else if (childNode.LocalName == "divId")
3969
                {
3970
                    ctObj.Items.Add(CT_DecimalNumber.Parse(childNode, namespaceManager));
3971
                    ctObj.ItemsElementName.Add(ItemsChoiceType2.divId);
3972
                }
3973
                else if (childNode.LocalName == "gridAfter")
3974
                {
3975
                    ctObj.Items.Add(CT_DecimalNumber.Parse(childNode, namespaceManager));
3976
                    ctObj.ItemsElementName.Add(ItemsChoiceType2.gridAfter);
3977
                }
3978
                else if (childNode.LocalName == "trHeight")
3979
                {
3980
                    ctObj.Items.Add(CT_Height.Parse(childNode, namespaceManager));
3981
                    ctObj.ItemsElementName.Add(ItemsChoiceType2.trHeight);
3982
                }
3983
                else if (childNode.LocalName == "hidden")
3984
                {
3985
                    ctObj.Items.Add(CT_OnOff.Parse(childNode, namespaceManager));
3986
                    ctObj.ItemsElementName.Add(ItemsChoiceType2.hidden);
3987
                }
3988
                else if (childNode.LocalName == "tblCellSpacing")
3989
                {
3990
                    ctObj.Items.Add(CT_TblWidth.Parse(childNode, namespaceManager));
3991
                    ctObj.ItemsElementName.Add(ItemsChoiceType2.tblCellSpacing);
3992
                }
3993
                else if (childNode.LocalName == "tblHeader")
3994
                {
3995
                    ctObj.Items.Add(CT_OnOff.Parse(childNode, namespaceManager));
3996
                    ctObj.ItemsElementName.Add(ItemsChoiceType2.tblHeader);
3997
                }
3998
                else if (childNode.LocalName == "jc")
3999
                {
4000
                    ctObj.Items.Add(CT_Jc.Parse(childNode, namespaceManager));
4001
                    ctObj.ItemsElementName.Add(ItemsChoiceType2.jc);
4002
                }
4003
                else if (childNode.LocalName == "wAfter")
4004
                {
4005
                    ctObj.Items.Add(CT_TblWidth.Parse(childNode, namespaceManager));
4006
                    ctObj.ItemsElementName.Add(ItemsChoiceType2.wAfter);
4007
                }
4008
                else if (childNode.LocalName == "wBefore")
4009
                {
4010
                    ctObj.Items.Add(CT_TblWidth.Parse(childNode, namespaceManager));
4011
                    ctObj.ItemsElementName.Add(ItemsChoiceType2.wBefore);
4012
                }
4013
            }
4014
            return ctObj;
4015
        }
4016

4017

4018

4019
        internal new void Write(StreamWriter sw, string nodeName)
4020
        {
4021
            sw.Write(string.Format("<w:{0}", nodeName));
4022
            sw.Write(">");
4023
            if (this.ins != null)
4024
                this.ins.Write(sw, "ins");
4025
            if (this.del != null)
4026
                this.del.Write(sw, "del");
4027
            if (this.trPrChange != null)
4028
                this.trPrChange.Write(sw, "trPrChange");
4029
            for (int i=0;i<this.Items.Count;i++)
4030
            {
4031
                object o = this.Items[i];
4032
                if (o is CT_DecimalNumber 
4033
                    &&this.ItemsElementName[i]== ItemsChoiceType2.gridBefore)
4034
                    ((CT_DecimalNumber)o).Write(sw, "gridBefore");
4035
                else if (o is CT_OnOff
4036
                    && this.ItemsElementName[i] == ItemsChoiceType2.cantSplit)
4037
                    ((CT_OnOff)o).Write(sw, "cantSplit");
4038
                else if (o is CT_Cnf
4039
                    && this.ItemsElementName[i] == ItemsChoiceType2.cnfStyle)
4040
                    ((CT_Cnf)o).Write(sw, "cnfStyle");
4041
                else if (o is CT_DecimalNumber
4042
                    && this.ItemsElementName[i] == ItemsChoiceType2.divId)
4043
                    ((CT_DecimalNumber)o).Write(sw, "divId");
4044
                else if (o is CT_DecimalNumber
4045
                    && this.ItemsElementName[i] == ItemsChoiceType2.gridAfter)
4046
                    ((CT_DecimalNumber)o).Write(sw, "gridAfter");
4047
                else if (o is CT_Height
4048
                    && this.ItemsElementName[i] == ItemsChoiceType2.trHeight)
4049
                    ((CT_Height)o).Write(sw, "trHeight");
4050
                else if (o is CT_OnOff
4051
                    && this.ItemsElementName[i] == ItemsChoiceType2.hidden)
4052
                    ((CT_OnOff)o).Write(sw, "hidden");
4053
                else if (o is CT_TblWidth
4054
                    && this.ItemsElementName[i] == ItemsChoiceType2.tblCellSpacing)
4055
                    ((CT_TblWidth)o).Write(sw, "tblCellSpacing");
4056
                else if (o is CT_OnOff
4057
                    && this.ItemsElementName[i] == ItemsChoiceType2.tblHeader)
4058
                    ((CT_OnOff)o).Write(sw, "tblHeader");
4059
                else if (o is CT_Jc
4060
                    && this.ItemsElementName[i] == ItemsChoiceType2.jc)
4061
                    ((CT_Jc)o).Write(sw, "jc");
4062
                else if (o is CT_TblWidth
4063
                    && this.ItemsElementName[i] == ItemsChoiceType2.wAfter)
4064
                    ((CT_TblWidth)o).Write(sw, "wAfter");
4065
                else if (o is CT_TblWidth
4066
                    && this.ItemsElementName[i] == ItemsChoiceType2.wBefore)
4067
                    ((CT_TblWidth)o).Write(sw, "wBefore");
4068
            }
4069
            sw.WriteEndW(nodeName);
4070
        }
4071

4072
        [XmlElement(Order = 0)]
4073
        public CT_TrackChange ins
4074
        {
4075
            get
4076
            {
4077
                return this.insField;
4078
            }
4079
            set
4080
            {
4081
                this.insField = value;
4082
            }
4083
        }
4084

4085
        [XmlElement(Order = 1)]
4086
        public CT_TrackChange del
4087
        {
4088
            get
4089
            {
4090
                return this.delField;
4091
            }
4092
            set
4093
            {
4094
                this.delField = value;
4095
            }
4096
        }
4097

4098
        [XmlElement(Order = 2)]
4099
        public CT_TrPrChange trPrChange
4100
        {
4101
            get
4102
            {
4103
                return this.trPrChangeField;
4104
            }
4105
            set
4106
            {
4107
                this.trPrChangeField = value;
4108
            }
4109
        }
4110

4111
    }
4112

4113
    [Serializable]
4114

4115
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
4116
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
4117
    public class CT_TcPrChange : CT_TrackChange
4118
    {
4119
        public static new CT_TcPrChange Parse(XmlNode node, XmlNamespaceManager namespaceManager)
4120
        {
4121
            if (node == null)
4122
                return null;
4123
            CT_TcPrChange ctObj = new CT_TcPrChange();
4124
            ctObj.author = XmlHelper.ReadString(node.Attributes["w:author"]);
4125
            ctObj.date = XmlHelper.ReadString(node.Attributes["w:date"]);
4126
            ctObj.id = XmlHelper.ReadString(node.Attributes["r:id"]);
4127
            foreach (XmlNode childNode in node.ChildNodes)
4128
            {
4129
                if (childNode.LocalName == "tcPr")
4130
                    ctObj.tcPr = CT_TcPrInner.Parse(childNode, namespaceManager);
4131
            }
4132
            return ctObj;
4133
        }
4134

4135

4136

4137
        internal new void Write(StreamWriter sw, string nodeName)
4138
        {
4139
            sw.Write(string.Format("<w:{0}", nodeName));
4140
            XmlHelper.WriteAttribute(sw, "w:author", this.author);
4141
            XmlHelper.WriteAttribute(sw, "w:date", this.date);
4142
            XmlHelper.WriteAttribute(sw, "r:id", this.id);
4143
            sw.Write(">");
4144
            if (this.tcPr != null)
4145
                this.tcPr.Write(sw, "tcPr");
4146
            sw.WriteEndW(nodeName);
4147
        }
4148

4149
        private CT_TcPrInner tcPrField;
4150

4151
        public CT_TcPrChange()
4152
        {
4153
            
4154
        }
4155

4156
        [XmlElement(Order = 0)]
4157
        public CT_TcPrInner tcPr
4158
        {
4159
            get
4160
            {
4161
                return this.tcPrField;
4162
            }
4163
            set
4164
            {
4165
                this.tcPrField = value;
4166
            }
4167
        }
4168
    }
4169

4170
    [XmlInclude(typeof(CT_TcPr))]
4171
    [Serializable]
4172
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
4173
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
4174
    public class CT_TcPrInner : CT_TcPrBase
4175
    {
4176

4177
        private CT_TrackChange cellInsField;
4178

4179
        private CT_TrackChange cellDelField;
4180

4181
        private CT_CellMergeTrackChange cellMergeField;
4182

4183
        public CT_TcPrInner()
4184
        {
4185
            //this.cellMergeField = new CT_CellMergeTrackChange();
4186
            //this.cellDelField = new CT_TrackChange();
4187
            //this.cellInsField = new CT_TrackChange();
4188
        }
4189
        public static CT_TcPrInner Parse(XmlNode node, XmlNamespaceManager namespaceManager)
4190
        {
4191
            if (node == null)
4192
                return null;
4193
            CT_TcPrInner ctObj = new CT_TcPrInner();
4194
            foreach (XmlNode childNode in node.ChildNodes)
4195
            {
4196
                if (childNode.LocalName == "cellIns")
4197
                    ctObj.cellIns = CT_TrackChange.Parse(childNode, namespaceManager);
4198
                else if (childNode.LocalName == "cellDel")
4199
                    ctObj.cellDel = CT_TrackChange.Parse(childNode, namespaceManager);
4200
                else if (childNode.LocalName == "cellMerge")
4201
                    ctObj.cellMerge = CT_CellMergeTrackChange.Parse(childNode, namespaceManager);
4202
                else if (childNode.LocalName == "cnfStyle")
4203
                    ctObj.cnfStyle = CT_Cnf.Parse(childNode, namespaceManager);
4204
                else if (childNode.LocalName == "tcW")
4205
                    ctObj.tcW = CT_TblWidth.Parse(childNode, namespaceManager);
4206
                else if (childNode.LocalName == "gridSpan")
4207
                    ctObj.gridSpan = CT_DecimalNumber.Parse(childNode, namespaceManager);
4208
                else if (childNode.LocalName == "hMerge")
4209
                    ctObj.hMerge = CT_HMerge.Parse(childNode, namespaceManager);
4210
                else if (childNode.LocalName == "vMerge")
4211
                    ctObj.vMerge = CT_VMerge.Parse(childNode, namespaceManager);
4212
                else if (childNode.LocalName == "tcBorders")
4213
                    ctObj.tcBorders = CT_TcBorders.Parse(childNode, namespaceManager);
4214
                else if (childNode.LocalName == "shd")
4215
                    ctObj.shd = CT_Shd.Parse(childNode, namespaceManager);
4216
                else if (childNode.LocalName == "noWrap")
4217
                    ctObj.noWrap = CT_OnOff.Parse(childNode, namespaceManager);
4218
                else if (childNode.LocalName == "tcMar")
4219
                    ctObj.tcMar = CT_TcMar.Parse(childNode, namespaceManager);
4220
                else if (childNode.LocalName == "textDirection")
4221
                    ctObj.textDirection = CT_TextDirection.Parse(childNode, namespaceManager);
4222
                else if (childNode.LocalName == "tcFitText")
4223
                    ctObj.tcFitText = CT_OnOff.Parse(childNode, namespaceManager);
4224
                else if (childNode.LocalName == "vAlign")
4225
                    ctObj.vAlign = CT_VerticalJc.Parse(childNode, namespaceManager);
4226
                else if (childNode.LocalName == "hideMark")
4227
                    ctObj.hideMark = CT_OnOff.Parse(childNode, namespaceManager);
4228
            }
4229
            return ctObj;
4230
        }
4231

4232

4233

4234
        internal void Write(StreamWriter sw, string nodeName)
4235
        {
4236
            sw.Write(string.Format("<w:{0}", nodeName));
4237
            sw.Write(">");
4238
            if (this.cellIns != null)
4239
                this.cellIns.Write(sw, "cellIns");
4240
            if (this.cellDel != null)
4241
                this.cellDel.Write(sw, "cellDel");
4242
            if (this.cellMerge != null)
4243
                this.cellMerge.Write(sw, "cellMerge");
4244
            if (this.cnfStyle != null)
4245
                this.cnfStyle.Write(sw, "cnfStyle");
4246
            if (this.tcW != null)
4247
                this.tcW.Write(sw, "tcW");
4248
            if (this.gridSpan != null)
4249
                this.gridSpan.Write(sw, "gridSpan");
4250
            if (this.hMerge != null)
4251
                this.hMerge.Write(sw, "hMerge");
4252
            if (this.vMerge != null)
4253
                this.vMerge.Write(sw, "vMerge");
4254
            if (this.tcBorders != null)
4255
                this.tcBorders.Write(sw, "tcBorders");
4256
            if (this.shd != null)
4257
                this.shd.Write(sw, "shd");
4258
            if (this.noWrap != null)
4259
                this.noWrap.Write(sw, "noWrap");
4260
            if (this.tcMar != null)
4261
                this.tcMar.Write(sw, "tcMar");
4262
            if (this.textDirection != null)
4263
                this.textDirection.Write(sw, "textDirection");
4264
            if (this.tcFitText != null)
4265
                this.tcFitText.Write(sw, "tcFitText");
4266
            if (this.vAlign != null)
4267
                this.vAlign.Write(sw, "vAlign");
4268
            if (this.hideMark != null)
4269
                this.hideMark.Write(sw, "hideMark");
4270
            sw.WriteEndW(nodeName);
4271
        }
4272

4273
        [XmlElement(Order = 0)]
4274
        public CT_TrackChange cellIns
4275
        {
4276
            get
4277
            {
4278
                return this.cellInsField;
4279
            }
4280
            set
4281
            {
4282
                this.cellInsField = value;
4283
            }
4284
        }
4285

4286
        [XmlElement(Order = 1)]
4287
        public CT_TrackChange cellDel
4288
        {
4289
            get
4290
            {
4291
                return this.cellDelField;
4292
            }
4293
            set
4294
            {
4295
                this.cellDelField = value;
4296
            }
4297
        }
4298

4299
        [XmlElement(Order = 2)]
4300
        public CT_CellMergeTrackChange cellMerge
4301
        {
4302
            get
4303
            {
4304
                return this.cellMergeField;
4305
            }
4306
            set
4307
            {
4308
                this.cellMergeField = value;
4309
            }
4310
        }
4311
    }
4312

4313

4314
    [Serializable]
4315

4316
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
4317
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
4318
    public class CT_CellMergeTrackChange : CT_TrackChange
4319
    {
4320

4321
        private ST_AnnotationVMerge vMergeField;
4322

4323
        private bool vMergeFieldSpecified;
4324

4325
        private ST_AnnotationVMerge vMergeOrigField;
4326

4327
        private bool vMergeOrigFieldSpecified;
4328
        public static new CT_CellMergeTrackChange Parse(XmlNode node, XmlNamespaceManager namespaceManager)
4329
        {
4330
            if (node == null)
4331
                return null;
4332
            CT_CellMergeTrackChange ctObj = new CT_CellMergeTrackChange();
4333
            if (node.Attributes["w:vMerge"] != null)
4334
                ctObj.vMerge = (ST_AnnotationVMerge)Enum.Parse(typeof(ST_AnnotationVMerge), node.Attributes["w:vMerge"].Value);
4335
            if (node.Attributes["w:vMergeOrig"] != null)
4336
                ctObj.vMergeOrig = (ST_AnnotationVMerge)Enum.Parse(typeof(ST_AnnotationVMerge), node.Attributes["w:vMergeOrig"].Value);
4337
            ctObj.author = XmlHelper.ReadString(node.Attributes["w:author"]);
4338
            ctObj.date = XmlHelper.ReadString(node.Attributes["w:date"]);
4339
            ctObj.id = XmlHelper.ReadString(node.Attributes["r:id"]);
4340
            return ctObj;
4341
        }
4342

4343

4344

4345
        internal new void Write(StreamWriter sw, string nodeName)
4346
        {
4347
            sw.Write(string.Format("<w:{0}", nodeName));
4348
            XmlHelper.WriteAttribute(sw, "w:vMerge", this.vMerge.ToString());
4349
            XmlHelper.WriteAttribute(sw, "w:vMergeOrig", this.vMergeOrig.ToString());
4350
            XmlHelper.WriteAttribute(sw, "w:author", this.author);
4351
            XmlHelper.WriteAttribute(sw, "w:date", this.date);
4352
            XmlHelper.WriteAttribute(sw, "r:id", this.id);
4353
            sw.Write(">");
4354
            sw.WriteEndW(nodeName);
4355
        }
4356

4357
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
4358
        public ST_AnnotationVMerge vMerge
4359
        {
4360
            get
4361
            {
4362
                return this.vMergeField;
4363
            }
4364
            set
4365
            {
4366
                this.vMergeField = value;
4367
            }
4368
        }
4369

4370
        [XmlIgnore]
4371
        public bool vMergeSpecified
4372
        {
4373
            get
4374
            {
4375
                return this.vMergeFieldSpecified;
4376
            }
4377
            set
4378
            {
4379
                this.vMergeFieldSpecified = value;
4380
            }
4381
        }
4382

4383
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
4384
        public ST_AnnotationVMerge vMergeOrig
4385
        {
4386
            get
4387
            {
4388
                return this.vMergeOrigField;
4389
            }
4390
            set
4391
            {
4392
                this.vMergeOrigField = value;
4393
            }
4394
        }
4395

4396
        [XmlIgnore]
4397
        public bool vMergeOrigSpecified
4398
        {
4399
            get
4400
            {
4401
                return this.vMergeOrigFieldSpecified;
4402
            }
4403
            set
4404
            {
4405
                this.vMergeOrigFieldSpecified = value;
4406
            }
4407
        }
4408
    }
4409

4410

4411
    [Serializable]
4412
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
4413
    public enum ST_AnnotationVMerge
4414
    {
4415

4416
    
4417
        cont,
4418

4419
    
4420
        rest,
4421
    }
4422

4423

4424

4425
    [Serializable]
4426

4427
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
4428
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
4429
    public class CT_TcBorders
4430
    {
4431

4432
        private CT_Border topField;
4433

4434
        private CT_Border leftField;
4435

4436
        private CT_Border bottomField;
4437

4438
        private CT_Border rightField;
4439

4440
        private CT_Border insideHField;
4441

4442
        private CT_Border insideVField;
4443

4444
        private CT_Border tl2brField;
4445

4446
        private CT_Border tr2blField;
4447
        public static CT_TcBorders Parse(XmlNode node, XmlNamespaceManager namespaceManager)
4448
        {
4449
            if (node == null)
4450
                return null;
4451
            CT_TcBorders ctObj = new CT_TcBorders();
4452
            foreach (XmlNode childNode in node.ChildNodes)
4453
            {
4454
                if (childNode.LocalName == "top")
4455
                    ctObj.top = CT_Border.Parse(childNode, namespaceManager);
4456
                else if (childNode.LocalName == "left")
4457
                    ctObj.left = CT_Border.Parse(childNode, namespaceManager);
4458
                else if (childNode.LocalName == "bottom")
4459
                    ctObj.bottom = CT_Border.Parse(childNode, namespaceManager);
4460
                else if (childNode.LocalName == "right")
4461
                    ctObj.right = CT_Border.Parse(childNode, namespaceManager);
4462
                else if (childNode.LocalName == "insideH")
4463
                    ctObj.insideH = CT_Border.Parse(childNode, namespaceManager);
4464
                else if (childNode.LocalName == "insideV")
4465
                    ctObj.insideV = CT_Border.Parse(childNode, namespaceManager);
4466
                else if (childNode.LocalName == "tl2br")
4467
                    ctObj.tl2br = CT_Border.Parse(childNode, namespaceManager);
4468
                else if (childNode.LocalName == "tr2bl")
4469
                    ctObj.tr2bl = CT_Border.Parse(childNode, namespaceManager);
4470
            }
4471
            return ctObj;
4472
        }
4473

4474

4475

4476
        internal void Write(StreamWriter sw, string nodeName)
4477
        {
4478
            sw.Write(string.Format("<w:{0}", nodeName));
4479
            sw.Write(">");
4480
            if (this.top != null)
4481
                this.top.Write(sw, "top");
4482
            if (this.left != null)
4483
                this.left.Write(sw, "left");
4484
            if (this.bottom != null)
4485
                this.bottom.Write(sw, "bottom");
4486
            if (this.right != null)
4487
                this.right.Write(sw, "right");
4488
            if (this.insideH != null)
4489
                this.insideH.Write(sw, "insideH");
4490
            if (this.insideV != null)
4491
                this.insideV.Write(sw, "insideV");
4492
            if (this.tl2br != null)
4493
                this.tl2br.Write(sw, "tl2br");
4494
            if (this.tr2bl != null)
4495
                this.tr2bl.Write(sw, "tr2bl");
4496
            sw.WriteEndW(nodeName);
4497
        }
4498

4499
        public CT_TcBorders()
4500
        {
4501

4502
        }
4503

4504
        [XmlElement(Order = 0)]
4505
        public CT_Border top
4506
        {
4507
            get
4508
            {
4509
                return this.topField;
4510
            }
4511
            set
4512
            {
4513
                this.topField = value;
4514
            }
4515
        }
4516

4517
        [XmlElement(Order = 1)]
4518
        public CT_Border left
4519
        {
4520
            get
4521
            {
4522
                return this.leftField;
4523
            }
4524
            set
4525
            {
4526
                this.leftField = value;
4527
            }
4528
        }
4529

4530
        [XmlElement(Order = 2)]
4531
        public CT_Border bottom
4532
        {
4533
            get
4534
            {
4535
                return this.bottomField;
4536
            }
4537
            set
4538
            {
4539
                this.bottomField = value;
4540
            }
4541
        }
4542

4543
        [XmlElement(Order = 3)]
4544
        public CT_Border right
4545
        {
4546
            get
4547
            {
4548
                return this.rightField;
4549
            }
4550
            set
4551
            {
4552
                this.rightField = value;
4553
            }
4554
        }
4555

4556
        [XmlElement(Order = 4)]
4557
        public CT_Border insideH
4558
        {
4559
            get
4560
            {
4561
                return this.insideHField;
4562
            }
4563
            set
4564
            {
4565
                this.insideHField = value;
4566
            }
4567
        }
4568

4569
        [XmlElement(Order = 5)]
4570
        public CT_Border insideV
4571
        {
4572
            get
4573
            {
4574
                return this.insideVField;
4575
            }
4576
            set
4577
            {
4578
                this.insideVField = value;
4579
            }
4580
        }
4581

4582
        [XmlElement(Order = 6)]
4583
        public CT_Border tl2br
4584
        {
4585
            get
4586
            {
4587
                return this.tl2brField;
4588
            }
4589
            set
4590
            {
4591
                this.tl2brField = value;
4592
            }
4593
        }
4594

4595
        [XmlElement(Order = 7)]
4596
        public CT_Border tr2bl
4597
        {
4598
            get
4599
            {
4600
                return this.tr2blField;
4601
            }
4602
            set
4603
            {
4604
                this.tr2blField = value;
4605
            }
4606
        }
4607
    }
4608

4609

4610
    [Serializable]
4611

4612
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
4613
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
4614
    public class CT_TcMar
4615
    {
4616

4617
        private CT_TblWidth topField;
4618

4619
        private CT_TblWidth leftField;
4620

4621
        private CT_TblWidth bottomField;
4622

4623
        private CT_TblWidth rightField;
4624

4625
        public CT_TcMar()
4626
        {
4627
            //this.rightField = new CT_TblWidth();
4628
            //this.bottomField = new CT_TblWidth();
4629
            //this.leftField = new CT_TblWidth();
4630
            //this.topField = new CT_TblWidth();
4631
        }
4632
        public static CT_TcMar Parse(XmlNode node, XmlNamespaceManager namespaceManager)
4633
        {
4634
            if (node == null)
4635
                return null;
4636
            CT_TcMar ctObj = new CT_TcMar();
4637
            foreach (XmlNode childNode in node.ChildNodes)
4638
            {
4639
                if (childNode.LocalName == "top")
4640
                    ctObj.top = CT_TblWidth.Parse(childNode, namespaceManager);
4641
                else if (childNode.LocalName == "left")
4642
                    ctObj.left = CT_TblWidth.Parse(childNode, namespaceManager);
4643
                else if (childNode.LocalName == "bottom")
4644
                    ctObj.bottom = CT_TblWidth.Parse(childNode, namespaceManager);
4645
                else if (childNode.LocalName == "right")
4646
                    ctObj.right = CT_TblWidth.Parse(childNode, namespaceManager);
4647
            }
4648
            return ctObj;
4649
        }
4650

4651

4652

4653
        internal void Write(StreamWriter sw, string nodeName)
4654
        {
4655
            sw.Write(string.Format("<w:{0}", nodeName));
4656
            sw.Write(">");
4657
            if (this.top != null)
4658
                this.top.Write(sw, "top");
4659
            if (this.left != null)
4660
                this.left.Write(sw, "left");
4661
            if (this.bottom != null)
4662
                this.bottom.Write(sw, "bottom");
4663
            if (this.right != null)
4664
                this.right.Write(sw, "right");
4665
            sw.WriteEndW(nodeName);
4666
        }
4667

4668
        [XmlElement(Order = 0)]
4669
        public CT_TblWidth top
4670
        {
4671
            get
4672
            {
4673
                return this.topField;
4674
            }
4675
            set
4676
            {
4677
                this.topField = value;
4678
            }
4679
        }
4680

4681
        [XmlElement(Order = 1)]
4682
        public CT_TblWidth left
4683
        {
4684
            get
4685
            {
4686
                return this.leftField;
4687
            }
4688
            set
4689
            {
4690
                this.leftField = value;
4691
            }
4692
        }
4693

4694
        [XmlElement(Order = 2)]
4695
        public CT_TblWidth bottom
4696
        {
4697
            get
4698
            {
4699
                return this.bottomField;
4700
            }
4701
            set
4702
            {
4703
                this.bottomField = value;
4704
            }
4705
        }
4706

4707
        [XmlElement(Order = 3)]
4708
        public CT_TblWidth right
4709
        {
4710
            get
4711
            {
4712
                return this.rightField;
4713
            }
4714
            set
4715
            {
4716
                this.rightField = value;
4717
            }
4718
        }
4719
    }
4720

4721

4722
    [Serializable]
4723

4724
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
4725
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
4726
    public class CT_TcPr : CT_TcPrInner
4727
    {
4728

4729
        private CT_TcPrChange tcPrChangeField;
4730
        public static new CT_TcPr Parse(XmlNode node, XmlNamespaceManager namespaceManager)
4731
        {
4732
            if (node == null)
4733
                return null;
4734
            CT_TcPr ctObj = new CT_TcPr();
4735
            foreach (XmlNode childNode in node.ChildNodes)
4736
            {
4737
                if (childNode.LocalName == "tcPrChange")
4738
                    ctObj.tcPrChange = CT_TcPrChange.Parse(childNode, namespaceManager);
4739
                else if (childNode.LocalName == "cellIns")
4740
                    ctObj.cellIns = CT_TrackChange.Parse(childNode, namespaceManager);
4741
                else if (childNode.LocalName == "cellDel")
4742
                    ctObj.cellDel = CT_TrackChange.Parse(childNode, namespaceManager);
4743
                else if (childNode.LocalName == "cellMerge")
4744
                    ctObj.cellMerge = CT_CellMergeTrackChange.Parse(childNode, namespaceManager);
4745
                else if (childNode.LocalName == "cnfStyle")
4746
                    ctObj.cnfStyle = CT_Cnf.Parse(childNode, namespaceManager);
4747
                else if (childNode.LocalName == "tcW")
4748
                    ctObj.tcW = CT_TblWidth.Parse(childNode, namespaceManager);
4749
                else if (childNode.LocalName == "gridSpan")
4750
                    ctObj.gridSpan = CT_DecimalNumber.Parse(childNode, namespaceManager);
4751
                else if (childNode.LocalName == "hMerge")
4752
                    ctObj.hMerge = CT_HMerge.Parse(childNode, namespaceManager);
4753
                else if (childNode.LocalName == "vMerge")
4754
                    ctObj.vMerge = CT_VMerge.Parse(childNode, namespaceManager);
4755
                else if (childNode.LocalName == "tcBorders")
4756
                    ctObj.tcBorders = CT_TcBorders.Parse(childNode, namespaceManager);
4757
                else if (childNode.LocalName == "shd")
4758
                    ctObj.shd = CT_Shd.Parse(childNode, namespaceManager);
4759
                else if (childNode.LocalName == "noWrap")
4760
                    ctObj.noWrap = CT_OnOff.Parse(childNode, namespaceManager);
4761
                else if (childNode.LocalName == "tcMar")
4762
                    ctObj.tcMar = CT_TcMar.Parse(childNode, namespaceManager);
4763
                else if (childNode.LocalName == "textDirection")
4764
                    ctObj.textDirection = CT_TextDirection.Parse(childNode, namespaceManager);
4765
                else if (childNode.LocalName == "tcFitText")
4766
                    ctObj.tcFitText = CT_OnOff.Parse(childNode, namespaceManager);
4767
                else if (childNode.LocalName == "vAlign")
4768
                    ctObj.vAlign = CT_VerticalJc.Parse(childNode, namespaceManager);
4769
                else if (childNode.LocalName == "hideMark")
4770
                    ctObj.hideMark = CT_OnOff.Parse(childNode, namespaceManager);
4771
            }
4772
            return ctObj;
4773
        }
4774

4775
        public CT_TblWidth AddNewTcW()
4776
        {
4777
            this.tcW = new CT_TblWidth();
4778
            return this.tcW;
4779
        }
4780

4781
        internal new void Write(StreamWriter sw, string nodeName)
4782
        {
4783
            sw.Write(string.Format("<w:{0}", nodeName));
4784
            sw.Write(">");
4785
            if (this.tcPrChange != null)
4786
                this.tcPrChange.Write(sw, "tcPrChange");
4787
            if (this.cellIns != null)
4788
                this.cellIns.Write(sw, "cellIns");
4789
            if (this.cellDel != null)
4790
                this.cellDel.Write(sw, "cellDel");
4791
            if (this.cellMerge != null)
4792
                this.cellMerge.Write(sw, "cellMerge");
4793
            if (this.cnfStyle != null)
4794
                this.cnfStyle.Write(sw, "cnfStyle");
4795
            if (this.tcW != null)
4796
                this.tcW.Write(sw, "tcW");
4797
            if (this.gridSpan != null)
4798
                this.gridSpan.Write(sw, "gridSpan");
4799
            if (this.hMerge != null)
4800
                this.hMerge.Write(sw, "hMerge");
4801
            if (this.vMerge != null)
4802
                this.vMerge.Write(sw, "vMerge");
4803
            if (this.tcBorders != null)
4804
                this.tcBorders.Write(sw, "tcBorders");
4805
            if (this.shd != null)
4806
                this.shd.Write(sw, "shd");
4807
            if (this.noWrap != null)
4808
                this.noWrap.Write(sw, "noWrap");
4809
            if (this.tcMar != null)
4810
                this.tcMar.Write(sw, "tcMar");
4811
            if (this.textDirection != null)
4812
                this.textDirection.Write(sw, "textDirection");
4813
            if (this.tcFitText != null)
4814
                this.tcFitText.Write(sw, "tcFitText");
4815
            if (this.vAlign != null)
4816
                this.vAlign.Write(sw, "vAlign");
4817
            if (this.hideMark != null)
4818
                this.hideMark.Write(sw, "hideMark");
4819
            sw.WriteEndW(nodeName);
4820
        }
4821

4822
        public CT_TcPr()
4823
        {
4824
            //this.tcPrChangeField = new CT_TcPrChange();
4825
        }
4826

4827
        [XmlElement(Order = 0)]
4828
        public CT_TcPrChange tcPrChange
4829
        {
4830
            get
4831
            {
4832
                return this.tcPrChangeField;
4833
            }
4834
            set
4835
            {
4836
                this.tcPrChangeField = value;
4837
            }
4838
        }
4839

4840
    }
4841

4842
    
4843

4844
    [XmlInclude(typeof(CT_TcPrInner))]
4845
    [XmlInclude(typeof(CT_TcPr))]
4846
    [Serializable]
4847
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
4848
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
4849
    public class CT_TcPrBase
4850
    {
4851

4852
        private CT_Cnf cnfStyleField;
4853

4854
        private CT_TblWidth tcWField;
4855

4856
        private CT_DecimalNumber gridSpanField;
4857

4858
        private CT_HMerge hMergeField;
4859

4860
        private CT_VMerge vMergeField;
4861

4862
        private CT_TcBorders tcBordersField;
4863

4864
        private CT_Shd shdField;
4865

4866
        private CT_OnOff noWrapField;
4867

4868
        private CT_TcMar tcMarField;
4869

4870
        private CT_TextDirection textDirectionField;
4871

4872
        private CT_OnOff tcFitTextField;
4873

4874
        private CT_VerticalJc vAlignField;
4875

4876
        private CT_OnOff hideMarkField;
4877

4878
        public CT_TcPrBase()
4879
        {
4880
        }
4881

4882
        [XmlElement(Order = 0)]
4883
        public CT_Cnf cnfStyle
4884
        {
4885
            get
4886
            {
4887
                return this.cnfStyleField;
4888
            }
4889
            set
4890
            {
4891
                this.cnfStyleField = value;
4892
            }
4893
        }
4894

4895
        [XmlElement(Order = 1)]
4896
        public CT_TblWidth tcW
4897
        {
4898
            get
4899
            {
4900
                return this.tcWField;
4901
            }
4902
            set
4903
            {
4904
                this.tcWField = value;
4905
            }
4906
        }
4907

4908
        [XmlElement(Order = 2)]
4909
        public CT_DecimalNumber gridSpan
4910
        {
4911
            get
4912
            {
4913
                return this.gridSpanField;
4914
            }
4915
            set
4916
            {
4917
                this.gridSpanField = value;
4918
            }
4919
        }
4920

4921
        [XmlElement(Order = 3)]
4922
        public CT_HMerge hMerge
4923
        {
4924
            get
4925
            {
4926
                return this.hMergeField;
4927
            }
4928
            set
4929
            {
4930
                this.hMergeField = value;
4931
            }
4932
        }
4933

4934
        [XmlElement(Order = 4)]
4935
        public CT_VMerge vMerge
4936
        {
4937
            get
4938
            {
4939
                return this.vMergeField;
4940
            }
4941
            set
4942
            {
4943
                this.vMergeField = value;
4944
            }
4945
        }
4946

4947
        [XmlElement(Order = 5)]
4948
        public CT_TcBorders tcBorders
4949
        {
4950
            get
4951
            {
4952
                return this.tcBordersField;
4953
            }
4954
            set
4955
            {
4956
                this.tcBordersField = value;
4957
            }
4958
        }
4959

4960
        [XmlElement(Order = 6)]
4961
        public CT_Shd shd
4962
        {
4963
            get
4964
            {
4965
                return this.shdField;
4966
            }
4967
            set
4968
            {
4969
                this.shdField = value;
4970
            }
4971
        }
4972

4973
        [XmlElement(Order = 7)]
4974
        public CT_OnOff noWrap
4975
        {
4976
            get
4977
            {
4978
                return this.noWrapField;
4979
            }
4980
            set
4981
            {
4982
                this.noWrapField = value;
4983
            }
4984
        }
4985

4986
        [XmlElement(Order = 8)]
4987
        public CT_TcMar tcMar
4988
        {
4989
            get
4990
            {
4991
                return this.tcMarField;
4992
            }
4993
            set
4994
            {
4995
                this.tcMarField = value;
4996
            }
4997
        }
4998

4999
        [XmlElement(Order = 9)]
5000
        public CT_TextDirection textDirection
5001
        {
5002
            get
5003
            {
5004
                return this.textDirectionField;
5005
            }
5006
            set
5007
            {
5008
                this.textDirectionField = value;
5009
            }
5010
        }
5011

5012
        [XmlElement(Order = 10)]
5013
        public CT_OnOff tcFitText
5014
        {
5015
            get
5016
            {
5017
                return this.tcFitTextField;
5018
            }
5019
            set
5020
            {
5021
                this.tcFitTextField = value;
5022
            }
5023
        }
5024

5025
        [XmlElement(Order = 11)]
5026
        public CT_VerticalJc vAlign
5027
        {
5028
            get
5029
            {
5030
                return this.vAlignField;
5031
            }
5032
            set
5033
            {
5034
                this.vAlignField = value;
5035
            }
5036
        }
5037

5038
        [XmlElement(Order = 12)]
5039
        public CT_OnOff hideMark
5040
        {
5041
            get
5042
            {
5043
                return this.hideMarkField;
5044
            }
5045
            set
5046
            {
5047
                this.hideMarkField = value;
5048
            }
5049
        }
5050

5051
        public CT_Shd AddNewShd()
5052
        {
5053
            this.shdField = new CT_Shd();
5054
            return this.shdField;
5055
        }
5056

5057
        public bool IsSetShd()
5058
        {
5059
            return this.shdField != null;
5060
        }
5061

5062
        public CT_VerticalJc AddNewVAlign()
5063
        {
5064
            this.vAlign = new CT_VerticalJc();
5065
            return this.vAlign;
5066
        }
5067

5068
        public CT_VMerge AddNewVMerge()
5069
        {
5070
            this.vMerge = new CT_VMerge();
5071
            return this.vMerge;
5072
        }
5073

5074
        public CT_TcBorders AddNewTcBorders()
5075
        {
5076
            this.tcBorders = new CT_TcBorders();
5077
            return this.tcBorders;
5078
        }
5079

5080
        public CT_HMerge AddNewHMerge()
5081
        {
5082
            this.hMerge = new CT_HMerge();
5083
            return this.hMerge;
5084
        }
5085
        public CT_DecimalNumber AddNewGridspan()
5086
        {
5087
            this.gridSpanField = new CT_DecimalNumber();
5088
            return this.gridSpanField;
5089
        }
5090
    }
5091

5092
    [Serializable]
5093

5094
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
5095
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
5096
    public class CT_HMerge
5097
    {
5098

5099
        private ST_Merge valField;
5100

5101
        private bool valFieldSpecified;
5102
        public static CT_HMerge Parse(XmlNode node, XmlNamespaceManager namespaceManager)
5103
        {
5104
            if (node == null)
5105
                return null;
5106
            CT_HMerge ctObj = new CT_HMerge();
5107
            if (node.Attributes["w:val"] != null)
5108
                ctObj.val = (ST_Merge)Enum.Parse(typeof(ST_Merge), node.Attributes["w:val"].Value);
5109
            return ctObj;
5110
        }
5111

5112

5113

5114
        internal void Write(StreamWriter sw, string nodeName)
5115
        {
5116
            sw.Write(string.Format("<w:{0}", nodeName));
5117
            XmlHelper.WriteAttribute(sw, "w:val", this.val.ToString());
5118
            sw.Write(">");
5119
            sw.WriteEndW(nodeName);
5120
        }
5121

5122
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
5123
        public ST_Merge val
5124
        {
5125
            get
5126
            {
5127
                return this.valField;
5128
            }
5129
            set
5130
            {
5131
                this.valField = value;
5132
            }
5133
        }
5134

5135
        [XmlIgnore]
5136
        public bool valSpecified
5137
        {
5138
            get
5139
            {
5140
                return this.valFieldSpecified;
5141
            }
5142
            set
5143
            {
5144
                this.valFieldSpecified = value;
5145
            }
5146
        }
5147
    }
5148

5149

5150
    [Serializable]
5151
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
5152
    public enum ST_Merge
5153
    {
5154

5155
    
5156
        @continue,
5157

5158
    
5159
        restart,
5160
    }
5161

5162

5163
    [Serializable]
5164

5165
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
5166
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
5167
    public class CT_VMerge
5168
    {
5169
        public CT_VMerge()
5170
        {
5171
            this.valField = ST_Merge.@continue;
5172
        }
5173
        private ST_Merge valField;
5174

5175
        private bool valFieldSpecified;
5176
        public static CT_VMerge Parse(XmlNode node, XmlNamespaceManager namespaceManager)
5177
        {
5178
            if (node == null)
5179
                return null;
5180
            CT_VMerge ctObj = new CT_VMerge();
5181
            if (node.Attributes["w:val"] != null)
5182
            {
5183
                ctObj.valField = (ST_Merge)Enum.Parse(typeof(ST_Merge), node.Attributes["w:val"].Value);
5184
                ctObj.valFieldSpecified = true;
5185
            }
5186
            return ctObj;
5187
        }
5188

5189

5190

5191
        internal void Write(StreamWriter sw, string nodeName)
5192
        {
5193
            sw.Write(string.Format("<w:{0}", nodeName));
5194
            if (valField != ST_Merge.@continue|| this.valFieldSpecified)
5195
            {
5196
                XmlHelper.WriteAttribute(sw, "w:val", this.valField.ToString());
5197
            }
5198
            sw.Write("/>");
5199
        }
5200

5201
        public ST_Merge val
5202
        {
5203
            get
5204
            {
5205
                return this.valField;
5206
            }
5207
            set
5208
            {
5209
                this.valField = value;
5210
                this.valFieldSpecified = true;
5211
            }
5212
        }
5213

5214
        [XmlIgnore]
5215
        public bool valSpecified
5216
        {
5217
            get
5218
            {
5219
                return this.valFieldSpecified;
5220
            }
5221
            set
5222
            {
5223
                this.valFieldSpecified = value;
5224
            }
5225
        }
5226
    }
5227

5228
    
5229
    #endregion
5230
    [Serializable]
5231

5232
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
5233
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
5234
    public class CT_Column
5235
    {
5236

5237
        private ulong wField;
5238

5239
        private bool wFieldSpecified;
5240

5241
        private ulong spaceField;
5242

5243
        private bool spaceFieldSpecified;
5244
        public static CT_Column Parse(XmlNode node, XmlNamespaceManager namespaceManager)
5245
        {
5246
            if (node == null)
5247
                return null;
5248
            CT_Column ctObj = new CT_Column();
5249
            ctObj.w = XmlHelper.ReadULong(node.Attributes["w:w"]);
5250
            ctObj.space = XmlHelper.ReadULong(node.Attributes["w:space"]);
5251
            return ctObj;
5252
        }
5253

5254

5255

5256
        internal void Write(StreamWriter sw, string nodeName)
5257
        {
5258
            sw.Write(string.Format("<w:{0}", nodeName));
5259
            XmlHelper.WriteAttribute(sw, "w:w", this.w);
5260
            XmlHelper.WriteAttribute(sw, "w:space", this.space);
5261
            sw.Write(">");
5262
            sw.WriteEndW(nodeName);
5263
        }
5264

5265
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
5266
        public ulong w
5267
        {
5268
            get
5269
            {
5270
                return this.wField;
5271
            }
5272
            set
5273
            {
5274
                this.wField = value;
5275
            }
5276
        }
5277

5278
        [XmlIgnore]
5279
        public bool wSpecified
5280
        {
5281
            get
5282
            {
5283
                return this.wFieldSpecified;
5284
            }
5285
            set
5286
            {
5287
                this.wFieldSpecified = value;
5288
            }
5289
        }
5290

5291
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
5292
        public ulong space
5293
        {
5294
            get
5295
            {
5296
                return this.spaceField;
5297
            }
5298
            set
5299
            {
5300
                this.spaceField = value;
5301
            }
5302
        }
5303

5304
        [XmlIgnore]
5305
        public bool spaceSpecified
5306
        {
5307
            get
5308
            {
5309
                return this.spaceFieldSpecified;
5310
            }
5311
            set
5312
            {
5313
                this.spaceFieldSpecified = value;
5314
            }
5315
        }
5316
    }
5317
    [Serializable]
5318

5319
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
5320
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
5321
    public class CT_Columns
5322
    {
5323

5324
        private List<CT_Column> colField;
5325

5326
        private ST_OnOff equalWidthField;
5327

5328
        private bool equalWidthFieldSpecified;
5329

5330
        private ulong spaceField;
5331

5332
        private bool spaceFieldSpecified;
5333

5334
        private string numField;
5335

5336
        private ST_OnOff sepField;
5337

5338
        private bool sepFieldSpecified;
5339

5340
        public CT_Columns()
5341
        {
5342
            //this.colField = new List<CT_Column>();
5343
            this.equalWidthField = ST_OnOff.off;
5344
            this.sepField = ST_OnOff.off;
5345
        }
5346
        public static CT_Columns Parse(XmlNode node, XmlNamespaceManager namespaceManager)
5347
        {
5348
            if (node == null)
5349
                return null;
5350
            CT_Columns ctObj = new CT_Columns();
5351
            if (node.Attributes["w:equalWidth"] != null)
5352
                ctObj.equalWidth = (ST_OnOff)Enum.Parse(typeof(ST_OnOff), node.Attributes["w:equalWidth"].Value,true);
5353
            ctObj.space = XmlHelper.ReadULong(node.Attributes["w:space"]);
5354
            ctObj.num = XmlHelper.ReadString(node.Attributes["w:num"]);
5355
            if (node.Attributes["w:sep"] != null)
5356
                ctObj.sep = (ST_OnOff)Enum.Parse(typeof(ST_OnOff), node.Attributes["w:sep"].Value,true);
5357
            ctObj.col = new List<CT_Column>();
5358
            foreach (XmlNode childNode in node.ChildNodes)
5359
            {
5360
                if (childNode.LocalName == "col")
5361
                    ctObj.col.Add(CT_Column.Parse(childNode, namespaceManager));
5362
            }
5363
            return ctObj;
5364
        }
5365

5366

5367

5368
        internal void Write(StreamWriter sw, string nodeName)
5369
        {
5370
            sw.Write(string.Format("<w:{0}", nodeName));
5371
            if(this.equalWidth!= ST_OnOff.off)
5372
                XmlHelper.WriteAttribute(sw, "w:equalWidth", this.equalWidth.ToString());
5373
            XmlHelper.WriteAttribute(sw, "w:space", this.space);
5374
            XmlHelper.WriteAttribute(sw, "w:num", this.num);
5375
            if(this.sep!= ST_OnOff.off)
5376
                XmlHelper.WriteAttribute(sw, "w:sep", this.sep.ToString());
5377
            if (this.col != null && this.col.Count > 0)
5378
            {
5379
                sw.Write(">");
5380
                foreach (CT_Column x in this.col)
5381
                {
5382
                    x.Write(sw, "col");
5383
                }
5384
                sw.WriteEndW(nodeName);
5385
            } else
5386
            {
5387
                sw.Write("/>");
5388
            }
5389
        }
5390

5391

5392
        [XmlElement("col", Order = 0)]
5393
        public List<CT_Column> col
5394
        {
5395
            get
5396
            {
5397
                return this.colField;
5398
            }
5399
            set
5400
            {
5401
                this.colField = value;
5402
            }
5403
        }
5404

5405
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
5406
        public ST_OnOff equalWidth
5407
        {
5408
            get
5409
            {
5410
                return this.equalWidthField;
5411
            }
5412
            set
5413
            {
5414
                this.equalWidthField = value;
5415
            }
5416
        }
5417

5418
        [XmlIgnore]
5419
        public bool equalWidthSpecified
5420
        {
5421
            get
5422
            {
5423
                return this.equalWidthFieldSpecified;
5424
            }
5425
            set
5426
            {
5427
                this.equalWidthFieldSpecified = value;
5428
            }
5429
        }
5430

5431
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
5432
        public ulong space
5433
        {
5434
            get
5435
            {
5436
                return this.spaceField;
5437
            }
5438
            set
5439
            {
5440
                this.spaceField = value;
5441
            }
5442
        }
5443

5444
        [XmlIgnore]
5445
        public bool spaceSpecified
5446
        {
5447
            get
5448
            {
5449
                return this.spaceFieldSpecified;
5450
            }
5451
            set
5452
            {
5453
                this.spaceFieldSpecified = value;
5454
            }
5455
        }
5456

5457
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified, DataType = "integer")]
5458
        public string num
5459
        {
5460
            get
5461
            {
5462
                return this.numField;
5463
            }
5464
            set
5465
            {
5466
                this.numField = value;
5467
            }
5468
        }
5469

5470
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
5471
        public ST_OnOff sep
5472
        {
5473
            get
5474
            {
5475
                return this.sepField;
5476
            }
5477
            set
5478
            {
5479
                this.sepField = value;
5480
            }
5481
        }
5482

5483
        [XmlIgnore]
5484
        public bool sepSpecified
5485
        {
5486
            get
5487
            {
5488
                return this.sepFieldSpecified;
5489
            }
5490
            set
5491
            {
5492
                this.sepFieldSpecified = value;
5493
            }
5494
        }
5495
    }
5496

5497

5498
#region Table Row
5499
    [Serializable]
5500

5501
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
5502
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
5503
    public class CT_Row
5504
    {
5505

5506
        private CT_TblPrEx tblPrExField;
5507

5508
        private CT_TrPr trPrField;
5509

5510
        private ArrayList itemsField;
5511

5512
        private List<ItemsChoiceTableRowType> itemsElementNameField;
5513

5514
        private byte[] rsidRPrField;
5515

5516
        private byte[] rsidRField;
5517

5518
        private byte[] rsidDelField;
5519

5520
        private byte[] rsidTrField;
5521
        private byte[] paraIdField;
5522
        private byte[] textIdField;
5523

5524
        public CT_Row()
5525
        {
5526
            this.itemsElementNameField = new List<ItemsChoiceTableRowType>();
5527
            this.itemsField = new ArrayList();
5528
        }
5529
        object parent;
5530
        [XmlIgnore]
5531
        public object Parent
5532
        {
5533
            get { return parent; }
5534
        }
5535
        public static CT_Row Parse(XmlNode node, XmlNamespaceManager namespaceManager, object parent)
5536
        {
5537
            if (node == null)
5538
                return null;
5539
            CT_Row ctObj = new CT_Row();
5540
            if (parent != null)
5541
                ctObj.parent = parent;
5542
            if (node.Attributes["w14:paraId"] != null)
5543
                ctObj.paraIdField = XmlHelper.ReadBytes(node.Attributes["w14:paraId"]);
5544
            if (node.Attributes["w14:textId"] != null)
5545
                ctObj.textIdField = XmlHelper.ReadBytes(node.Attributes["w14:textId"]);
5546
            ctObj.rsidRPr = XmlHelper.ReadBytes(node.Attributes["w:rsidRPr"]);
5547
            ctObj.rsidR = XmlHelper.ReadBytes(node.Attributes["w:rsidR"]);
5548
            ctObj.rsidDel = XmlHelper.ReadBytes(node.Attributes["w:rsidDel"]);
5549
            ctObj.rsidTr = XmlHelper.ReadBytes(node.Attributes["w:rsidTr"]);
5550

5551
            foreach (XmlNode childNode in node.ChildNodes)
5552
            {
5553
                if (childNode.LocalName == "tblPrEx")
5554
                    ctObj.tblPrEx = CT_TblPrEx.Parse(childNode, namespaceManager);
5555
                else if (childNode.LocalName == "trPr")
5556
                    ctObj.trPr = CT_TrPr.Parse(childNode, namespaceManager);
5557
                else if (childNode.LocalName == "bookmarkStart")
5558
                {
5559
                    ctObj.Items.Add(CT_Bookmark.Parse(childNode, namespaceManager));
5560
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.bookmarkStart);
5561
                }
5562
                else if (childNode.LocalName == "commentRangeEnd")
5563
                {
5564
                    ctObj.Items.Add(CT_MarkupRange.Parse(childNode, namespaceManager));
5565
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.commentRangeEnd);
5566
                }
5567
                else if (childNode.LocalName == "commentRangeStart")
5568
                {
5569
                    ctObj.Items.Add(CT_MarkupRange.Parse(childNode, namespaceManager));
5570
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.commentRangeStart);
5571
                }
5572
                else if (childNode.LocalName == "customXmlInsRangeStart")
5573
                {
5574
                    ctObj.Items.Add(CT_TrackChange.Parse(childNode, namespaceManager));
5575
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.customXmlInsRangeStart);
5576
                }
5577
                else if (childNode.LocalName == "customXmlMoveFromRangeStart")
5578
                {
5579
                    ctObj.Items.Add(CT_TrackChange.Parse(childNode, namespaceManager));
5580
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.customXmlMoveFromRangeStart);
5581
                }
5582
                else if (childNode.LocalName == "customXmlMoveToRangeEnd")
5583
                {
5584
                    ctObj.Items.Add(CT_Markup.Parse(childNode, namespaceManager));
5585
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.customXmlMoveToRangeEnd);
5586
                }
5587
                else if (childNode.LocalName == "customXmlMoveToRangeStart")
5588
                {
5589
                    ctObj.Items.Add(CT_TrackChange.Parse(childNode, namespaceManager));
5590
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.customXmlMoveToRangeStart);
5591
                }
5592
                else if (childNode.LocalName == "del")
5593
                {
5594
                    ctObj.Items.Add(CT_RunTrackChange.Parse(childNode, namespaceManager));
5595
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.del);
5596
                }
5597
                else if (childNode.LocalName == "moveTo")
5598
                {
5599
                    ctObj.Items.Add(CT_RunTrackChange.Parse(childNode, namespaceManager));
5600
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.moveTo);
5601
                }
5602
                else if (childNode.LocalName == "oMath")
5603
                {
5604
                    ctObj.Items.Add(CT_OMath.Parse(childNode, namespaceManager));
5605
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.oMath);
5606
                }
5607
                else if (childNode.LocalName == "oMathPara")
5608
                {
5609
                    ctObj.Items.Add(CT_OMathPara.Parse(childNode, namespaceManager));
5610
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.oMathPara);
5611
                }
5612
                else if (childNode.LocalName == "bookmarkEnd")
5613
                {
5614
                    ctObj.Items.Add(CT_MarkupRange.Parse(childNode, namespaceManager));
5615
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.bookmarkEnd);
5616
                }
5617
                else if (childNode.LocalName == "customXml")
5618
                {
5619
                    ctObj.Items.Add(CT_CustomXmlCell.Parse(childNode, namespaceManager));
5620
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.customXml);
5621
                }
5622
                else if (childNode.LocalName == "customXmlDelRangeStart")
5623
                {
5624
                    ctObj.Items.Add(CT_TrackChange.Parse(childNode, namespaceManager));
5625
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.customXmlDelRangeStart);
5626
                }
5627
                else if (childNode.LocalName == "customXmlInsRangeEnd")
5628
                {
5629
                    ctObj.Items.Add(CT_Markup.Parse(childNode, namespaceManager));
5630
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.customXmlInsRangeEnd);
5631
                }
5632
                else if (childNode.LocalName == "customXmlMoveFromRangeEnd")
5633
                {
5634
                    ctObj.Items.Add(CT_Markup.Parse(childNode, namespaceManager));
5635
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.customXmlMoveFromRangeEnd);
5636
                }
5637
                else if (childNode.LocalName == "ins")
5638
                {
5639
                    ctObj.Items.Add(CT_RunTrackChange.Parse(childNode, namespaceManager));
5640
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.ins);
5641
                }
5642
                else if (childNode.LocalName == "moveFrom")
5643
                {
5644
                    ctObj.Items.Add(CT_RunTrackChange.Parse(childNode, namespaceManager));
5645
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.moveFrom);
5646
                }
5647
                else if (childNode.LocalName == "moveFromRangeEnd")
5648
                {
5649
                    ctObj.Items.Add(CT_MarkupRange.Parse(childNode, namespaceManager));
5650
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.moveFromRangeEnd);
5651
                }
5652
                else if (childNode.LocalName == "moveFromRangeStart")
5653
                {
5654
                    ctObj.Items.Add(CT_MoveBookmark.Parse(childNode, namespaceManager));
5655
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.moveFromRangeStart);
5656
                }
5657
                else if (childNode.LocalName == "customXmlDelRangeEnd")
5658
                {
5659
                    ctObj.Items.Add(CT_Markup.Parse(childNode, namespaceManager));
5660
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.customXmlDelRangeEnd);
5661
                }
5662
                else if (childNode.LocalName == "moveToRangeEnd")
5663
                {
5664
                    ctObj.Items.Add(CT_MarkupRange.Parse(childNode, namespaceManager));
5665
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.moveToRangeEnd);
5666
                }
5667
                else if (childNode.LocalName == "moveToRangeStart")
5668
                {
5669
                    ctObj.Items.Add(CT_MoveBookmark.Parse(childNode, namespaceManager));
5670
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.moveToRangeStart);
5671
                }
5672
                else if (childNode.LocalName == "permEnd")
5673
                {
5674
                    ctObj.Items.Add(CT_Perm.Parse(childNode, namespaceManager));
5675
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.permEnd);
5676
                }
5677
                else if (childNode.LocalName == "permStart")
5678
                {
5679
                    ctObj.Items.Add(CT_PermStart.Parse(childNode, namespaceManager));
5680
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.permStart);
5681
                }
5682
                else if (childNode.LocalName == "proofErr")
5683
                {
5684
                    ctObj.Items.Add(CT_ProofErr.Parse(childNode, namespaceManager));
5685
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.proofErr);
5686
                }
5687
                else if (childNode.LocalName == "sdt")
5688
                {
5689
                    ctObj.Items.Add(CT_SdtCell.Parse(childNode, namespaceManager));
5690
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.sdt);
5691
                }
5692
                else if (childNode.LocalName == "tc")
5693
                {
5694
                    ctObj.Items.Add(CT_Tc.Parse(childNode, namespaceManager, ctObj));
5695
                    ctObj.ItemsElementName.Add(ItemsChoiceTableRowType.tc);
5696
                }
5697
            }
5698
            return ctObj;
5699
        }
5700

5701
        internal void Write(StreamWriter sw, string nodeName)
5702
        {
5703
            sw.Write(string.Format("<w:{0}", nodeName));
5704
            XmlHelper.WriteAttribute(sw, "w:rsidR", this.rsidR);
5705
            XmlHelper.WriteAttribute(sw, "w:rsidRPr", this.rsidRPr);
5706
            XmlHelper.WriteAttribute(sw, "w14:paraId", this.paraIdField);
5707
            XmlHelper.WriteAttribute(sw, "w14:textId", this.textIdField);
5708
            XmlHelper.WriteAttribute(sw, "w:rsidDel", this.rsidDel);
5709
            XmlHelper.WriteAttribute(sw, "w:rsidTr", this.rsidTr);
5710
            sw.Write(">");
5711
            if (this.tblPrEx != null)
5712
                this.tblPrEx.Write(sw, "tblPrEx");
5713
            if (this.trPr != null)
5714
                this.trPr.Write(sw, "trPr");
5715
            foreach (object o in this.Items)
5716
            {
5717
                if (o is CT_Bookmark)
5718
                    ((CT_Bookmark)o).Write(sw, "bookmarkStart");
5719
                else if (o is CT_MarkupRange)
5720
                    ((CT_MarkupRange)o).Write(sw, "commentRangeEnd");
5721
                else if (o is CT_MarkupRange)
5722
                    ((CT_MarkupRange)o).Write(sw, "commentRangeStart");
5723
                else if (o is CT_TrackChange)
5724
                    ((CT_TrackChange)o).Write(sw, "customXmlInsRangeStart");
5725
                else if (o is CT_TrackChange)
5726
                    ((CT_TrackChange)o).Write(sw, "customXmlMoveFromRangeStart");
5727
                else if (o is CT_Markup)
5728
                    ((CT_Markup)o).Write(sw, "customXmlMoveToRangeEnd");
5729
                else if (o is CT_TrackChange)
5730
                    ((CT_TrackChange)o).Write(sw, "customXmlMoveToRangeStart");
5731
                else if (o is CT_RunTrackChange)
5732
                    ((CT_RunTrackChange)o).Write(sw, "del");
5733
                else if (o is CT_RunTrackChange)
5734
                    ((CT_RunTrackChange)o).Write(sw, "moveTo");
5735
                else if (o is CT_OMath)
5736
                    ((CT_OMath)o).Write(sw, "oMath");
5737
                else if (o is CT_OMathPara)
5738
                    ((CT_OMathPara)o).Write(sw, "oMathPara");
5739
                else if (o is CT_MarkupRange)
5740
                    ((CT_MarkupRange)o).Write(sw, "bookmarkEnd");
5741
                else if (o is CT_CustomXmlCell)
5742
                    ((CT_CustomXmlCell)o).Write(sw, "customXml");
5743
                else if (o is CT_TrackChange)
5744
                    ((CT_TrackChange)o).Write(sw, "customXmlDelRangeStart");
5745
                else if (o is CT_Markup)
5746
                    ((CT_Markup)o).Write(sw, "customXmlInsRangeEnd");
5747
                else if (o is CT_Markup)
5748
                    ((CT_Markup)o).Write(sw, "customXmlMoveFromRangeEnd");
5749
                else if (o is CT_RunTrackChange)
5750
                    ((CT_RunTrackChange)o).Write(sw, "ins");
5751
                else if (o is CT_RunTrackChange)
5752
                    ((CT_RunTrackChange)o).Write(sw, "moveFrom");
5753
                else if (o is CT_MarkupRange)
5754
                    ((CT_MarkupRange)o).Write(sw, "moveFromRangeEnd");
5755
                else if (o is CT_MoveBookmark)
5756
                    ((CT_MoveBookmark)o).Write(sw, "moveFromRangeStart");
5757
                else if (o is CT_Markup)
5758
                    ((CT_Markup)o).Write(sw, "customXmlDelRangeEnd");
5759
                else if (o is CT_MarkupRange)
5760
                    ((CT_MarkupRange)o).Write(sw, "moveToRangeEnd");
5761
                else if (o is CT_MoveBookmark)
5762
                    ((CT_MoveBookmark)o).Write(sw, "moveToRangeStart");
5763
                else if (o is CT_Perm)
5764
                    ((CT_Perm)o).Write(sw, "permEnd");
5765
                else if (o is CT_PermStart)
5766
                    ((CT_PermStart)o).Write(sw, "permStart");
5767
                else if (o is CT_ProofErr)
5768
                    ((CT_ProofErr)o).Write(sw, "proofErr");
5769
                else if (o is CT_SdtCell)
5770
                    ((CT_SdtCell)o).Write(sw, "sdt");
5771
                else if (o is CT_Tc)
5772
                    ((CT_Tc)o).Write(sw, "tc");
5773
            }
5774
            sw.WriteEndW(nodeName);
5775
        }
5776
        public CT_Row Copy()
5777
        {
5778
            CT_Row ctRow = new CT_Row();
5779
            ctRow.paraIdField = this.paraIdField?.ToArray();
5780
            ctRow.rsidRField = this.rsidRField?.ToArray();
5781
            ctRow.rsidDelField = this.rsidDelField?.ToArray();
5782
            ctRow.rsidRPrField = this.rsidRPrField?.ToArray();
5783
            ctRow.rsidTrField = this.rsidTrField?.ToArray();
5784
            ctRow.textIdField = this.textIdField?.ToArray();
5785
            ctRow.trPrField = this.trPrField?.Copy();
5786
            ctRow.tblPrExField = this.tblPrExField?.Copy();
5787
            ctRow.itemsElementNameField = this.itemsElementNameField?.Copy();
5788
            ctRow.itemsField = this.itemsField?.Copy();
5789
            return ctRow;
5790
        }
5791
        public void RemoveTc(int pos)
5792
        {
5793
            RemoveObject(ItemsChoiceTableRowType.tc, pos);
5794
        }
5795
        [XmlElement(Order = 0)]
5796
        public CT_TblPrEx tblPrEx
5797
        {
5798
            get
5799
            {
5800
                return this.tblPrExField;
5801
            }
5802
            set
5803
            {
5804
                this.tblPrExField = value;
5805
            }
5806
        }
5807

5808
        [XmlElement(Order = 1)]
5809
        public CT_TrPr trPr
5810
        {
5811
            get
5812
            {
5813
                return this.trPrField;
5814
            }
5815
            set
5816
            {
5817
                this.trPrField = value;
5818
            }
5819
        }
5820

5821
        [XmlElement("oMath", typeof(CT_OMath), Namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", Order = 2)]
5822
        [XmlElement("oMathPara", typeof(CT_OMathPara), Namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math", Order = 2)]
5823
        [XmlElement("bookmarkEnd", typeof(CT_MarkupRange), Order = 2)]
5824
        [XmlElement("bookmarkStart", typeof(CT_Bookmark), Order = 2)]
5825
        [XmlElement("commentRangeEnd", typeof(CT_MarkupRange), Order = 2)]
5826
        [XmlElement("commentRangeStart", typeof(CT_MarkupRange), Order = 2)]
5827
        [XmlElement("customXml", typeof(CT_CustomXmlCell), Order = 2)]
5828
        [XmlElement("customXmlDelRangeEnd", typeof(CT_Markup), Order = 2)]
5829
        [XmlElement("customXmlDelRangeStart", typeof(CT_TrackChange), Order = 2)]
5830
        [XmlElement("customXmlInsRangeEnd", typeof(CT_Markup), Order = 2)]
5831
        [XmlElement("customXmlInsRangeStart", typeof(CT_TrackChange), Order = 2)]
5832
        [XmlElement("customXmlMoveFromRangeEnd", typeof(CT_Markup), Order = 2)]
5833
        [XmlElement("customXmlMoveFromRangeStart", typeof(CT_TrackChange), Order = 2)]
5834
        [XmlElement("customXmlMoveToRangeEnd", typeof(CT_Markup), Order = 2)]
5835
        [XmlElement("customXmlMoveToRangeStart", typeof(CT_TrackChange), Order = 2)]
5836
        [XmlElement("del", typeof(CT_RunTrackChange), Order = 2)]
5837
        [XmlElement("ins", typeof(CT_RunTrackChange), Order = 2)]
5838
        [XmlElement("moveFrom", typeof(CT_RunTrackChange), Order = 2)]
5839
        [XmlElement("moveFromRangeEnd", typeof(CT_MarkupRange), Order = 2)]
5840
        [XmlElement("moveFromRangeStart", typeof(CT_MoveBookmark), Order = 2)]
5841
        [XmlElement("moveTo", typeof(CT_RunTrackChange), Order = 2)]
5842
        [XmlElement("moveToRangeEnd", typeof(CT_MarkupRange), Order = 2)]
5843
        [XmlElement("moveToRangeStart", typeof(CT_MoveBookmark), Order = 2)]
5844
        [XmlElement("permEnd", typeof(CT_Perm), Order = 2)]
5845
        [XmlElement("permStart", typeof(CT_PermStart), Order = 2)]
5846
        [XmlElement("proofErr", typeof(CT_ProofErr), Order = 2)]
5847
        [XmlElement("sdt", typeof(CT_SdtCell), Order = 2)]
5848
        [XmlElement("tc", typeof(CT_Tc), Order = 2)]
5849
        [XmlChoiceIdentifier("ItemsElementName")]
5850
        public ArrayList Items
5851
        {
5852
            get
5853
            {
5854
                return this.itemsField;
5855
            }
5856
            set
5857
            {
5858
               this.itemsField = value;
5859
            }
5860
        }
5861

5862
        [XmlElement("ItemsElementName", Order = 3)]
5863
        [XmlIgnore]
5864
        public List<ItemsChoiceTableRowType> ItemsElementName
5865
        {
5866
            get
5867
            {
5868
                return this.itemsElementNameField;
5869
            }
5870
            set
5871
            {
5872
               this.itemsElementNameField = value;
5873
            }
5874
        }
5875

5876
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified, DataType = "hexBinary")]
5877
        public byte[] rsidRPr
5878
        {
5879
            get
5880
            {
5881
                return this.rsidRPrField;
5882
            }
5883
            set
5884
            {
5885
                this.rsidRPrField = value;
5886
            }
5887
        }
5888

5889
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified, DataType = "hexBinary")]
5890
        public byte[] rsidR
5891
        {
5892
            get
5893
            {
5894
                return this.rsidRField;
5895
            }
5896
            set
5897
            {
5898
                this.rsidRField = value;
5899
            }
5900
        }
5901

5902
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified, DataType = "hexBinary")]
5903
        public byte[] rsidDel
5904
        {
5905
            get
5906
            {
5907
                return this.rsidDelField;
5908
            }
5909
            set
5910
            {
5911
                this.rsidDelField = value;
5912
            }
5913
        }
5914

5915
        [XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified, DataType = "hexBinary")]
5916
        public byte[] rsidTr
5917
        {
5918
            get
5919
            {
5920
                return this.rsidTrField;
5921
            }
5922
            set
5923
            {
5924
                this.rsidTrField = value;
5925
            }
5926
        }
5927
        private CT_Tbl _table;
5928
        [XmlIgnore]
5929
        public CT_Tbl Table
5930
        {
5931
            get { return _table; }
5932
            set { _table = value; }
5933
        }
5934

5935
        public IList<CT_Tc> GetTcList()
5936
        {
5937
            return GetObjectList<CT_Tc>(ItemsChoiceTableRowType.tc);
5938
        }
5939

5940
        public bool IsSetTrPr()
5941
        {
5942
            if (this.trPrField == null)
5943
                return false;
5944
            return this.trPrField.Items.Count > 0;
5945
        }
5946

5947
        public CT_TrPr AddNewTrPr()
5948
        {
5949
            if (this.trPrField == null)
5950
                this.trPrField = new CT_TrPr();
5951
            return this.trPrField;
5952
        }
5953

5954
        public CT_Tc AddNewTc()
5955
        {
5956
            return AddNewObject<CT_Tc>(ItemsChoiceTableRowType.tc);
5957
        }
5958

5959
        public int SizeOfTcArray()
5960
        {
5961
            return SizeOfArray(ItemsChoiceTableRowType.tc);
5962
        }
5963

5964
        public CT_Tc GetTcArray(int p)
5965
        {
5966
            return GetObjectArray<CT_Tc>(p, ItemsChoiceTableRowType.tc);
5967
        }
5968
        #region Generic methods for object operation
5969

5970
        private List<T> GetObjectList<T>(ItemsChoiceTableRowType type) where T : class
5971
        {
5972
            lock (this)
5973
            {
5974
                List<T> list = new List<T>();
5975
                for (int i = 0; i < itemsElementNameField.Count; i++)
5976
                {
5977
                    if (itemsElementNameField[i] == type)
5978
                        list.Add(itemsField[i] as T);
5979
                }
5980
                return list;
5981
            }
5982
        }
5983
        private int SizeOfArray(ItemsChoiceTableRowType type)
5984
        {
5985
            lock (this)
5986
            {
5987
                int size = 0;
5988
                for (int i = 0; i < itemsElementNameField.Count; i++)
5989
                {
5990
                    if (itemsElementNameField[i] == type)
5991
                        size++;
5992
                }
5993
                return size;
5994
            }
5995
        }
5996
        private T GetObjectArray<T>(int p, ItemsChoiceTableRowType type) where T : class
5997
        {
5998
            lock (this)
5999
            {
6000
                int pos = GetObjectIndex(type, p);
6001
                if (pos < 0 || pos >= this.itemsField.Count)
6002
                    return null;
6003
                return itemsField[pos] as T;
6004
            }
6005
        }
6006
        private T InsertNewObject<T>(ItemsChoiceTableRowType type, int p) where T : class, new()
6007
        {
6008
            T t = new T();
6009
            lock (this)
6010
            {
6011
                int pos = GetObjectIndex(type, p);
6012
                this.itemsElementNameField.Insert(pos, type);
6013
                this.itemsField.Insert(pos, t);
6014
            }
6015
            return t;
6016
        }
6017
        private T AddNewObject<T>(ItemsChoiceTableRowType type) where T : class, new()
6018
        {
6019
            T t = new T();
6020
            lock (this)
6021
            {
6022
                this.itemsElementNameField.Add(type);
6023
                this.itemsField.Add(t);
6024
            }
6025
            return t;
6026
        }
6027
        private void SetObject<T>(ItemsChoiceTableRowType type, int p, T obj) where T : class
6028
        {
6029
            lock (this)
6030
            {
6031
                int pos = GetObjectIndex(type, p);
6032
                if (pos < 0 || pos >= this.itemsField.Count)
6033
                    return;
6034
                if (this.itemsField[pos] is T)
6035
                    this.itemsField[pos] = obj;
6036
                else
6037
                    throw new Exception(string.Format(@"object types are difference, itemsField[{0}] is {1}, and parameter obj is {2}",
6038
                        pos, this.itemsField[pos].GetType().Name, typeof(T).Name));
6039
            }
6040
        }
6041
        private int GetObjectIndex(ItemsChoiceTableRowType type, int p)
6042
        {
6043
            int index = -1;
6044
            int pos = 0;
6045
            for (int i = 0; i < itemsElementNameField.Count; i++)
6046
            {
6047
                if (itemsElementNameField[i] == type)
6048
                {
6049
                    if (pos == p)
6050
                    {
6051
                        index = i;
6052
                        break;
6053
                    }
6054
                    else
6055
                        pos++;
6056
                }
6057
            }
6058
            return index;
6059
        }
6060
        private void RemoveObject(ItemsChoiceTableRowType type, int p)
6061
        {
6062
            lock (this)
6063
            {
6064
                int pos = GetObjectIndex(type, p);
6065
                if (pos < 0 || pos >= this.itemsField.Count)
6066
                    return;
6067
                itemsElementNameField.RemoveAt(pos);
6068
                itemsField.RemoveAt(pos);
6069
            }
6070
        }
6071
        #endregion
6072
    }
6073

6074

6075
    [Serializable]
6076
    [XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IncludeInSchema = false)]
6077
    public enum ItemsChoiceTableRowType
6078
    {
6079

6080
    
6081
        [XmlEnum("http://schemas.openxmlformats.org/officeDocument/2006/math:oMath")]
6082
        oMath,
6083

6084
    
6085
        [XmlEnum("http://schemas.openxmlformats.org/officeDocument/2006/math:oMathPara")]
6086
        oMathPara,
6087

6088
    
6089
        bookmarkEnd,
6090

6091
    
6092
        bookmarkStart,
6093

6094
    
6095
        commentRangeEnd,
6096

6097
    
6098
        commentRangeStart,
6099

6100
    
6101
        customXml,
6102

6103
    
6104
        customXmlDelRangeEnd,
6105

6106
    
6107
        customXmlDelRangeStart,
6108

6109
    
6110
        customXmlInsRangeEnd,
6111

6112
    
6113
        customXmlInsRangeStart,
6114

6115
    
6116
        customXmlMoveFromRangeEnd,
6117

6118
    
6119
        customXmlMoveFromRangeStart,
6120

6121
    
6122
        customXmlMoveToRangeEnd,
6123

6124
    
6125
        customXmlMoveToRangeStart,
6126

6127
    
6128
        del,
6129

6130
    
6131
        ins,
6132

6133
    
6134
        moveFrom,
6135

6136
    
6137
        moveFromRangeEnd,
6138

6139
    
6140
        moveFromRangeStart,
6141

6142
    
6143
        moveTo,
6144

6145
    
6146
        moveToRangeEnd,
6147

6148
    
6149
        moveToRangeStart,
6150

6151
    
6152
        permEnd,
6153

6154
    
6155
        permStart,
6156

6157
    
6158
        proofErr,
6159

6160
    
6161
        sdt,
6162

6163
    
6164
        tc,
6165
    }
6166

6167
#endregion
6168
}
6169

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

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

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

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