RecipeSequenceSelectDialogViewModel.cs 999 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.ObjectModel;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using OpenSEMI.ClientBase;
  8. namespace VirgoUI.Client.Models.Recipe
  9. {
  10. public class RecipeSequenceSelectDialogViewModel : DialogViewModel<string>
  11. {
  12. public void TreeSelectChanged(FileNode file)
  13. {
  14. this.currentFileNode = file;
  15. }
  16. public void OK()
  17. {
  18. if (this.currentFileNode!=null)
  19. {
  20. if (this.currentFileNode.IsFile)
  21. {
  22. this.DialogResult = this.currentFileNode.FullPath;
  23. IsCancel = false;
  24. TryClose(true);
  25. }
  26. }
  27. }
  28. public void Cancel()
  29. {
  30. IsCancel = true;
  31. TryClose(false);
  32. }
  33. public ObservableCollection<FileNode> Files { get; set; }
  34. private FileNode currentFileNode;
  35. }
  36. }