本文整理汇总了C#中FileEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# FileEventArgs类的具体用法?C# FileEventArgs怎么用?C# FileEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FileEventArgs类属于命名空间,在下文中一共展示了FileEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FileRemoved
internal void FileRemoved(object sender, FileEventArgs e)
{
for (int i = 0; i < recentFiles.Count; ++i) {
string file = recentFiles[i].ToString();
if (e.FileName == file) {
recentFiles.RemoveAt(i);
break;
}
}
}
示例2: HandleFileServiceChange
static void HandleFileServiceChange (object sender, FileEventArgs e)
{
bool foundOneChange = false;
foreach (var file in e) {
foreach (var view in openFiles) {
if (SkipView (view) || !string.Equals (view.ContentName, file.FileName, fileNameComparer))
continue;
if (!view.IsDirty && (IdeApp.Workbench.AutoReloadDocuments || file.AutoReload))
view.SourceEditorWidget.Reload ();
else
foundOneChange = true;
}
}
if (foundOneChange)
CommitViewChange (GetAllChangedFiles ());
}
示例3: files_FileWritten
void files_FileWritten(object sender, FileEventArgs e)
{
Url virtualPath = e.VirtualPath;
if (!IsResizableImagePath(virtualPath))
return;
if(images.Sizes.Count == 0)
return;
byte[] image = GetImageBytes(virtualPath);
foreach (ImageSizeElement size in images.Sizes.AllElements)
{
CreateSize(virtualPath, image, size);
}
}
示例4: files_FileCopied
void files_FileCopied(object sender, FileEventArgs e)
{
if (IsResizedPath(e.VirtualPath))
return;
foreach (ImageSizeElement size in images.Sizes.AllElements)
{
Url sourceUrl = e.SourcePath;
Url destinationUrl = e.VirtualPath;
string sourcePath = ImagesUtility.GetResizedPath(sourceUrl, size.Name);
if (!files.FileExists(sourcePath))
continue;
string destinationPath = ImagesUtility.GetResizedPath(destinationUrl, size.Name);
if(!files.FileExists(destinationPath))
files.CopyFile(sourcePath, destinationPath);
}
}
示例5: HandleFileServiceChange
static void HandleFileServiceChange (object sender, FileEventArgs e)
{
// The Ide.Document generates a file service changed event this needs to be skipped.
if (!TypeSystemService.TrackFileChanges)
return;
bool foundOneChange = false;
foreach (var file in e) {
foreach (var view in openFiles) {
if (SkipView (view) || !string.Equals (view.ContentName, file.FileName, fileNameComparer))
continue;
if (!view.IsDirty/* && (IdeApp.Workbench.AutoReloadDocuments || file.AutoReload)*/)
view.SourceEditorWidget.Reload ();
else
foundOneChange = true;
}
}
if (foundOneChange)
CommitViewChange (GetAllChangedFiles ());
}
示例6: OnFileRenamed
protected virtual void OnFileRenamed(FileEventArgs e)
{
if (FileRenamed != null) {
FileRenamed(this, e);
}
}
示例7: NotifyFileRemoved
static void NotifyFileRemoved (object sender, FileEventArgs args)
{
foreach (FileEventInfo e in args) {
if (!e.IsDirectory) {
platformService.RecentFiles.NotifyFileRemoved (e.FileName);
}
}
}
示例8: ProbeNppPlugin_FileSaved
void ProbeNppPlugin_FileSaved(object sender, FileEventArgs e)
{
try
{
if (!string.IsNullOrWhiteSpace(e.FileName))
{
CodeModel.CodeModel.OnFileSaved(e.FileName);
}
}
catch (Exception ex)
{
Output.WriteLine(OutputStyle.Error, ex.ToString());
}
}
示例9: fileEvents
void fileEvents(object sender, FileEventArgs e)
{
if (FileEvent != null) FileEvent(sender, e);
}
示例10: FileRenamed
public void FileRenamed(object sender, FileEventArgs e)
{
if (e.IsDirectory)
return;
if (e.FileName == null)
recentFiles.RenameItem (new Uri (e.SourceFile), new Uri (e.TargetFile));
else
recentFiles.RenameItem (new Uri (e.FileName), new Uri (e.TargetFile));
UpdateLastFile ();
}
示例11: Plugin_FileActivated
private void Plugin_FileActivated(object sender, FileEventArgs e)
{
try
{
OnFileActivated(e.BufferId);
_fileScannerDefer.OnActivity();
}
catch (Exception ex)
{
Output.WriteLine(OutputStyle.Error, ex.ToString());
}
}
示例12: files_FileDeleted
void files_FileDeleted(object sender, FileEventArgs e)
{
if (!Enabled)
return;
if (!IsResizableImagePath(e.VirtualPath))
return;
foreach (ImageSizeElement size in images.Sizes.AllElements)
{
string resizedPath = ImagesUtility.GetResizedPath(e.VirtualPath, size.Name);
if (files.FileExists(resizedPath))
files.DeleteFile(resizedPath);
}
}
示例13: OnWarningAdded
private void OnWarningAdded(object sender, FileEventArgs args) {
if (_diskNodes.ContainsKey(args.Filename)) {
_warningFiles.Add(args.Filename);
}
}
示例14: OnErrorRemoved
private void OnErrorRemoved(object sender, FileEventArgs args) {
_errorFiles.Remove(args.Filename);
}
示例15: OnErrorAdded
private void OnErrorAdded(object sender, FileEventArgs args) {
if (_diskNodes.ContainsKey(args.Filename)) {
_errorFiles.Add(args.Filename);
}
}