SiComponents Home Page SiComponents Forums
Here you will be able to get help and share your experience
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

suggestion

 
Post new topic   Reply to topic    SiComponents Forums Forum Index -> VCL Scheduling Agent
View previous topic :: View next topic  
Author Message
petrossa



Joined: 12 Aug 2008
Posts: 23

PostPosted: Sun Sep 28, 2008 4:04 pm    Post subject: suggestion Reply with quote

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[I].type_;
case iacoll[I].type_ of
TASK_ACTION_EXEC:
begin
AList2.Add(SStartProgram);
AList1.Add((iacoll[I] as IExecAction).Path);
end;
TASK_ACTION_SEND_EMAIL:
begin
AList2.Add(sSendEmail);
AList1.Add((iacoll[I] as IEMailAction).To_ + ' ' + (iacoll[I] as
IEMailAction).Subject);
end;
TASK_ACTION_SHOW_MESSAGE:
begin
AList2.Add(sDisplayMessage);
AList1.Add((iacoll[I] as IShowMessageAction).Title);
end;
end;
end;
end;
end;
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2103

PostPosted: Mon Sep 29, 2008 8:10 am    Post subject: Reply with quote

Could you please specify what change exactly you suggest?
Back to top
View user's profile Send private message
petrossa



Joined: 12 Aug 2008
Posts: 23

PostPosted: Mon Sep 29, 2008 10:05 am    Post subject: Reply with quote

var Actions: array of integer added to the procedure parameter

Actions[I-1] := iacoll[I].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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SiComponents Forums Forum Index -> VCL Scheduling Agent All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by p h p B B  © 2001, 2005 p h p B B  Group