Esempio n. 1
0
		void CheckFileRename(object sender, FileCopyEventArgs args)
		{
			foreach (Solution sol in GetAllSolutions ()) {
				foreach (FileCopyEventInfo e in args)
					sol.RootFolder.RenameFileInProjects (e.SourceFile, e.TargetFile);
			}
		}
Esempio n. 2
0
 void FileRenamed(object sender, FileCopyEventArgs e)
 {
     foreach (FileCopyEventInfo file in e)
     {
         FileRenamed(file);
     }
 }
Esempio n. 3
0
 private void folderCopier_BeforeFileCopy(object sender, FileCopyEventArgs e)
 {
     prgFolderTotal.Maximum     = (int)e.TotalBytes;
     lblFolderTotalDetails.Text = e.Percent.ToString() + "% Done";
     lblFolderSourceFile.Text   = e.SourceFile;
     lblFolderTargetFile.Text   = e.TargetFile;
 }
Esempio n. 4
0
 void CheckRenamedFile(object sender, FileCopyEventArgs args)
 {
     foreach (FileEventInfo e in args)
     {
         if (e.IsDirectory)
         {
             foreach (var doc in documents)
             {
                 if (doc.IsFile && !doc.IsNewDocument && doc.FilePath.IsChildPathOf(e.SourceFile))
                 {
                     var newFile = e.TargetFile.Combine(doc.FilePath.ToRelative(e.SourceFile)).FullPath;
                     doc.RenameFile(newFile);
                 }
             }
         }
         else
         {
             foreach (var doc in documents)
             {
                 if (doc.IsFile && !doc.IsNewDocument && doc.FilePath == e.SourceFile && File.Exists(e.TargetFile))
                 {
                     doc.RenameFile(e.TargetFile);
                     return;
                 }
             }
         }
     }
 }
Esempio n. 5
0
 private static void Copied(object sender, FileCopyEventArgs e)
 {
     if (!_files.Contains(e.Destination))
     {
         _files.Add(e.Destination);
     }
 }
Esempio n. 6
0
 void FileRenamed(object sender, FileCopyEventArgs e)
 {
     foreach (FileCopyEventInfo info in e)
     {
         WriteText(string.Format("FileRenamed: {0} -> {1}", info.SourceFile, info.TargetFile));
     }
 }
        void OnSystemFileRenamed(object sender, FileCopyEventArgs args)
        {
            foreach (FileCopyEventInfo e in args)
            {
                Project project = GetProjectForFile(e.SourceFile);
                if (project == null)
                {
                    return;
                }

                if (e.IsDirectory)
                {
                    /*				string childPath;
                     *                              ITreeBuilder tb = FindParentFolderNode (e.SourceFile, project, out childPath);
                     *                              if (tb != null && tb.Options ["ShowAllFiles"]) {
                     *                                      tb.UpdateAll ();
                     *                              }
                     */
                }
                else
                {
                    ITreeBuilder tb = Context.GetTreeBuilder(new SystemFile(e.SourceFile, project));
                    if (tb != null)
                    {
                        tb.Remove(true);
                        tb.AddChild(new SystemFile(e.TargetFile, project));
                    }
                }
            }
        }
Esempio n. 8
0
		static void NotifyFileRenamed (object sender, FileCopyEventArgs args)
		{
			foreach (FileCopyEventInfo e in args) {
				if (!e.IsDirectory) {
					PlatformService.RecentFiles.NotifyFileRenamed (e.SourceFile, e.TargetFile);
				}
			}
		}
Esempio n. 9
0
 public void InformFileRenamed(object sender, FileCopyEventArgs e)
 {
     if (!e.IsDirectory)
     {
         recentFiles.RenameItem(RecentFileStorage.ToUri(e.SourceFile), RecentFileStorage.ToUri(e.TargetFile));
         OnRecentFileChange();
     }
 }
        void OnFolderRenamed(object sender, FileCopyEventArgs e)
        {
            ProjectFolder f  = (ProjectFolder)sender;
            ITreeBuilder  tb = Context.GetTreeBuilder(f.Parent);

            if (tb != null)
            {
                tb.UpdateAll();
            }
        }
Esempio n. 11
0
 void FileService_FileMoved(object sender, FileCopyEventArgs e)
 {
     foreach (var file in e)
     {
         if (watchers.TryGetValue(file.SourceFile, out FileSystemWatcher watcher))
         {
             ContextFileMoved?.Invoke(this, new ContextFileMovedEventArgs(file.SourceFile, file.TargetFile));
             watcher.Dispose();
             watchers.Remove(file.SourceFile);
             StartWatching(file.TargetFile.FileName, file.TargetFile.ParentDirectory);
         }
     }
 }
