Example #1
0
 void _watcher_Error(object sender, ErrorEventArgs e)
 {
     Console.WriteLine("File Watcher Error: " + e.ToString());
 }
Example #2
0
 private static void Dialer_Error(object sender, System.IO.ErrorEventArgs e)
 {
     Log.LogError("Event Dialer_Error: " + e.ToString(), e.GetException());
 }
 private static void OnError(object source, ErrorEventArgs e)
 {
     Trace.WriteLine("{0} : {1} : {2}", e.GetException().ToString(), e.GetType().ToString(), e.ToString());
 }
        /// <summary>
        /// if the filesystem watcher throws an error - we mostly care about it throwing when 
        /// it can't see a network share anymore.  in that case we re-create the file watcher
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void watcher_Error(object sender, ErrorEventArgs e)
        {
            DebugLine("Watcher Error Triggered. " + e.ToString());

            try
            {
                FileSystemWatcher watcher = sender as FileSystemWatcher;

                if ( watcher == null )
                    return;

                // if the watcher path no longer exists for whatever reason, add this watcher to the bad queue
                // to re-attempt to see if it exists every 5 seconds.  This can happen if a network drive disconnects
                // or someone removes an attached drive.  re-creating the watcher is required when the device comes
                // back online
                if (!Directory.Exists(watcher.Path))
                {
                    lock (badWatchers)
                    {
                        // add it to the bad watcher list
                        if (watchers.Contains(watcher))
                        {
                            badWatchers.Add(watcher);
                            watchers.Remove(watcher);

                            badWatcherTimer.Start();
                        }
                    }
                }
            }
            catch (Exception err)
            {
                DebugLineError(err, "Error re-setting up watcher");
            }
        }
Example #5
0
 private void WatcherErrorHandler(object sender, ErrorEventArgs e)
 {
     _onError(e.ToString());
 }
 /// <summary>
 /// Handles the OnError event of the FileMonitor control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.IO.ErrorEventArgs"/> instance containing the event data.</param>
 public void FileMonitor_OnError(object sender, ErrorEventArgs e)
 {
     this.EventLog.WriteEntry(String.Format("FileMonitor: OnError: {0}", e.ToString()));
 }
Example #7
0
File: VPNCore.cs Project: kangwl/xk
 void dialer_Error(object sender, ErrorEventArgs e)
 {
     DialError(e.ToString());
 }
Example #8
0
 // OnError +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 public static void OnError( object         sender, 
                         ErrorEventArgs error )
 {
     Log.Error( "! PlayerInfo Error: " + error.ToString() );
 }
Example #9
0
 private void _sourceWatcher_Error(object sender, ErrorEventArgs e)
 {
     Log("Error");
     Log(e.ToString());
 }
Example #10
0
 void watcher_Error(object sender, ErrorEventArgs e)
 {
     System.Diagnostics.Debug.WriteLine(e.ToString());
 }