Инструменты пользователя

Инструменты сайта


axapta:таймербезформы

Различия

Показаны различия между двумя версиями страницы.

Ссылка на это сравнение

axapta:таймербезформы [2018/04/13 22:43] (текущий)
Строка 1: Строка 1:
 +есть два варианта: 
 +  * использование нитей (потоков), например, см. Класс/SysEventHandler/initialize
 +  * использование Класс/Object/addTimeOut:
  
 +----
 +Hi
 + 
 +It only works in 3.0. You could make a class with the following
 +methods,
 +and start the class by calling yourclassname.startCheck. You would
 +probably have to do something about the hardcoded 1000 in the
 +method
 +doCheck.
 +<code XPP>
 +class yourclassname
 +{
 +    Int timeOutHandle;
 +}
 + 
 +
 +private void addTimeOut(int _time = 60*60*1000)
 +{
 +    ;
 +    timeOutHandle = infolog.addTimeOut(this,
 +methodstr(yourclassname,
 +doCheck), _time, false);
 +}
 + 
 +
 +void startCheck(int time = 1000)
 +{
 +    ;
 +    infolog.globalCache().set(classstr(yourclassname),
 +classstr(yourclassname), this);
 +    this.addTimeOut(time);
 +}
 + 
 +
 +void doCheck()
 +{
 +    ;
 +    try
 +    {
 +        // do your thang
 +    }
 + 
 +    catch(Exception::Error)
 +    {
 +        this.stopCheck();
 +    }
 + 
 +    this.addTimeOut(1000);
 +}
 + 
 +
 +void stopCheck()
 +{
 +    ;
 +    infolog.globalCache().remove(classstr(yourclassname),
 +classstr(yourclassname));
 +    infolog.removeTimeOut(timeOutHandle);
 +}
 + 
 +</code> 
 +Regards
 +Jan Stelsig Dahlsgaard
 +Fujitsu DK
 +----
 +
 +
 +----
 +[[:AxForum]]:[[http://www.axforum.info/forums/showthread.php?s=&threadid=1029]]
axapta/таймербезформы.txt · Последнее изменение: 2018/04/13 22:43 (внешнее изменение)