예제 #1
0
        public static void Add(TimerCallback rCallable)
        {
            Invokable inv = new Invokable
            {
                Function = rCallable,
                Name     = rCallable.GetMethodInfo().DeclaringType.Name + "." + rCallable.GetMethodInfo().Name,
            };

            _FunctionList.Add(inv);
        }
예제 #2
0
        public static void SetInterval(TimerCallback rCallback, string rArgs, int rTicks, int rInterval, int rDelay, string rTarget)
        {
            TimerState ts = new TimerState
            {
                Callback  = rCallback,
                Name      = rCallback.GetMethodInfo().DeclaringType.Name + "." + rCallback.GetMethodInfo().Name,
                Args      = rArgs,
                Target    = rTarget,
                MaxTicks  = rTicks,
                Interval  = rInterval,
                DoneTicks = 0
            };

            Timer t = new Timer(TickInterval, ts, rDelay, rInterval);

            ts.Timer = t;
            Scheduled.Add(ts);
        }