suggestion

This forum is designated to discuss SiComponents Scheduling Agent.
Post Reply
petrossa
Posts: 23
Joined: Tue Aug 12, 2008 6:38 pm

suggestion

Post by petrossa »

to facilitate localisation i suggest the following codechange:

procedure TTaskItem.GetTasksLists(AList1: TStringlist; AList2: TStringlist;var Actions: array of integer);
var
iacoll: IActionCollection;
c: Integer;
I: Integer;
begin
with FInterface as IRegisteredTask do
begin
iacoll := get_Definition.Actions;
c := iacoll.Count;
for I := 1 to c do
begin
Actions[I-1] := iacoll.type_;
case iacoll.type_ of
TASK_ACTION_EXEC:
begin
AList2.Add(SStartProgram);
AList1.Add((iacoll as IExecAction).Path);
end;
TASK_ACTION_SEND_EMAIL:
begin
AList2.Add(sSendEmail);
AList1.Add((iacoll as IEMailAction).To_ + ' ' + (iacoll as
IEMailAction).Subject);
end;
TASK_ACTION_SHOW_MESSAGE:
begin
AList2.Add(sDisplayMessage);
AList1.Add((iacoll as IShowMessageAction).Title);
end;
end;
end;
end;
end;
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Could you please specify what change exactly you suggest?
Best regards,
Igor Siticov.
petrossa
Posts: 23
Joined: Tue Aug 12, 2008 6:38 pm

Post by petrossa »

var Actions: array of integer added to the procedure parameter

Actions[I-1] := iacoll.type_; added to build a list of actiontypes

that way you can have knowledge of the kind of actions in vista without comparing the strings to a resource string.
Post Reply