コード例 #1
0
        public void Run(IWorkerOutput output, ISynchronizeInvoke objectToSyncWith)
        {
            if (output == null)
            {
                throw new Exception("IWorkerOutput reference may not be null.");
            }
            if (timeToCycle < timeToWaitAfterAction)
            {
                throw new Exception("Waiting period is less than cycle period. Undefined and a bad idea.");
            }

            if (CrashPlanService == null)
            {
                return;
            }

            outputDelegate = output;

            CheckForWow();

            actionTimer          = new System.Timers.Timer();
            actionTimer.Interval = timeToCycle;
            actionTimer.Elapsed += new ElapsedEventHandler(tmrTimersTimer_Elapsed);
            if (objectToSyncWith != null)
            {
                actionTimer.SynchronizingObject = objectToSyncWith; //Synchronize with...
            }
            actionTimer.Start();
        }
コード例 #2
0
 public void Run(IWorkerOutput output)
 {
     Run(output, null);
 }