Exemplo n.º 1
0
        /// <summary>
        /// (re)starts fileWatcher operation reseting state according to __eventMode
        /// </summary>
        /// <param name="__eventMode">fileWatcher event flushing mode to operate on</param>
        /// <param name="__onFileWatcherEvent">Event handler that should be called for flushing</param>
        public void start(fileWatcherEventMode __eventMode, fileWatcherEvent __onFileWatcherEvent = null)
        {
            eventMode = __eventMode;

            _flush(null);

            isOperationDisabled = false;
            switch (eventMode)
            {
            case fileWatcherEventMode.directEventCall:
                break;

            case fileWatcherEventMode.externalEventListFlush:
                break;

            case fileWatcherEventMode.handlerFlush_internalTimer:

                flushTimer.Change(eventFlushInterval, eventFlushInterval);

                break;

            case fileWatcherEventMode.handlerFlush_externalTimer:
                stopwatch = new imbStopwatch("Event accumulation stop watch", false);

                break;
            }

            if (__onFileWatcherEvent != null)
            {
                onFileWatcherEvent = __onFileWatcherEvent;
            }
        }
Exemplo n.º 2
0
        internal fileWatcher()
        {
            stopwatch          = new imbStopwatch("Events flusher", false);
            eventFlushInterval = aceSystemAtaman.defaultEventsFlushInterval;
            flushTimer         = new Timer(new TimerCallback(timerTick));

            //_fileSystemWatcher = new FileSystemWatcher(
        }