void OnFileSaved(object sender, FileNameEventArgs e) { if (ProjectService.OpenSolution != null) { foreach (IProject p in ProjectService.OpenSolution.Projects) { if (p.FindFile(e.FileName) != null || FileUtility.IsEqualFileName(p.FileName, e.FileName)) { lock (unmodifiedProjects) { unmodifiedProjects.Remove(p); } } } } }
// Se produit après files found #2, donne l'état d'avancement global et quel fichier va être traité private void FileCompressionStarted(object sender, FileNameEventArgs e) { Timer.Restart(); if (CancelToken.IsCancellationRequested) { e.Cancel = true; IsInterrupted = true; } this.UpdateProgressT?.Invoke(this, new ProgressArg(e.PercentDone, 100, CancelFlag)); this.UpdateStatus?.Invoke(this, new StateArg(e.FileName, CancelFlag)); Debug.WriteLine($"File being compressed: {e.FileName}"); Debug.WriteLine($"fcs Percent done: {e.PercentDone}%"); }
public void PackageFilesViewWriteMethodFiresFileUtilityFileSavedEvent() { try { fileUtilityFileSavedEventArgs = null; FileUtility.FileSaved += FileUtilityFileSaved; string fileName = @"d:\projects\test\setup.wxs"; WixDocument document = new WixDocument(); document.FileName = fileName; packageFilesView.Write(document); Assert.AreEqual(fileName, fileUtilityFileSavedEventArgs.FileName.ToString()); } finally { FileUtility.FileSaved -= FileUtilityFileSaved; } }
static void OnFileSaved(object sender, FileNameEventArgs e) { IProject project = SD.ProjectService.FindProjectContainingFile(e.FileName); if (project == null) { return; } FileProjectItem item = project.FindFile(e.FileName); if (item == null) { return; } if (!string.IsNullOrEmpty(item.CustomTool)) { RunCustomTool(item, false); } }
private void FileCompressionStarted(object sender, FileNameEventArgs e) { e.Cancel = IsCancel; inte++; CurFileString = e.FileName; //when the next file is being compressed. pb_compression.Invoke(new InvokeEvent((object o, EventArgs l) => { pb_compression.Value = 0; }), sender, e); lbl_commpressing_file.Invoke(new FileEvent((object o, FileNameEventArgs l) => { lbl_commpressing_file.Text = String.Format(_commpressingFileName, l.FileName); }), sender, e); pb_totaalfiles.Invoke(new FileEvent((object o, FileNameEventArgs l) => { pb_totaalfiles.Value = l.PercentDone; }), sender, e); }
void FileSaved(object sender, FileNameEventArgs e) { if (!TypeScriptFileExtensions.IsTypeScriptFileName(e.FileName)) { return; } TypeScriptProject project = TypeScriptService.GetProjectForFile(e.FileName); if (project == null) { return; } if (project.CompileOnSave) { var action = new CompileTypeScriptOnSaveFileAction(); TypeScriptContext context = TypeScriptService.ContextProvider.GetContext(e.FileName); action.Compile(e.FileName, project, context); } }
private void FileCompressionStarted(object sender, FileNameEventArgs e) { if (bgwZipper.CancellationPending) { e.Cancel = true; return; } if (FilesToAdd.TryGetValue(e.FileName, out string sourceFile)) { var fi = new FileInfo(sourceFile); thisFileSize = (int)fi.Length; } else { thisFileSize = 0; } this.Invoke(new MethodInvoker(delegate { lInfo.Text = e.FileName; })); }
/// <summary> /// Called when a file is about to be added to a new mod. /// </summary> /// <remarks> /// This cancels the compression if the task has been cancelled. /// </remarks> /// <param name="sender">The object that raised the event.</param> /// <param name="e">A <see cref="FileNameEventArgs"/> describing the event arguments.</param> private void Compressor_FileCompressionStarted(object sender, FileNameEventArgs e) { ItemMessage = String.Format("Adding {0}...", e.FileName); e.Cancel = Status == TaskStatus.Cancelling; }
void FileUtilityFileSaved(object sender, FileNameEventArgs e) { fileUtilityFileSavedEventArgs = e; }
/// <summary> /// File Compression Started /// </summary> /// <param name="sender">Object</param> /// <param name="e">Argument</param> private void Cmp_FileCompressionStarted(object sender, FileNameEventArgs e) { tosCmp = new TOSortie(100, string.Format("Compressing \"{0}\" ...", e.FileName), TypeTOSortie.Zip); }
/// <summary> /// Event proxy for FileCompressionStarted. /// </summary> /// <param name="sender">The sender of the event.</param> /// <param name="e">The event arguments.</param> private void FileCompressionStartedEventProxy(object sender, FileNameEventArgs e) { OnEvent(FileCompressionStarted, e, false); }
void cmp_FileCompressionStarted(object sender, FileNameEventArgs e) { label2.Text = String.Format("压缩 \"{0}\"", e.FileName); }
/// <summary> /// Called when a file is about to be added to a new fomod. /// </summary> /// <remarks> /// This cancels the compression if the user has clicked the cancel button of the progress dialog. /// </remarks> /// <param name="sender">The object that raised the event.</param> /// <param name="e">A <see cref="FileNameEventArgs" /> describing the event arguments.</param> protected void FileCompressionStarted(object sender, FileNameEventArgs e) { e.Cancel = ProgressDialog.Cancelled(); }
static private void cmp_FileCompressionStarted(object sender, FileNameEventArgs e) { }
/// <summary> /// Raises events for the GetStream method. /// </summary> /// <param name="index">The current item index.</param> /// <returns>True if not cancelled; otherwise, false.</returns> private bool EventsForGetStream(uint index) { if (!FastCompression) { if (_fileStream != null) { _fileStream.BytesRead += IntEventArgsHandler; } _doneRate += 1.0f / _actualFilesCount; var fiea = new FileNameEventArgs(_files != null? _files[index].Name : _entries[index], PercentDoneEventArgs.ProducePercentDone(_doneRate)); OnFileCompression(fiea); if (fiea.Cancel) { Canceled = true; return false; } } return true; }
void cmp_FileCompressionStarted(object sender, FileNameEventArgs e) { l_CompressStatus.Content = String.Format("Compressing \"{0}\"", e.FileName); e.Cancel = true; }
private void OnFileCompression(FileNameEventArgs e) { if (FileCompressionStarted != null) { FileCompressionStarted(this, e); } }
void cmp_FileCompressionStarted(object sender, FileNameEventArgs e) { l_CompressProgress.Text = String.Format("Compressing \"{0}\"", e.FileName); }