procedure TForm1.ShowCategoryTree;
var
i,a,c,sc : integer;
Cat : TdOPCEventitem;
Condition : TdOPCEventitem;
beginif dOPCEventServer1.SelectServer thenbegin
Memo1.Clear;
dOPCEventServer1.Active := true;
for i := 0 to dOPCEventServer1.Categories.Count-1 do//for all Categoriesbegin
Cat := dOPCEventServer1.Categories[i]; //get Category
Memo1.Lines.Add('Category: '+Cat.Name + ' Eventtype:'+ InttoStr(Cat.IType)); //add to listfor a := 0 to Cat.Items.Count-1 do//for all properties
Memo1.Lines.Add(' Attribute: '+Cat.Items[a].Name);
for c := 0 to doPCEventServer1.Conditions.Count-1 do//for all Conditionsbegin
Condition := doPCEventServer1.Conditions[c];
if Condition.IType = Cat.Id then//if type of Categorybegin
Memo1.Lines.Add(' Condition: '+Condition.Name);
for sc := 0 to Condition.Items.Count-1 do//for all Subconditions
Memo1.Lines.Add('Subcondition '+Condition.Items[sc].Name);
endend;
Memo1.Lines.Add('');
end;
dOPCEventServer1.Active := false;
end;
end;