Changeset 21 for trunk/IDE/UProject.pas
- Timestamp:
- Nov 9, 2010, 2:08:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IDE/UProject.pas
r10 r21 17 17 Name: string; 18 18 ProducedFileName: string; 19 Modified: Boolean; 19 20 procedure SaveToXMLNode(Node: TDOMNode); virtual; 20 21 procedure LoadFromXMLNode(Node: TDOMNode); virtual; … … 120 121 121 122 procedure TProjectGroup.SaveToXMLNode(Node: TDOMNode); 123 var 124 I: Integer; 125 NewNode: TDOMNode; 122 126 begin 123 127 inherited SaveToXMLNode(Node); 128 with Node do begin 129 NewNode := OwnerDocument.CreateElement('File'); 130 TDOMElement(NewNode).SetAttribute('Name', UTF8Decode(Name)); 131 TDOMElement(NewNode).SetAttribute('Type', 'File'); 132 AppendChild(NewNode); 133 end; 134 for I := 0 to Items.Count - 1 do begin 135 TProjectNode(Items[I]).SaveToXMLNode(NewNode); 136 end 124 137 end; 125 138 … … 160 173 begin 161 174 inherited SaveToXMLNode(Node); 175 Save; 162 176 end; 163 177 … … 199 213 procedure TProjectNode.Save; 200 214 begin 201 215 Modified := False; 202 216 end; 203 217 … … 260 274 261 275 procedure TProject.SaveToFile(FileName: string); 262 begin 263 276 var 277 Doc: TXMLDocument; 278 RootNode: TDOMNode; 279 NewNode: TDOMNode; 280 NewSubNode: TDOMNode; 281 I: Integer; 282 Text: string; 283 begin 284 Doc := TXMLDocument.Create; 285 with Doc do try 286 RootNode := CreateElement('Project'); 287 AppendChild(RootNode); 288 with RootNode do begin 289 NewNode := OwnerDocument.CreateElement('Files'); 290 SaveToXMLNode(NewNode); 291 end; 292 WriteXMLFile(Doc, UTF8Decode(FileName)); 293 finally 294 Free; 295 end; 296 inherited Save; 264 297 end; 265 298
Note:
See TracChangeset
for help on using the changeset viewer.