ParameterSelectDialogViewModel.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System.Collections.ObjectModel;
  2. using System.Linq;
  3. using MECF.Framework.UI.Client.CenterViews.Editors.Recipe;
  4. using MECF.Framework.UI.Client.CenterViews.Editors.Sequence;
  5. using OpenSEMI.ClientBase;
  6. namespace MECF.Framework.UI.Client.CenterViews.Editors.Parameter
  7. {
  8. public class ParameterSelectDialogViewModel : DialogViewModel<string>
  9. {
  10. public ObservableCollection<ProcessTypeFileItem> ProcessTypeFileList { get; set; }
  11. public FileNode CurrentFileNode { get; set; }
  12. public int ProcessTypeIndexSelection { get; set; }
  13. public ObservableCollection<FileNode> Files { get; set; }
  14. private FileNode currentFileNode;
  15. public void TreeSelectChanged(FileNode file)
  16. {
  17. this.currentFileNode = file;
  18. }
  19. public void TreeMouseDoubleClick(FileNode file)
  20. {
  21. this.currentFileNode = file;
  22. OK();
  23. }
  24. public void OK()
  25. {
  26. if (this.currentFileNode != null)
  27. {
  28. if (this.currentFileNode.IsFile)
  29. {
  30. //this.DialogResult = currentFileNode.PrefixPath + "\\" + currentFileNode.FullPath;
  31. this.DialogResult = currentFileNode.FullPath;
  32. IsCancel = false;
  33. TryClose(true);
  34. }
  35. }
  36. else
  37. {
  38. IsCancel = true;
  39. TryClose(false);
  40. }
  41. }
  42. public void Cancel()
  43. {
  44. IsCancel = true;
  45. TryClose(false);
  46. }
  47. }
  48. }