本文整理汇总了C#中System.IO.FileSystemEventArgs.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# FileSystemEventArgs.ToString方法的具体用法?C# FileSystemEventArgs.ToString怎么用?C# FileSystemEventArgs.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.FileSystemEventArgs
的用法示例。
在下文中一共展示了FileSystemEventArgs.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnWatcherError
// Watcher error
private void OnWatcherError(object sender, FileSystemEventArgs e)
{
showErrorAndExit("FileSystemWatcher Error: "+e.ToString());
}
示例2: OnDeleted
private static void OnDeleted(object source, FileSystemEventArgs e)
{
Trace.WriteLine("{0} - {1} : {2} [{3}]", e.FullPath, e.Name, e.ChangeType.ToString(), e.ToString());
}
示例3: OnFolderContentsUpdated
void OnFolderContentsUpdated(object sender, FileSystemEventArgs e)
{
if (InvokeRequired)
{
Invoke(new FileSystemEventHandler(OnFolderContentsUpdated), sender, e);
return;
}
Logger.LogHeavyTrace("OnFolderContentsUpdated: " + e.ToString());
_delayedExplore.Stop();
try
{
if (sender is FileSystemWatcher)
{
_delayedExplore.Start();
}
}
catch(Exception ex)
{
Logger.LogException(ex);
}
}
示例4: OnChanged
public void OnChanged(object source, FileSystemEventArgs e)
{
debugLogger.WriteDebug_3("Begin Method: OnChanged(object,FileSystemEventArgs) ("
+ source.ToString() + "," + e.ToString() + ")");
changed = true;
debugLogger.WriteDebug_3("End Method: OnChanged()");
}
示例5: Handle
/// <summary>
/// Raises the created/changed/deleted event as FSEvent.
/// </summary>
/// <param name='source'>
/// Source file system watcher.
/// </param>
/// <param name='e'>
/// Reported changes.
/// </param>
public virtual void Handle(object source, FileSystemEventArgs e) {
try {
bool isDirectory = false;
if (e.ChangeType == WatcherChangeTypes.Deleted) {
var path = this.fsFactory.CreateFileInfo(e.FullPath);
var obj = this.storage.GetObjectByLocalPath(path);
Guid guid = Guid.Empty;
if (obj != null) {
isDirectory = obj.Type == MappedObjectType.Folder;
guid = obj.Guid;
}
this.AddEventToList(e, guid, isDirectory);
} else {
bool? check = this.fsFactory.IsDirectory(e.FullPath);
if (check != null) {
isDirectory = (bool)check;
IFileSystemInfo fsInfo = isDirectory ? (IFileSystemInfo)this.fsFactory.CreateDirectoryInfo(e.FullPath) : (IFileSystemInfo)this.fsFactory.CreateFileInfo(e.FullPath);
Guid uuid = Guid.Empty;
try {
Guid? fsGuid = fsInfo.Uuid;
if (fsGuid != null) {
uuid = (Guid)fsGuid;
}
} catch(Exception) {
uuid = Guid.Empty;
}
this.AddEventToList(e, uuid, isDirectory);
}
}
} catch (Exception ex) {
Logger.Warn(string.Format("Processing file system event {0} produces exception => force crawl sync", e.ToString()), ex);
this.queue.AddEvent(new StartNextSyncEvent(true));
}
}