RecipeSequenceSelectDialogViewModel.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System.Collections.ObjectModel;
  2. using OpenSEMI.ClientBase;
  3. namespace MECF.Framework.UI.Client.CenterViews.Editors.Sequence
  4. {
  5. public class RecipeSequenceSelectDialogViewModel : DialogViewModel<string>
  6. {
  7. public void TreeSelectChanged(FileNode file)
  8. {
  9. this.currentFileNode = file;
  10. }
  11. public void TreeMouseDoubleClick(FileNode file)
  12. {
  13. this.currentFileNode = file;
  14. OK();
  15. }
  16. public void OK()
  17. {
  18. if (this.currentFileNode!=null)
  19. {
  20. if (this.currentFileNode.IsFile)
  21. {
  22. this.DialogResult = this.currentFileNode.FullPath.Trim();
  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. }