type GradFill = 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 InitAttributes();override; function InitChildren();override; function InitNode(_node: XmlNode);override; function Copy(_obj: GradFill);override; property RotWithShape read ReadXmlAttrRotWithShape write WriteXmlAttrRotWithShape; function ReadXmlAttrRotWithShape(); function WriteXmlAttrRotWithShape(_value); public // Attributes XmlAttrRotWithShape: OpenXmlAttribute; // Children GsLst: GsLst; Lin: Lin; end; function GradFill.Create();overload; begin self.Create(nil, "a", "gradFill"); end; function GradFill.Create(_node: XmlNode);overload; begin class(OpenXmlElement).Create(_node: XmlNode); end; function GradFill.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; begin class(OpenXmlElement).Create(_parent, _prefix, _local_name); end; function GradFill.Init();override; begin self.XmlAttrRotWithShape := new OpenXmlAttribute(nil, "rotWithShape", nil); self.GsLst := new GsLst(self, self.Prefix, "gsLst"); self.Lin := new Lin(self, self.Prefix, "lin"); end; function GradFill.InitAttributes();override; begin attributes_ := array( self.XmlAttrRotWithShape, ); end; function GradFill.InitChildren();override; begin child_elements_ := array( 0: self.GsLst, 1: self.Lin, ); sorted_child_ := array( "": -1, self.GsLst.ElementName: 0, self.Lin.ElementName: 1, ); end; function GradFill.InitNode(_node: XmlNode);override; begin if ifObj(self.XmlNode) then for k,v in child_elements_ do v.InitNode(nil); self.XmlNode := ifObj(_node) ? _node : nil; node := ifObj(_node) ? _node.FirstChild() : nil; flag := false; if ifnil(child_elements_[0]) and length(child_elements_) > 0 then begin flag := true; arr := child_elements_; child_elements_ := array(); end pre := ifString(self.Prefix) ? self.Prefix + ":" : ""; while ifObj(node) do begin node_name := node.GetName(); pos := sorted_child_[node_name]; if ifnil(pos) or pos = -1 then begin obj := nil; case node_name of end; if ifObj(obj) then obj.InitNode(node); end else if flag then begin obj := arr[pos]; obj.InitNode(node); child_elements_[length(child_elements_)] := obj; end else begin child_elements_[pos].InitNode(node); end node := node.NextElement(); end end; function GradFill.Copy(_obj: GradFill);override; begin if not ifnil(_obj.XmlAttrRotWithShape.Value) then self.XmlAttrRotWithShape.Value := _obj.XmlAttrRotWithShape.Value; self.GsLst.Copy(_obj.GsLst); self.Lin.Copy(_obj.Lin); end; function GradFill.ReadXmlAttrRotWithShape(); begin return self.XmlAttrRotWithShape.Value; end; function GradFill.WriteXmlAttrRotWithShape(_value); begin self.XmlAttrRotWithShape.Value := _value; end;