Changeset 21 for trunk/IDE/UProject.pas


Ignore:
Timestamp:
Nov 9, 2010, 2:08:55 PM (14 years ago)
Author:
george
Message:
  • Modified: Project saving.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IDE/UProject.pas

    r10 r21  
    1717    Name: string;
    1818    ProducedFileName: string;
     19    Modified: Boolean;
    1920    procedure SaveToXMLNode(Node: TDOMNode); virtual;
    2021    procedure LoadFromXMLNode(Node: TDOMNode); virtual;
     
    120121
    121122procedure TProjectGroup.SaveToXMLNode(Node: TDOMNode);
     123var
     124  I: Integer;
     125  NewNode: TDOMNode;
    122126begin
    123127  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
    124137end;
    125138
     
    160173begin
    161174  inherited SaveToXMLNode(Node);
     175  Save;
    162176end;
    163177
     
    199213procedure TProjectNode.Save;
    200214begin
    201 
     215  Modified := False;
    202216end;
    203217
     
    260274
    261275procedure TProject.SaveToFile(FileName: string);
    262 begin
    263 
     276var
     277  Doc: TXMLDocument;
     278  RootNode: TDOMNode;
     279  NewNode: TDOMNode;
     280  NewSubNode: TDOMNode;
     281  I: Integer;
     282  Text: string;
     283begin
     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;
    264297end;
    265298
Note: See TracChangeset for help on using the changeset viewer.