npoi
1094 строки · 32.1 Кб
1using NPOI.OpenXml4Net.Util;
2using System;
3using System.Collections.Generic;
4using System.IO;
5using System.Xml;
6using System.Xml.Serialization;
7
8namespace NPOI.OpenXmlFormats.Wordprocessing
9{
10
11[Serializable]
12[XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
13[XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
14public class CT_FFTextType
15{
16
17private ST_FFTextType valField;
18
19[XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
20public ST_FFTextType val
21{
22get
23{
24return this.valField;
25}
26set
27{
28this.valField = value;
29}
30}
31
32public static CT_FFTextType Parse(XmlNode node, XmlNamespaceManager namespaceManager)
33{
34if (node == null)
35return null;
36CT_FFTextType ctObj = new CT_FFTextType();
37ctObj.valField = (ST_FFTextType)Enum.Parse(typeof(ST_FFTextType), XmlHelper.ReadString(node.Attributes["w:val"]));
38return ctObj;
39}
40
41internal void Write(StreamWriter sw, string nodeName)
42{
43sw.Write(string.Format("<w:{0}", nodeName));
44XmlHelper.WriteAttribute(sw, "w:val", this.valField.ToString());
45sw.Write("/>");
46}
47}
48
49
50[Serializable]
51[XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
52public enum ST_FFTextType
53{
54
55
56regular,
57
58
59number,
60
61
62date,
63
64
65currentTime,
66
67
68currentDate,
69
70
71calculated,
72}
73
74
75[Serializable]
76
77[XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
78[XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
79public class CT_FFName
80{
81
82private string valField;
83
84[XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
85public string val
86{
87get
88{
89return this.valField;
90}
91set
92{
93this.valField = value;
94}
95}
96
97public static CT_FFName Parse(XmlNode node, XmlNamespaceManager namespaceManager)
98{
99if (node == null)
100return null;
101CT_FFName ctObj = new CT_FFName();
102ctObj.val = XmlHelper.ReadString(node.Attributes["w:val"]);
103return ctObj;
104}
105
106
107
108internal void Write(StreamWriter sw, string nodeName)
109{
110sw.Write(string.Format("<w:{0}", nodeName));
111XmlHelper.WriteAttribute(sw, "w:val", this.val, true);
112sw.Write("/>");
113}
114}
115
116
117[Serializable]
118
119[XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
120[XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
121public class CT_FldChar
122{
123private ST_FldCharType fldCharTypeField;
124
125private ST_OnOff fldLockField;
126
127private bool fldLockFieldSpecified;
128
129private ST_OnOff dirtyField;
130
131private bool dirtyFieldSpecified;
132
133private CT_FFData ffDataField;
134public CT_FFData ffData
135{
136get { return this.ffDataField; }
137set { this.ffDataField = value; }
138}
139private CT_Text fldDataField;
140public CT_Text fldData
141{
142get { return this.fldDataField; }
143set { this.fldDataField = value; }
144}
145private CT_TrackChangeNumbering numberingChangeField;
146public CT_TrackChangeNumbering numberingChange
147{
148get { return this.numberingChangeField; }
149set { this.numberingChangeField = value; }
150}
151public static CT_FldChar Parse(XmlNode node, XmlNamespaceManager namespaceManager)
152{
153if (node == null)
154return null;
155CT_FldChar ctObj = new CT_FldChar();
156if (node.Attributes["w:fldCharType"] != null)
157ctObj.fldCharType = (ST_FldCharType)Enum.Parse(typeof(ST_FldCharType), node.Attributes["w:fldCharType"].Value);
158if (node.Attributes["w:fldLock"] != null)
159ctObj.fldLock = (ST_OnOff)Enum.Parse(typeof(ST_OnOff), node.Attributes["w:fldLock"].Value,true);
160if (node.Attributes["w:dirty"] != null)
161ctObj.dirty = (ST_OnOff)Enum.Parse(typeof(ST_OnOff), node.Attributes["w:dirty"].Value,true);
162foreach (XmlNode childNode in node.ChildNodes)
163{
164if (childNode.LocalName == "ffData")
165{
166ctObj.ffDataField = CT_FFData.Parse(childNode, namespaceManager);
167}
168else if (childNode.LocalName == "fldData")
169{
170ctObj.fldDataField = CT_Text.Parse(childNode, namespaceManager);
171}
172else if (childNode.LocalName == "numberingChange")
173{
174ctObj.numberingChangeField = CT_TrackChangeNumbering.Parse(childNode, namespaceManager);
175}
176}
177return ctObj;
178}
179
180
181
182internal void Write(StreamWriter sw, string nodeName)
183{
184sw.Write(string.Format("<w:{0}", nodeName));
185XmlHelper.WriteAttribute(sw, "w:fldCharType", this.fldCharType.ToString());
186if(this.fldLock!= ST_OnOff.off)
187XmlHelper.WriteAttribute(sw, "w:fldLock", this.fldLock.ToString());
188if (this.dirty != ST_OnOff.off)
189XmlHelper.WriteAttribute(sw, "w:dirty", this.dirty.ToString());
190if (this.ffDataField == null && this.fldDataField == null && this.numberingChangeField == null)
191{
192sw.Write(string.Format("/>", nodeName));
193}
194else
195{
196sw.Write(">");
197if (this.ffDataField != null)
198{
199this.ffDataField.Write(sw, "ffData");
200}
201if (this.fldDataField != null)
202{
203this.fldDataField.Write(sw, "fldData");
204}
205if (this.numberingChangeField != null)
206{
207this.numberingChangeField.Write(sw, "numberingChange");
208}
209sw.WriteEndW(nodeName);
210}
211}
212
213[XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
214public ST_FldCharType fldCharType
215{
216get
217{
218return this.fldCharTypeField;
219}
220set
221{
222this.fldCharTypeField = value;
223}
224}
225
226[XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
227public ST_OnOff fldLock
228{
229get
230{
231return this.fldLockField;
232}
233set
234{
235this.fldLockField = value;
236}
237}
238
239[XmlIgnore]
240public bool fldLockSpecified
241{
242get
243{
244return this.fldLockFieldSpecified;
245}
246set
247{
248this.fldLockFieldSpecified = value;
249}
250}
251
252[XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
253public ST_OnOff dirty
254{
255get
256{
257return this.dirtyField;
258}
259set
260{
261this.dirtyField = value;
262}
263}
264
265[XmlIgnore]
266public bool dirtySpecified
267{
268get
269{
270return this.dirtyFieldSpecified;
271}
272set
273{
274this.dirtyFieldSpecified = value;
275}
276}
277}
278
279
280[Serializable]
281
282[XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
283[XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
284public class CT_FFData
285{
286
287private List<object> itemsField;
288
289private List<FFDataItemsType> itemsElementNameField;
290
291public CT_FFData()
292{
293this.itemsElementNameField = new List<FFDataItemsType>();
294this.itemsField = new List<object>();
295}
296
297[XmlElement("calcOnExit", typeof(CT_OnOff), Order = 0)]
298[XmlElement("checkBox", typeof(CT_FFCheckBox), Order = 0)]
299[XmlElement("ddList", typeof(CT_FFDDList), Order = 0)]
300[XmlElement("enabled", typeof(CT_OnOff), Order = 0)]
301[XmlElement("entryMacro", typeof(CT_MacroName), Order = 0)]
302[XmlElement("exitMacro", typeof(CT_MacroName), Order = 0)]
303[XmlElement("helpText", typeof(CT_FFHelpText), Order = 0)]
304[XmlElement("name", typeof(CT_FFName), Order = 0)]
305[XmlElement("statusText", typeof(CT_FFStatusText), Order = 0)]
306[XmlElement("textInput", typeof(CT_FFTextInput), Order = 0)]
307[XmlChoiceIdentifier("ItemsElementName")]
308public object[] Items
309{
310get
311{
312return this.itemsField.ToArray();
313}
314set
315{
316this.itemsField.Clear();
317this.itemsField.AddRange(value);
318}
319}
320
321[XmlElement("ItemsElementName", Order = 1)]
322[XmlIgnore]
323public FFDataItemsType[] ItemsElementName
324{
325get
326{
327return this.itemsElementNameField.ToArray();
328}
329set
330{
331this.itemsElementNameField.Clear();
332this.itemsElementNameField.AddRange(value);
333}
334}
335
336internal static CT_FFData Parse(XmlNode node, XmlNamespaceManager namespaceManager)
337{
338if (node == null)
339return null;
340CT_FFData ctObj = new CT_FFData();
341
342foreach (XmlNode childNode in node.ChildNodes)
343{
344if (childNode.LocalName == "name")
345{
346ctObj.AddNewObject(CT_FFName.Parse(childNode, namespaceManager) ,FFDataItemsType.name);
347}
348//else if (childNode.LocalName == "tabIndex")
349//{
350
351//}
352else if (childNode.LocalName == "enabled")
353{
354ctObj.AddNewObject(CT_OnOff.Parse(childNode, namespaceManager), FFDataItemsType.enabled);
355}
356else if (childNode.LocalName == "calcOnExit")
357{
358ctObj.AddNewObject(CT_OnOff.Parse(childNode, namespaceManager), FFDataItemsType.calcOnExit);
359}
360else if (childNode.LocalName == "checkBox")
361{
362ctObj.AddNewObject(CT_FFCheckBox.Parse(childNode, namespaceManager), FFDataItemsType.checkBox);
363}
364else if (childNode.LocalName == "ddList")
365{
366ctObj.AddNewObject(CT_FFDDList.Parse(childNode, namespaceManager), FFDataItemsType.ddList);
367}
368else if (childNode.LocalName == "entryMacro")
369{
370ctObj.AddNewObject(CT_MacroName.Parse(childNode, namespaceManager), FFDataItemsType.entryMacro);
371}
372else if (childNode.LocalName == "exitMacro")
373{
374ctObj.AddNewObject(CT_MacroName.Parse(childNode, namespaceManager), FFDataItemsType.exitMacro);
375}
376else if (childNode.LocalName == "helpText")
377{
378ctObj.AddNewObject(CT_FFHelpText.Parse(childNode, namespaceManager), FFDataItemsType.helpText);
379}
380else if (childNode.LocalName == "statusText")
381{
382ctObj.AddNewObject(CT_FFStatusText.Parse(childNode, namespaceManager), FFDataItemsType.statusText);
383}
384else if (childNode.LocalName == "textInput")
385{
386ctObj.AddNewObject(CT_FFTextInput.Parse(childNode, namespaceManager), FFDataItemsType.textInput);
387}
388}
389return ctObj;
390}
391internal void Write(StreamWriter sw, string nodeName)
392{
393sw.Write(string.Format("<w:{0}>", nodeName));
394
395for (int i=0;i<this.itemsElementNameField.Count;i++)
396{
397if (this.itemsElementNameField[i] == FFDataItemsType.name)
398(this.itemsField[i] as CT_FFName).Write(sw, "name");
399else if (this.itemsElementNameField[i] == FFDataItemsType.enabled)
400(this.itemsField[i] as CT_OnOff).Write(sw, "enabled");
401else if (this.itemsElementNameField[i] == FFDataItemsType.calcOnExit)
402(this.itemsField[i] as CT_OnOff).Write(sw, "calcOnExit");
403else if (this.itemsElementNameField[i] == FFDataItemsType.ddList)
404(this.itemsField[i] as CT_FFDDList).Write(sw, "ddList");
405else if (this.itemsElementNameField[i] == FFDataItemsType.checkBox)
406(this.itemsField[i] as CT_FFCheckBox).Write(sw, "checkBox");
407else if (this.itemsElementNameField[i] == FFDataItemsType.entryMacro)
408(this.itemsField[i] as CT_MacroName).Write(sw, "entryMacro");
409else if (this.itemsElementNameField[i] == FFDataItemsType.exitMacro)
410(this.itemsField[i] as CT_MacroName).Write(sw, "exitMacro");
411else if (this.itemsElementNameField[i] == FFDataItemsType.helpText)
412(this.itemsField[i] as CT_FFHelpText).Write(sw, "helpText");
413else if (this.itemsElementNameField[i] == FFDataItemsType.statusText)
414(this.itemsField[i] as CT_FFStatusText).Write(sw, "statusText");
415else if (this.itemsElementNameField[i] == FFDataItemsType.textInput)
416(this.itemsField[i] as CT_FFTextInput).Write(sw, "textInput");
417}
418
419sw.WriteEndW(nodeName);
420}
421private void AddNewObject(object obj, FFDataItemsType type)
422{
423lock(this)
424{
425this.itemsElementNameField.Add(type);
426this.itemsField.Add(obj);
427}
428}
429
430#region Generic methods for object operation
431
432private List<T> GetObjectList<T>(FFDataItemsType type) where T : class
433{
434lock (this)
435{
436List<T> list = new List<T>();
437for (int i = 0; i < itemsElementNameField.Count; i++)
438{
439if (itemsElementNameField[i] == type)
440list.Add(itemsField[i] as T);
441}
442return list;
443}
444}
445private int SizeOfObjectArray(FFDataItemsType type)
446{
447lock (this)
448{
449int size = 0;
450for (int i = 0; i < itemsElementNameField.Count; i++)
451{
452if (itemsElementNameField[i] == type)
453size++;
454}
455return size;
456}
457}
458private T GetObjectArray<T>(int p, FFDataItemsType type) where T : class
459{
460lock (this)
461{
462int pos = GetObjectIndex(type, p);
463if (pos < 0 || pos >= this.itemsField.Count)
464return null;
465return itemsField[pos] as T;
466}
467}
468private T InsertNewObject<T>(FFDataItemsType type, int p) where T : class, new()
469{
470T t = new T();
471lock (this)
472{
473int pos = GetObjectIndex(type, p);
474this.itemsElementNameField.Insert(pos, type);
475this.itemsField.Insert(pos, t);
476}
477return t;
478}
479private T AddNewObject<T>(FFDataItemsType type) where T : class, new()
480{
481T t = new T();
482lock (this)
483{
484this.itemsElementNameField.Add(type);
485this.itemsField.Add(t);
486}
487return t;
488}
489private void SetObjectArray<T>(FFDataItemsType type, int p, T obj) where T : class
490{
491lock (this)
492{
493int pos = GetObjectIndex(type, p);
494if (pos < 0 || pos >= this.itemsField.Count)
495return;
496if (this.itemsField[pos] is T)
497this.itemsField[pos] = obj;
498else
499throw new Exception(string.Format(@"object types are difference, itemsField[{0}] is {1}, and parameter obj is {2}",
500pos, this.itemsField[pos].GetType().Name, typeof(T).Name));
501}
502}
503private int GetObjectIndex(FFDataItemsType type, int p)
504{
505int index = -1;
506int pos = 0;
507for (int i = 0; i < itemsElementNameField.Count; i++)
508{
509if (itemsElementNameField[i] == type)
510{
511if (pos == p)
512{
513//return itemsField[p] as T;
514index = i;
515break;
516}
517else
518pos++;
519}
520}
521return index;
522}
523private void RemoveObject(FFDataItemsType type, int p)
524{
525lock (this)
526{
527int pos = GetObjectIndex(type, p);
528if (pos < 0 || pos >= this.itemsField.Count)
529return;
530itemsElementNameField.RemoveAt(pos);
531itemsField.RemoveAt(pos);
532}
533}
534#endregion
535
536public List<CT_FFCheckBox> GetCheckBoxList()
537{
538return GetObjectList<CT_FFCheckBox>(FFDataItemsType.checkBox);
539}
540}
541
542
543[Serializable]
544
545[XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
546[XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
547public class CT_FFCheckBox
548{
549
550private object itemField;
551
552private CT_OnOff defaultField;
553
554private CT_OnOff checkedField;
555
556public CT_FFCheckBox()
557{
558this.checkedField = new CT_OnOff();
559this.defaultField = new CT_OnOff();
560}
561
562[XmlElement("size", typeof(CT_HpsMeasure), Order = 0)]
563[XmlElement("sizeAuto", typeof(CT_OnOff), Order = 0)]
564public object Item
565{
566get
567{
568return this.itemField;
569}
570set
571{
572this.itemField = value;
573}
574}
575
576[XmlElement(Order = 1)]
577public CT_OnOff @default
578{
579get
580{
581return this.defaultField;
582}
583set
584{
585this.defaultField = value;
586}
587}
588
589[XmlElement(Order = 2)]
590public CT_OnOff @checked
591{
592get
593{
594return this.checkedField;
595}
596set
597{
598this.checkedField = value;
599}
600}
601
602public static CT_FFCheckBox Parse(XmlNode node, XmlNamespaceManager namespaceManager)
603{
604if (node == null)
605return null;
606CT_FFCheckBox ctObj = new CT_FFCheckBox();
607foreach (XmlNode childNode in node.ChildNodes)
608{
609if (childNode.LocalName == "checked")
610{
611ctObj.checkedField = CT_OnOff.Parse(childNode, namespaceManager);
612}
613else if (childNode.LocalName == "default")
614{
615ctObj.defaultField = CT_OnOff.Parse(childNode, namespaceManager);
616}
617else if (childNode.LocalName == "size")
618{
619ctObj.itemField = CT_HpsMeasure.Parse(childNode, namespaceManager);
620}
621else if (childNode.LocalName == "sizeAuto")
622{
623ctObj.itemField = CT_OnOff.Parse(childNode, namespaceManager);
624}
625}
626return ctObj;
627}
628
629
630
631internal void Write(StreamWriter sw, string nodeName)
632{
633sw.Write(string.Format("<w:{0}>", nodeName));
634if (this.defaultField != null)
635this.defaultField.Write(sw, "default");
636if (this.checkedField != null)
637this.checkedField.Write(sw, "checked");
638if (this.itemField != null)
639{
640if (this.itemField is CT_OnOff)
641(this.itemField as CT_OnOff).Write(sw, "sizeAuto");
642else
643(this.itemField as CT_HpsMeasure).Write(sw, "size");
644}
645sw.WriteEndW(nodeName);
646}
647}
648
649
650[Serializable]
651
652[XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
653[XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
654public class CT_FFDDList
655{
656
657private CT_DecimalNumber resultField;
658
659private CT_DecimalNumber defaultField;
660
661private List<CT_String> listEntryField;
662
663public CT_FFDDList()
664{
665this.listEntryField = new List<CT_String>();
666this.defaultField = new CT_DecimalNumber();
667this.resultField = new CT_DecimalNumber();
668}
669
670[XmlElement(Order = 0)]
671public CT_DecimalNumber result
672{
673get
674{
675return this.resultField;
676}
677set
678{
679this.resultField = value;
680}
681}
682
683[XmlElement(Order = 1)]
684public CT_DecimalNumber @default
685{
686get
687{
688return this.defaultField;
689}
690set
691{
692this.defaultField = value;
693}
694}
695
696[XmlElement("listEntry", Order = 2)]
697public List<CT_String> listEntry
698{
699get
700{
701return this.listEntryField;
702}
703set
704{
705this.listEntryField = value;
706}
707}
708
709public static CT_FFDDList Parse(XmlNode node, XmlNamespaceManager namespaceManager)
710{
711if (node == null)
712return null;
713CT_FFDDList ctObj = new CT_FFDDList();
714foreach (XmlNode childNode in node.ChildNodes)
715{
716if (childNode.LocalName == "result")
717{
718ctObj.resultField = CT_DecimalNumber.Parse(childNode, namespaceManager);
719}
720else if (childNode.LocalName == "default")
721{
722ctObj.defaultField = CT_DecimalNumber.Parse(childNode, namespaceManager);
723}
724else if (childNode.LocalName == "listEntry")
725{
726ctObj.listEntryField.Add(CT_String.Parse(childNode, namespaceManager));
727}
728}
729return ctObj;
730}
731
732
733
734internal void Write(StreamWriter sw, string nodeName)
735{
736sw.Write(string.Format("<w:{0}>", nodeName));
737if (this.defaultField != null)
738this.defaultField.Write(sw, "default");
739if (this.resultField != null)
740this.resultField.Write(sw, "result");
741foreach (CT_String str in listEntry)
742{
743str.Write(sw, "listEntry");
744}
745sw.WriteEndW(nodeName);
746}
747}
748
749
750[Serializable]
751
752[XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
753[XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
754public class CT_FFHelpText
755{
756
757private ST_InfoTextType typeField;
758
759private bool typeFieldSpecified;
760
761private string valField;
762
763[XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
764public ST_InfoTextType type
765{
766get
767{
768return this.typeField;
769}
770set
771{
772this.typeField = value;
773}
774}
775
776[XmlIgnore]
777public bool typeSpecified
778{
779get
780{
781return this.typeFieldSpecified;
782}
783set
784{
785this.typeFieldSpecified = value;
786}
787}
788
789[XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
790public string val
791{
792get
793{
794return this.valField;
795}
796set
797{
798this.valField = value;
799}
800}
801
802public static CT_FFHelpText Parse(XmlNode node, XmlNamespaceManager namespaceManager)
803{
804if (node == null)
805return null;
806CT_FFHelpText ctObj = new CT_FFHelpText();
807if (node.Attributes["w:type"] != null)
808{
809ctObj.typeFieldSpecified = true;
810ctObj.typeField = (ST_InfoTextType)Enum.Parse(typeof(ST_InfoTextType), node.Attributes["w:type"].Value);
811}
812ctObj.valField = XmlHelper.ReadString(node.Attributes["w:val"]);
813return ctObj;
814}
815
816internal void Write(StreamWriter sw, string nodeName)
817{
818sw.Write(string.Format("<w:{0}", nodeName));
819XmlHelper.WriteAttribute(sw, "w:val", this.valField);
820if (this.typeFieldSpecified)
821{
822XmlHelper.WriteAttribute(sw, "w:type", this.typeField.ToString());
823}
824sw.Write("/>");
825}
826}
827
828
829[Serializable]
830[XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
831public enum ST_InfoTextType
832{
833
834
835text,
836
837
838autoText,
839}
840
841
842[Serializable]
843
844[XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
845[XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
846public class CT_FFStatusText
847{
848
849private ST_InfoTextType typeField;
850
851private bool typeFieldSpecified;
852
853private string valField;
854
855[XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
856public ST_InfoTextType type
857{
858get
859{
860return this.typeField;
861}
862set
863{
864this.typeField = value;
865}
866}
867
868[XmlIgnore]
869public bool typeSpecified
870{
871get
872{
873return this.typeFieldSpecified;
874}
875set
876{
877this.typeFieldSpecified = value;
878}
879}
880
881[XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
882public string val
883{
884get
885{
886return this.valField;
887}
888set
889{
890this.valField = value;
891}
892}
893
894public static CT_FFStatusText Parse(XmlNode node, XmlNamespaceManager namespaceManager)
895{
896if (node == null)
897return null;
898CT_FFStatusText ctObj = new CT_FFStatusText();
899if (node.Attributes["w:type"] != null)
900{
901ctObj.typeFieldSpecified = true;
902ctObj.typeField = (ST_InfoTextType)Enum.Parse(typeof(ST_InfoTextType), node.Attributes["w:type"].Value);
903}
904ctObj.valField = XmlHelper.ReadString(node.Attributes["w:val"]);
905return ctObj;
906}
907
908internal void Write(StreamWriter sw, string nodeName)
909{
910sw.Write(string.Format("<w:{0}", nodeName));
911XmlHelper.WriteAttribute(sw, "w:val", this.valField);
912if (this.typeFieldSpecified)
913{
914XmlHelper.WriteAttribute(sw, "w:type", this.typeField.ToString());
915}
916sw.Write("/>");
917}
918}
919
920
921[Serializable]
922
923[XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
924[XmlRoot(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IsNullable = true)]
925public class CT_FFTextInput
926{
927
928private CT_FFTextType typeField;
929
930private CT_String defaultField;
931
932private CT_DecimalNumber maxLengthField;
933
934private CT_String formatField;
935
936public CT_FFTextInput()
937{
938this.formatField = new CT_String();
939this.maxLengthField = new CT_DecimalNumber();
940this.defaultField = new CT_String();
941this.typeField = new CT_FFTextType();
942}
943
944[XmlElement(Order = 0)]
945public CT_FFTextType type
946{
947get
948{
949return this.typeField;
950}
951set
952{
953this.typeField = value;
954}
955}
956
957[XmlElement(Order = 1)]
958public CT_String @default
959{
960get
961{
962return this.defaultField;
963}
964set
965{
966this.defaultField = value;
967}
968}
969
970[XmlElement(Order = 2)]
971public CT_DecimalNumber maxLength
972{
973get
974{
975return this.maxLengthField;
976}
977set
978{
979this.maxLengthField = value;
980}
981}
982
983[XmlElement(Order = 3)]
984public CT_String format
985{
986get
987{
988return this.formatField;
989}
990set
991{
992this.formatField = value;
993}
994}
995
996public static CT_FFTextInput Parse(XmlNode node, XmlNamespaceManager namespaceManager)
997{
998if (node == null)
999return null;
1000CT_FFTextInput ctObj = new CT_FFTextInput();
1001foreach (XmlNode childNode in node.ChildNodes)
1002{
1003if (childNode.LocalName == "type")
1004{
1005ctObj.typeField = CT_FFTextType.Parse(childNode, namespaceManager);
1006}
1007else if (childNode.LocalName == "default")
1008{
1009ctObj.defaultField = CT_String.Parse(childNode, namespaceManager);
1010}
1011else if (childNode.LocalName == "format")
1012{
1013ctObj.formatField = CT_String.Parse(childNode, namespaceManager);
1014}
1015else if (childNode.LocalName == "maxLength")
1016{
1017ctObj.maxLengthField = CT_DecimalNumber.Parse(childNode, namespaceManager);
1018}
1019}
1020return ctObj;
1021}
1022
1023
1024
1025internal void Write(StreamWriter sw, string nodeName)
1026{
1027sw.Write(string.Format("<w:{0}>", nodeName));
1028if (this.typeField == null)
1029this.typeField.Write(sw, "type");
1030if (this.defaultField != null)
1031this.defaultField.Write(sw, "default");
1032if (this.formatField != null)
1033this.formatField.Write(sw, "format");
1034if (this.maxLengthField != null)
1035this.maxLengthField.Write(sw, "maxLength");
1036
1037sw.WriteEndW(nodeName);
1038}
1039}
1040
1041
1042[Serializable]
1043[XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", IncludeInSchema = false)]
1044public enum FFDataItemsType
1045{
1046
1047
1048calcOnExit,
1049
1050
1051checkBox,
1052
1053
1054ddList,
1055
1056
1057enabled,
1058
1059
1060entryMacro,
1061
1062
1063exitMacro,
1064
1065
1066helpText,
1067
1068
1069name,
1070
1071
1072statusText,
1073
1074
1075textInput,
1076}
1077
1078
1079[Serializable]
1080[XmlType(Namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main")]
1081public enum ST_FldCharType
1082{
1083
1084
1085begin,
1086
1087
1088separate,
1089
1090
1091end,
1092}
1093
1094}
1095