SequenceDialogViewModel.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System.Collections.ObjectModel;
  2. using MECF.Framework.UI.Client.CenterViews.Editors.Sequence;
  3. using OpenSEMI.ClientBase;
  4. namespace MECF.Framework.UI.Client.CenterViews.Operations.WaferAssociation
  5. {
  6. public class SequenceDialogViewModel : DialogViewModel<string>
  7. {
  8. public void TreeSelectChanged(FileNode file)
  9. {
  10. this.currentFileNode = file;
  11. }
  12. public void TreeMouseDoubleClick(FileNode file)
  13. {
  14. this.currentFileNode = file;
  15. OK();
  16. }
  17. public void OK()
  18. {
  19. if (this.currentFileNode != null)
  20. {
  21. if (this.currentFileNode.IsFile)
  22. {
  23. this.DialogResult = this.currentFileNode.FullPath;
  24. IsCancel = false;
  25. TryClose(true);
  26. }
  27. }
  28. }
  29. public void Cancel()
  30. {
  31. IsCancel = true;
  32. TryClose(false);
  33. }
  34. public ObservableCollection<FileNode> Files { get; set; }
  35. private FileNode currentFileNode;
  36. }
  37. }