Hallo,
ich versuche gerade folgende procedure nach C# zu übersetzen. Kann ich in C# Methoden schachteln?:
Delphi-Quellcode:
procedure TData.fillAssignmentsTree(tree : THTMLTreeview; inVal : integer);
function FindParent(inParent : integer) : TTreenode;
var
searchNode : TTreenode;
begin
result :=
nil;
if tree.Items.Count = 0
then Exit;
searchNode := tree.Items[0];
while searchNode <>
nil do
begin
if integer(searchNode.Data) = inParent
then
begin
result := searchNode;
Break;
end;
searchNode := searchNode.GetNext;
end;
end;
var
tmpstr :
string;
tmpNode,node: TTreeNode;
begin
tree.Items.Clear;
with helperQuery
do
begin
if Active
then Close;
SQL.Clear;
SQL.Add('
SELECT art.name, art.number, art.category_id, ass.* FROM ' + prefix + '
assignments AS ass');
SQL.Add('
JOIN ' + prefix + '
articles AS art on art.id=ass.article_id ');
SQL.Add('
WHERE ass.machine_id=:mid ORDER BY ass.level ASC, ass.position ASC;');
ParamByName('
mid').AsInteger := inVal;
Open;
tree.BeginUpdate;
while not eof
do
begin
tmpNode := FindParent(FieldByName('
parent').AsInteger);
....
tree.EndUpdate;
end;
end;
Vielen Dank ...