本文整理汇总了C#中System.IO.ErrorEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ErrorEventArgs类的具体用法?C# ErrorEventArgs怎么用?C# ErrorEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ErrorEventArgs类属于System.IO命名空间,在下文中一共展示了ErrorEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
}
开发者ID:ExM,项目名称:NConfiguration,代码行数:33,代码来源:WatchedFileChecker.cs
示例2: OnError
protected virtual void OnError(ErrorEventArgs e)
{
if (Error != null)
{
Error(this, e);
}
}
开发者ID:skipperbent,项目名称:Skype-Customizer,代码行数:7,代码来源:SkypeInstance.cs
示例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();
}
开发者ID:styniu2,项目名称:InfernoUni,代码行数:8,代码来源:Cam.xaml.cs
示例4: OnError
private void OnError(object sender, ErrorEventArgs e)
{
// Notify all cache entries on error.
foreach (var token in _tokenCache.Values)
{
ReportChangeForMatchedEntries(token.Pattern);
}
}
开发者ID:IEvangelist,项目名称:FileSystem,代码行数:8,代码来源:PhysicalFilesWatcher.cs
示例5: OnNetworkStatusChanged
protected void OnNetworkStatusChanged(ErrorEventArgs e)
{
ErrorEventHandler handler = NetworkStatus;
if (handler != null)
{
handler(this, e);
}
}
开发者ID:jpgithub,项目名称:jprepost,代码行数:8,代码来源:NetworkAccess.cs
示例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);
}
开发者ID:dougbu,项目名称:WatchLots,代码行数:9,代码来源:Program.cs
示例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);
}
开发者ID:andrewleith,项目名称:OrangeCloudSyncClient,代码行数:9,代码来源:FileWatcher.cs
示例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());
}
开发者ID:SGuyGe,项目名称:corefx,代码行数:9,代码来源:ErrorEventArgs.unit.cs
示例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;
}
开发者ID:pkirk,项目名称:file-watcher,代码行数:23,代码来源:FileWatcherBufferErrorEventArgs.cs
示例10: pacServer_PACUpdateError
private void pacServer_PACUpdateError(object sender, ErrorEventArgs e)
{
if (UpdatePACFromGFWListError != null)
UpdatePACFromGFWListError(this, e);
}
开发者ID:Coselding,项目名称:shadowsocks-windows,代码行数:5,代码来源:ShadowsocksController.cs
示例11: PackReceived_Error
private void PackReceived_Error(object sender, ErrorEventArgs e)
{
Terminal.Instance.Client.Notifier.Log(TraceLevel.Error, e.GetException().ToString());
}
开发者ID:sergiosorias,项目名称:terminalzero,代码行数:4,代码来源:ZeroMasterDataModule.cs
示例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);
}
开发者ID:t-andre,项目名称:Emby,代码行数:14,代码来源:LibraryMonitor.cs
示例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);
}
开发者ID:EthanSteiner,项目名称:akka-bootcamp,代码行数:9,代码来源:FileObserver.cs
示例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();
}
}
开发者ID:Cyrre,项目名称:Emby,代码行数:22,代码来源:LibraryMonitor.cs
示例15: ReportErrors
public void ReportErrors(ErrorEventArgs errorEventArguments) {
throw new NotImplementedException();
}
开发者ID:Refresh06,项目名称:visualmutator,代码行数:3,代码来源:Core.cs
示例16: OnError
private void OnError(object sender, ErrorEventArgs e)
{
// Trigger all the cache entries on error.
foreach (var trigger in _triggerCache.Values)
{
ReportChangeForMatchedEntries(trigger.Pattern);
}
}
开发者ID:MetTeam,项目名称:FileSystem,代码行数:8,代码来源:PhysicalFilesWatcher.cs
示例17: 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>
async 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);
//Network either dropped or, we are coming out of sleep and it hasn't reconnected yet - wait and retry
var retries = 0;
var success = false;
while (!success && retries < 10)
{
await Task.Delay(500).ConfigureAwait(false);
try
{
dw.EnableRaisingEvents = false;
dw.EnableRaisingEvents = true;
success = true;
}
catch (ObjectDisposedException)
{
RemoveWatcherFromList(dw);
return;
}
catch (IOException)
{
Logger.Warn("Network still unavailable...");
retries++;
}
catch (ApplicationException)
{
Logger.Warn("Network still unavailable...");
retries++;
}
}
if (!success)
{
Logger.Warn("Unable to access network. Giving up.");
DisposeWatcher(dw);
}
}
开发者ID:rrb008,项目名称:MediaBrowser,代码行数:47,代码来源:DirectoryWatchers.cs
示例18: WorkTreeWatcherError
// destructor shouldn't be used because it's not predictable when
// it's going to be called by the GC!
private void WorkTreeWatcherError(object sender, ErrorEventArgs e)
{
ScheduleNextRegularUpdate();
}
开发者ID:ksukhonosenko,项目名称:gitextensions,代码行数:6,代码来源:ToolStripGitStatus.cs
示例19: OnFileWatcherError
/// <summary>
/// Handles the Error event of the <see cref="FileSystemWatcher"/>.
/// </summary>
private void OnFileWatcherError(object sender, ErrorEventArgs e)
{
// Stop further listening on error.
if (mFileWatcher != null)
{
mFileWatcher.EnableRaisingEvents = false;
mFileWatcher.Changed -= OnLogFileChanged;
mFileWatcher.Error -= OnFileWatcherError;
mFileWatcher.Dispose();
}
string pathOfFile = Path.GetDirectoryName(mFileToObserve);
string nameOfFile = Path.GetFileName(mFileToObserve);
if (!string.IsNullOrEmpty(pathOfFile) && !string.IsNullOrEmpty(nameOfFile))
{
mFileWatcher = new FileSystemWatcher(
pathOfFile
, nameOfFile);
mFileWatcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.Size;
mFileWatcher.Changed += OnLogFileChanged;
mFileWatcher.Error += OnFileWatcherError;
mFileWatcher.EnableRaisingEvents = IsActive;
ReadNewLogMessagesFromFile();
}
}
开发者ID:couchcoding,项目名称:Logbert,代码行数:31,代码来源:Log4NetFileReceiver.cs
示例20: GameManagerOnOnError
private void GameManagerOnOnError(object sender, ErrorEventArgs errorEventArgs)
{
MessageBox.Show(errorEventArgs.GetException().ToString(), "Error creating game");
}
开发者ID:rba100,项目名称:foosnet,代码行数:4,代码来源:NotifyWindowViewModel.cs
注:本文中的System.IO.ErrorEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论