本文整理汇总了C#中System.IO.ErrorEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ErrorEventArgs类的具体用法?C# ErrorEventArgs怎么用?C# ErrorEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ErrorEventArgs类属于System.IO命名空间,在下文中一共展示了ErrorEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: watcherError
private void watcherError(object sender, ErrorEventArgs e)
{
try
{
((FileSystemWatcher)sender).Dispose();
FileSystemWatcher copy;
lock (_sync)
{
if (_disposed)
return;
if (_watcher != sender)
return;
if (_watcher == null)
return;
copy = _watcher;
_watcher = createWatch();
}
copy.EnableRaisingEvents = false;
copy.Dispose();
_are.Set();
}
catch (Exception ex)
{
throw new Exception("Error while file checking.", ex);
}
}
示例2: OnError
protected virtual void OnError(ErrorEventArgs e)
{
if (Error != null)
{
Error(this, e);
}
}
示例3: MjpegOnError
private void MjpegOnError(object sender, ErrorEventArgs e)
{
string message = string.Format(CultureInfo.InvariantCulture, "Cam error: {0}, restarting..", e.Message);
_mainPage.DisplayStatus(message, MainPage.NotifyType.ErrorMessage);
Task.Delay(TimeSpan.FromSeconds(1)).Wait();
MjpegInitialize();
}
示例4: OnError
private void OnError(object sender, ErrorEventArgs e)
{
// Notify all cache entries on error.
foreach (var token in _tokenCache.Values)
{
ReportChangeForMatchedEntries(token.Pattern);
}
}
示例5: OnNetworkStatusChanged
protected void OnNetworkStatusChanged(ErrorEventArgs e)
{
ErrorEventHandler handler = NetworkStatus;
if (handler != null)
{
handler(this, e);
}
}
示例6: OnError
private static void OnError(object sender, ErrorEventArgs e)
{
var exception = e.GetException();
Console.Error.WriteLine($"Hit an Exception with HResult '{ exception.HResult }'" +
Environment.NewLine +
$"{ exception }");
Environment.FailFast(exception.Message);
}
示例7: OnError
void OnError(object sender, ErrorEventArgs e)
{
// when an error occurs, the current FileSystemWatcher is disposed,
// and a new one is created
string lPath = fWatcher.Path;
string lFilter = fWatcher.Filter;
fWatcher.Dispose();
Initialize(lPath, lFilter);
}
示例8: ValidateErrorEventArgs
private static void ValidateErrorEventArgs(Exception exception)
{
ErrorEventArgs args = new ErrorEventArgs(exception);
Assert.Equal(exception, args.GetException());
// Make sure method is consistent.
Assert.Equal(exception, args.GetException());
}
示例9: FileWatcherBufferErrorEventArgs
/// <summary>
/// Initializes a new instance of the FileWatcherBufferErrorEventArgs class.
/// </summary>
/// <param name="daemonName">Daemon name of the file watcher.</param>
/// <param name="e">ErrorEventArgs.</param>
/// <exception cref="ArgumentNullException">e is null.</exception>
/// <exception cref="ArgumentNullException">daemonName is null.</exception>
public FileWatcherBufferErrorEventArgs(string daemonName,
ErrorEventArgs e)
{
if (e == null)
{
throw new ArgumentNullException("e",
Resources.ArgumentNullException);
}
if (daemonName == null)
{
throw new ArgumentNullException("daemonName",
Resources.ArgumentNullException);
}
_daemonName = daemonName;
_errorEventArgs = e;
}
示例10: pacServer_PACUpdateError
private void pacServer_PACUpdateError(object sender, ErrorEventArgs e)
{
if (UpdatePACFromGFWListError != null)
UpdatePACFromGFWListError(this, e);
}
示例11: PackReceived_Error
private void PackReceived_Error(object sender, ErrorEventArgs e)
{
Terminal.Instance.Client.Notifier.Log(TraceLevel.Error, e.GetException().ToString());
}
示例12: watcher_Error
/// <summary>
/// Handles the Error event of the watcher control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="ErrorEventArgs" /> instance containing the event data.</param>
void watcher_Error(object sender, ErrorEventArgs e)
{
var ex = e.GetException();
var dw = (FileSystemWatcher)sender;
Logger.ErrorException("Error in Directory watcher for: " + dw.Path, ex);
DisposeWatcher(dw);
}
示例13: OnFileError
/// <summary>
/// Callback for <see cref="FileSystemWatcher" /> file error events.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnFileError(object sender, ErrorEventArgs e)
{
_tailActor.Tell(new TailActor.FileError(_fileNameOnly, e.GetException().Message), ActorRefs.NoSender);
}
示例14: watcher_Error
/// <summary>
/// Handles the Error event of the watcher control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="ErrorEventArgs" /> instance containing the event data.</param>
void watcher_Error(object sender, ErrorEventArgs e)
{
var ex = e.GetException();
var dw = (FileSystemWatcher)sender;
Logger.ErrorException("Error in Directory watcher for: " + dw.Path, ex);
DisposeWatcher(dw);
if (ConfigurationManager.Configuration.EnableLibraryMonitor == AutoOnOff.Auto)
{
Logger.Info("Disabling realtime monitor to prevent future instability");
ConfigurationManager.Configuration.EnableLibraryMonitor = AutoOnOff.Disabled;
Stop();
}
}
示例15: ReportErrors
public void ReportErrors(ErrorEventArgs errorEventArguments) {
throw new NotImplementedException();
}