type XY = 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: XY);override; public // attributes property property X read ReadXmlAttrX write WriteXmlAttrX; property Y read ReadXmlAttrY write WriteXmlAttrY; function ReadXmlAttrX(); function WriteXmlAttrX(_value); function ReadXmlAttrY(); function WriteXmlAttrY(_value); public // Attributes XmlAttrX: OpenXmlAttribute; XmlAttrY: OpenXmlAttribute; end; function XY.Create();overload; begin {self.}Create(nil, "", ""); end; function XY.Create(_node: XmlNode);overload; begin class(OpenXmlElement).Create(_node: XmlNode); end; function XY.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 XY.Init();override; begin pre := {self.}Prefix ? {self.}Prefix + ":" : ""; attributes_ := array(); attributes_pf_ := array( "x": makeweakref(thisFunction(WriteXmlAttrX)), "y": makeweakref(thisFunction(WriteXmlAttrY)), ); sorted_child_ := array( ); container_ := new TSOfficeContainer(sorted_child_); end; function XY.Copy(_obj: XY);override; begin tslassigning_backup := tslassigning; tslassigning := 1; class(OpenXmlElement).Copy(_obj); if not ifnil(_obj.X) then {self.}X := _obj.X; if not ifnil(_obj.Y) then {self.}Y := _obj.Y; tslassigning := tslassigning_backup; end; function XY.ReadXmlAttrX(); begin return {self.}XmlAttrX.Value; end; function XY.WriteXmlAttrX(_value); begin if ifnil({self.}XmlAttrX) then begin {self.}XmlAttrX := new OpenXmlAttribute("", "x", nil); attributes_[length(attributes_)] := {self.}XmlAttrX; end {self.}XmlAttrX.Value := _value; end; function XY.ReadXmlAttrY(); begin return {self.}XmlAttrY.Value; end; function XY.WriteXmlAttrY(_value); begin if ifnil({self.}XmlAttrY) then begin {self.}XmlAttrY := new OpenXmlAttribute("", "y", nil); attributes_[length(attributes_)] := {self.}XmlAttrY; end {self.}XmlAttrY.Value := _value; end;