Esempio n. 12
0
        void OnFileRenamed(object sender, FileCopyEventArgs e)
        {
            // The folder path can't be updated because we would be changing
            // the identity of the object. Another folder object will need
            // to be created by updating the tree.

            var e2 = new FileCopyEventArgs(e.Where(i => i.IsDirectory && i.SourceFile == absolutePath));

            if (e2.Count > 0 && FolderRenamed != null)
            {
                FolderRenamed(this, e);
            }
        }
        void FileServiceOnFileRenamed(object sender, FileCopyEventArgs e)
        {
            FileService.FileRenamed -= FileServiceOnFileRenamed;

            try {
                var result = e.Single();

                // Simulate what the RootWorkspace does on a rename.
                project.ParentSolution.RootFolder.RenameFileInProjects(result.SourceFile, result.TargetFile);

                directoryRenamedCompletionSource.SetResult(e);
            } catch (Exception ex) {
                directoryRenamedCompletionSource.SetException(ex);
            }
        }
 public void FileRename(object sender, FileCopyEventArgs args)
 {
     foreach (Change change in changes)
     {
         TextReplaceChange replaceChange = change as TextReplaceChange;
         if (replaceChange == null)
         {
             continue;
         }
         if (args.SourceFile == replaceChange.FileName)
         {
             replaceChange.FileName = args.TargetFile;
         }
     }
 }
Esempio n. 15
0
 void FileService_FileMoved(object sender, FileCopyEventArgs e)
 {
     lock (watchedFiles) {
         foreach (var file in e)
         {
             if (watchedFiles.Remove(file.SourceFile))
             {
                 ContextFileMoved?.Invoke(this, new ContextFileMovedEventArgs(file.SourceFile, file.TargetFile));
                 if (file.SourceFile == file.TargetFile)
                 {
                     StartWatching(file.TargetFile.FileName, file.TargetFile.ParentDirectory);
                 }
             }
         }
     }
 }
Esempio n. 16
0
        void OnFileRenamed(object sender, FileCopyEventArgs e)
        {
            if (!e.IsDirectory || e.SourceFile != absolutePath)
            {
                return;
            }

            // The folder path can't be updated because we would be changing
            // the identity of the object. Another folder object will need
            // to be created by updating the tree.

            if (FolderRenamed != null)
            {
                FolderRenamed(this, e);
            }
        }
Esempio n. 17
0
 private void StorageManager_FileCopied(object sender, FileCopyEventArgs e)
 {
     if (e.FileInfo == null)
     {
         return;
     }
     if (e.IsBackupVolume)
     {
         FileToSave.Volume2 = StorageVolumeModel;
         FileToSave.Volume2LastWriteTime = e.FileInfo.LastWriteTime;
     }
     else
     {
         FileToSave.Volume1 = StorageVolumeModel;
         FileToSave.Volume1LastWriteTime = e.FileInfo.LastWriteTime;
     }
 }
Esempio n. 18
0
        public async Task ShowPopupAsync(FileCopyEventArgs e)
        {
            if (InvokeRequired)
            {
                BeginInvoke((MethodInvoker)async delegate {
                    await ShowPopupAsync(e);
                });
                return;
            }

            await Task.Factory.StartNew(() =>
            {
                try
                {
                    picFileIcon.Image = GetIcon(e.FilePath);
                    var fileName      = Path.Combine(Path.GetDirectoryName(e.FilePath), Path.GetFileName(e.FilePath));

                    lblFileOperation.Text = String.Format("{0} {1}", e.Action, fileName);

                    var dur  = _parent._settings.PopupDuration;
                    var scr  = Screen.PrimaryScreen.WorkingArea;
                    Point p  = new Point((scr.Right - Width - 100), scr.Bottom);
                    Location = p;
                    Show();
                    Activate();
                    for (Int32 i = 1; i < Height; i++)
                    {
                        p        = new Point((scr.Right - Width - 100), (scr.Bottom - i));
                        Location = p;
                        Application.DoEvents();
                        Thread.Sleep(4);
                    }
                    Application.DoEvents();
                    Thread.Sleep(Convert.ToInt16(dur) * 1000);
                    Hide();
                }
                catch (Exception ex)
                {
                    Logging.WriteToAppLog("Error showing popup", EventLogEntryType.Error, ex);
                }
            });
        }
Esempio n. 19
0
 private void copyService_FileCopied(object sender, FileCopyEventArgs e)
 {
     CopyProgress.Items.Add(string.Format("{0} copied", e.FileName));
     Application.DoEvents();
 }
Esempio n. 20
0
 static void Copying(object sender, FileCopyEventArgs e)
 {
     Logger.Log($"Copying {Path.GetFileName(e.Destination)}");
     ProjectHelpers.CheckFileOutOfSourceControl(e.Destination);
 }
Esempio n. 21
0
 /// <summary>
 /// Handles the CreatingFile event of the jobWorker control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="FlagSync.Core.FileCopyEventArgs"/> instance containing the event data.</param>
 private void jobWorker_CreatingFile(object sender, FileCopyEventArgs e)
 {
     this.AddLogMessage(Resources.CreatingString, Resources.FileString, e.File.FullName, e.TargetDirectory.FullName, false, e.File.Length);
 }
Esempio n. 22
0
 private async void FileActivityMessageAsync(object sender, FileCopyEventArgs e)
 {
     _logger.Write(e);
     await _float.ShowPopupAsync(e);
 }
Esempio n. 23
0
 /// <summary>
 /// Handles the CreatedFile event of the jobWorker control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="FlagSync.Core.FileCopyEventArgs"/> instance containing the event data.</param>
 private void jobWorker_CreatedFile(object sender, FileCopyEventArgs e)
 {
     this.LastLogMessage.Progress = 100;
 }