本文整理汇总了C#中System.IO.ErrorEventArgs.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ErrorEventArgs.ToString方法的具体用法?C# ErrorEventArgs.ToString怎么用?C# ErrorEventArgs.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.ErrorEventArgs
的用法示例。
在下文中一共展示了ErrorEventArgs.ToString方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnError
private static void OnError(object source, ErrorEventArgs e)
{
Trace.WriteLine("{0} : {1} : {2}", e.GetException().ToString(), e.GetType().ToString(), e.ToString());
}
示例2: _watcher_Error
void _watcher_Error(object sender, ErrorEventArgs e)
{
Console.WriteLine("File Watcher Error: " + e.ToString());
}
示例3: watcher_Error
/// <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");
}
}
示例4: WatcherErrorHandler
private void WatcherErrorHandler(object sender, ErrorEventArgs e)
{
_onError(e.ToString());
}
示例5: FileMonitor_OnError
/// <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()));
}
示例6: dialer_Error
void dialer_Error(object sender, ErrorEventArgs e)
{
DialError(e.ToString());
}
示例7: OnError
// OnError +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
public static void OnError( object sender,
ErrorEventArgs error )
{
Log.Error( "! PlayerInfo Error: " + error.ToString() );
}
示例8: _sourceWatcher_Error
private void _sourceWatcher_Error(object sender, ErrorEventArgs e)
{
Log("Error");
Log(e.ToString());
}
示例9: watcher_Error
void watcher_Error(object sender, ErrorEventArgs e)
{
System.Diagnostics.Debug.WriteLine(e.ToString());
}