type Choice = class(OpenXmlElement) public function Create();overload; function Create(_node: XmlNode);overload; function Create(_parent: tslobj; _prefix: string; _local_name: string);overload; function Init();override; function Copy(_obj: Choice);override; public // attributes property property Requires read ReadXmlAttrRequires write WriteXmlAttrRequires; property XmlnsC14 read ReadXmlAttrXmlnsC14 write WriteXmlAttrXmlnsC14; function ReadXmlAttrRequires(); function WriteXmlAttrRequires(_value); function ReadXmlAttrXmlnsC14(); function WriteXmlAttrXmlnsC14(_value); // normal property property Style read ReadXmlChildStyle; property Drawing read ReadXmlChildDrawing; function ReadXmlChildStyle(); function ReadXmlChildDrawing(); public // Attributes XmlAttrRequires: OpenXmlAttribute; XmlAttrXmlnsC14: OpenXmlAttribute; // Children XmlChildStyle: PureVal; XmlChildDrawing: Drawing; end; function Choice.Create();overload; begin {self.}Create(nil, "mc", "Choice"); end; function Choice.Create(_node: XmlNode);overload; begin class(OpenXmlElement).Create(_node: XmlNode); end; function Choice.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; begin setsysparam(pn_calcctrlword(), getsysparam(pn_calcctrlword()) .| 0x200); class(OpenXmlElement).Create(_parent, _prefix, _local_name); end; function Choice.Init();override; begin pre := {self.}Prefix ? {self.}Prefix + ":" : ""; attributes_ := array(); attributes_pf_ := array( "Requires": makeweakref(thisFunction(WriteXmlAttrRequires)), "xmlns:c14": makeweakref(thisFunction(WriteXmlAttrXmlnsC14)), ); sorted_child_ := array( "c14:style": array(0, makeweakref(thisFunction(ReadXmlChildStyle))), "w:drawing": array(1, makeweakref(thisFunction(ReadXmlChildDrawing))), ); container_ := new TSOfficeContainer(sorted_child_); end; function Choice.Copy(_obj: Choice);override; begin tslassigning_backup := tslassigning; tslassigning := 1; class(OpenXmlElement).Copy(_obj); if not ifnil(_obj.Requires) then {self.}Requires := _obj.Requires; if not ifnil(_obj.XmlnsC14) then {self.}XmlnsC14 := _obj.XmlnsC14; if not ifnil(_obj.XmlChildStyle) then {self.}Style.Copy(_obj.XmlChildStyle); if not ifnil(_obj.XmlChildDrawing) then {self.}Drawing.Copy(_obj.XmlChildDrawing); tslassigning := tslassigning_backup; end; function Choice.ReadXmlAttrRequires(); begin return {self.}XmlAttrRequires.Value; end; function Choice.WriteXmlAttrRequires(_value); begin if ifnil({self.}XmlAttrRequires) then begin {self.}XmlAttrRequires := new OpenXmlAttribute("", "Requires", nil); attributes_[length(attributes_)] := {self.}XmlAttrRequires; end {self.}XmlAttrRequires.Value := _value; end; function Choice.ReadXmlAttrXmlnsC14(); begin return {self.}XmlAttrXmlnsC14.Value; end; function Choice.WriteXmlAttrXmlnsC14(_value); begin if ifnil({self.}XmlAttrXmlnsC14) then begin {self.}XmlAttrXmlnsC14 := new OpenXmlAttribute("xmlns", "c14", nil); attributes_[length(attributes_)] := {self.}XmlAttrXmlnsC14; end {self.}XmlAttrXmlnsC14.Value := _value; end; function Choice.ReadXmlChildStyle(); begin if tslassigning and ifnil({self.}XmlChildStyle) then begin {self.}XmlChildStyle := new PureVal(self, "c14", "style"); container_.Set({self.}XmlChildStyle); end return {self.}XmlChildStyle; end; function Choice.ReadXmlChildDrawing(); begin if tslassigning and ifnil({self.}XmlChildDrawing) then begin {self.}XmlChildDrawing := new Drawing(self, "w", "drawing"); container_.Set({self.}XmlChildDrawing); end return {self.}XmlChildDrawing; end;