Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function TMetroApplicationParams.LoadFromXML(const AXML: String): Boolean;
- var
- d: ixmldomdocument;
- procedure _load_values(AName: String; AValues: TFastKeyValues);
- var
- x: ixmldomnode;
- begin
- x := d.documentElement.selectSingleNode(AName);
- if assigned(x) then begin
- if not assigned(AValues) then
- AValues := TFastKeyValues.Create;
- x := x.firstChild;
- while x <> nil do begin
- AValues.AddValue(x.nodeName, x.text);
- x := x.nextSibling;
- end;
- end;
- end;
- begin
- Result := False;
- d := codomdocument.create;
- try
- if d.loadxml(AXML) then begin
- if d.documentElement = nil then
- Exit;
- _load_values('colorscheme', FColorscheme);
- _load_values('properties', FProperties);
- _load_values('behaviour', FBehaviour);
- _load_values('data', FData);
- Result := True;
- end;
- finally
- d := nil;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement