Exemplo n.º 1
0
 /// <summary>
 /// Handles file watcher starting event.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">Event data.</param>
 protected virtual void OnFileWatcherStarting(object sender,
     FileWatcherStartingEventArgs e)
 {
     _logger.Log(_formatter.Format(e));
 }
Exemplo n.º 2
0
        /// <summary>
        /// Handles file watcher starting event.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">Event data.</param>
        /// <exception cref="ArgumentNullException">e is null.</exception>
        protected override void OnFileWatcherStarting(object sender,
            FileWatcherStartingEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e",
                                                Resources.ArgumentNullException);
            }

            base.OnFileWatcherStarting(sender, e);
            SetStartingState(e.DaemonName);
            UpdateList(false);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Handles file watcher starting event.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">Event data.</param>
 protected virtual void OnFileWatcherStarting(object sender,
     FileWatcherStartingEventArgs e)
 {
     AddLogMessage(_formatter.Format(e));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Formats message.
 /// </summary>
 /// <param name="fileWatcherStartingEventArgs">Message.</param>
 /// <returns>Formatted message.</returns>
 /// <exception cref="ArgumentNullException">fileWatcherStartingEventArgs is null.</exception>
 public string Format(FileWatcherStartingEventArgs fileWatcherStartingEventArgs)
 {
     if (fileWatcherStartingEventArgs == null)
     {
         throw new ArgumentNullException("fileWatcherStartingEventArgs",
                                         Resources.ArgumentNullException);
     }
     return String.Format(CultureInfo.CurrentCulture,
                          @Resources.MessageDaemonStarting,
                          @DateTime.Now,
                          @Resources.MessageTypeInfo,
                          @fileWatcherStartingEventArgs.DaemonName);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Handles file watcher starting event.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">Event data.</param>
 private void OnFileWatcherStarting(object sender,
                                    FileWatcherStartingEventArgs e)
 {
     EventHandler<FileWatcherStartingEventArgs> handler = FileWatcherStarting;
     if (handler != null)
     {
         handler(this, e);
     }
 }
Exemplo n.º 6
0
        /// <summary>
        /// Handles file watcher starting event.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">Event data.</param>
        protected override void OnFileWatcherStarting(object sender,
            FileWatcherStartingEventArgs e)
        {
            base.OnFileWatcherStarting(sender, e);

            // If starting the file watchers then start updating if not already updating.
            lock (_lockUpdateTimer)
            {
                if (!_updateTimer.Enabled)
                {
                    _updateTimer.Enabled = true;
                }
            }
        }