public FFmpegLogItem(string Name) { this.Name = Name; CopyToClipboardCommand = new DelegateCommand(() => { _complete.ToString().WriteToClipboard(); }); RemoveCommand = new DelegateCommand(() => RemoveRequested?.Invoke()); }
public FFmpegLogItem(string name, IClipboardService clipboardService) { Name = name; CopyToClipboardCommand = new DelegateCommand(() => { clipboardService.SetText(_complete.ToString()); }); RemoveCommand = new DelegateCommand(() => RemoveRequested?.Invoke()); }
public FileRecentItem(string FileName, RecentFileType FileType, bool IsSaving = false) { this.FileName = FileName; this.FileType = FileType; this.IsSaving = IsSaving; Display = Path.GetFileName(FileName); ClickCommand = new DelegateCommand(() => ServiceProvider.LaunchFile(new ProcessStartInfo(FileName))); RemoveCommand = new DelegateCommand(() => RemoveRequested?.Invoke()); var icons = ServiceProvider.Get <IIconSet>(); var loc = ServiceProvider.Get <LanguageManager>(); var windowService = ServiceProvider.Get <IMainWindow>(); Icon = GetIcon(FileType, icons); IconColor = GetColor(FileType); var list = new List <RecentAction> { new RecentAction(loc.CopyPath, icons.Clipboard, () => this.FileName.WriteToClipboard()) }; void AddTrimMedia() { list.Add(new RecentAction(loc.Trim, icons.Trim, () => windowService.TrimMedia(FileName))); } switch (FileType) { case RecentFileType.Image: list.Add(new RecentAction(loc.CopyToClipboard, icons.Clipboard, OnCopyToClipboardExecute)); list.Add(new RecentAction(loc.UploadToImgur, icons.Upload, OnUploadToImgurExecute)); list.Add(new RecentAction(loc.Edit, icons.Pencil, () => windowService.EditImage(FileName))); list.Add(new RecentAction(loc.Crop, icons.Crop, () => windowService.CropImage(FileName))); break; case RecentFileType.Audio: AddTrimMedia(); break; case RecentFileType.Video: AddTrimMedia(); list.Add(new RecentAction("Upload to YouTube", icons.YouTube, () => windowService.UploadToYouTube(FileName))); break; } list.Add(new RecentAction(loc.Delete, icons.Delete, OnDelete)); Actions = list; }
void OnDelete() { if (File.Exists(FileName)) { if (Shell32.FileOperation(FileName, FileOperationType.Delete, 0) != 0) { return; } } // Remove from List RemoveRequested?.Invoke(); }
void OnDelete() { if (File.Exists(FileName)) { var platformServices = ServiceProvider.Get <IPlatformServices>(); if (!platformServices.DeleteFile(FileName)) { return; } } // Remove from List RemoveRequested?.Invoke(); }
public ClockAdapter(Clock clock) { _clock = clock ?? throw new ArgumentNullException(nameof(clock)); if (_clock.Parent != null) { _parent = new ClockAdapter(_clock.Parent); } if (clock.Controller != null) { _clockController = new ClockControllerAdapter(this, _clock.Controller); } _clock.Completed += (sender, e) => Completed?.Invoke(sender, e); _clock.RemoveRequested += (sender, e) => RemoveRequested?.Invoke(sender, e); _clock.CurrentTimeInvalidated += (sender, e) => CurrentTimeInvalidated?.Invoke(sender, e); _clock.CurrentStateInvalidated += (sender, e) => CurrentStateInvalidated?.Invoke(sender, e); _clock.CurrentGlobalSpeedInvalidated += (sender, e) => CurrentGlobalSpeedInvalidated?.Invoke(sender, e); }
public ImgurRecentItem(string Link, string DeleteHash) { this.DeleteHash = DeleteHash; ClickCommand = new DelegateCommand(() => ServiceProvider.LaunchFile(new ProcessStartInfo(Link))); RemoveCommand = new DelegateCommand(() => RemoveRequested?.Invoke()); var icons = ServiceProvider.Get <IIconSet>(); var loc = ServiceProvider.Get <LanguageManager>(); Display = this.Link = Link; Icon = icons.Link; Actions = new[] { new RecentAction(loc.CopyPath, icons.Clipboard, () => this.Link.WriteToClipboard()), new RecentAction(loc.Delete, icons.Delete, OnDelete), }; }
async void OnDelete() { if (!ServiceProvider.MessageProvider.ShowYesNo($"Are you sure you want to Delete: {Link}?", "Confirm Deletion")) { return; } try { await UploaderService.DeleteUploadedFile(DeleteHash); } catch (Exception e) { ServiceProvider.MessageProvider.ShowException(e, $"Could not Delete: {Link}"); return; } RemoveRequested?.Invoke(); }
void OnDelete() { if (!ServiceProvider.MessageProvider.ShowYesNo($"Are you sure you want to Delete: {FileName}?", "Confirm Deletion")) { return; } try { File.Delete(FileName); } catch (Exception e) { ServiceProvider.MessageProvider.ShowException(e, $"Could not Delete: {FileName}"); return; } // Remove from List RemoveRequested?.Invoke(); }
public UploadRecentItem(string link, string deleteHash, IImageUploader uploaderService) { DeleteHash = deleteHash; UploaderService = uploaderService; ClickCommand = new DelegateCommand(() => ServiceProvider.LaunchFile(new ProcessStartInfo(link))); RemoveCommand = new DelegateCommand(() => RemoveRequested?.Invoke()); var icons = ServiceProvider.Get <IIconSet>(); var loc = ServiceProvider.Get <LanguageManager>(); Display = Link = link; Icon = icons.Link; Actions = new[] { new RecentAction(loc.CopyPath, icons.Clipboard, () => Link.WriteToClipboard()), new RecentAction(loc.Delete, icons.Delete, OnDelete) }; }
public UploadRecentItem(string Link, string DeleteHash, IImageUploader UploaderService) { this.DeleteHash = DeleteHash; this.UploaderService = UploaderService; ClickCommand = new DelegateCommand(() => ServiceProvider.LaunchFile(new ProcessStartInfo(Link))); RemoveCommand = new DelegateCommand(() => RemoveRequested?.Invoke()); var icons = ServiceProvider.Get <IIconSet>(); var loc = ServiceProvider.Get <ILocalizationProvider>(); Display = this.Link = Link; Icon = icons.Link; Actions = new[] { new RecentAction(loc.CopyPath, icons.Clipboard, () => this.Link.WriteToClipboard()), new RecentAction(loc.Delete, icons.Delete, OnDelete) }; }
public FFmpegLogItem(string Name, string Args, IClipboardService ClipboardService) { this.Name = Name; this.Args = Args; _complete.AppendLine("ARGS:"); _complete.AppendLine("-------------"); _complete.AppendLine(Args); _complete.AppendLine(); _complete.AppendLine("OUTPUT:"); _complete.AppendLine("-------------"); CopyToClipboardCommand = new DelegateCommand(() => { ClipboardService.SetText(_complete.ToString()); }); RemoveCommand = new DelegateCommand(() => RemoveRequested?.Invoke()); }
public void Remove() => RemoveRequested?.Invoke(DiagramNode);
void OnClose() { RemoveRequested?.Invoke(); }
private void Remove(int index) => RemoveRequested?.Invoke(index);
void removeItemButton_Click(object sender, EventArgs e) { RemoveRequested?.Invoke(this, new EventArgs()); }
public void Remove() => RemoveRequested?.Invoke();
private void remove_Click(object sender, EventArgs e) { RemoveExistingCertificate(); StopRevocationServers(); RemoveRequested?.Invoke(this); }
protected virtual void onRemoveRequested() { RemoveRequested?.Invoke(this, EventArgs.Empty); }
protected virtual void OnRemoveRequested(EventArgs e) => RemoveRequested?.Invoke(this, e);
public void RaiseRemoveRequested() { RemoveRequested?.Invoke(this, EventArgs.Empty); }
public void RequestRemove() => RemoveRequested?.Invoke(DiagramShape);