PathFileParam.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace RecipeEditorLib.RecipeModel.Params
  7. {
  8. public class PathFileParam : Param
  9. {
  10. //value is full path name
  11. private string _value;
  12. public string Value
  13. {
  14. get { return this._value; }
  15. set
  16. {
  17. this._value = value;
  18. if (this.Feedback != null)
  19. {
  20. this.Feedback(this);
  21. }
  22. if (string.IsNullOrEmpty(_value))
  23. {
  24. FileName = "";
  25. }
  26. else
  27. {
  28. //int index = _value.LastIndexOf("\\");
  29. //if (index > -1)
  30. //{
  31. // FileName = _value.Substring(index + 1);
  32. //}
  33. //else
  34. {
  35. FileName = _value;
  36. }
  37. }
  38. this.NotifyOfPropertyChange("Value");
  39. }
  40. }
  41. private string _fileName;
  42. public string FileName
  43. {
  44. get { return _fileName; }
  45. set
  46. {
  47. _fileName = value;
  48. NotifyOfPropertyChange("FileName");
  49. }
  50. }
  51. private string _prefixPath;
  52. public string PrefixPath
  53. {
  54. get { return _prefixPath; }
  55. set
  56. {
  57. _prefixPath = value;
  58. NotifyOfPropertyChange("PrefixPath");
  59. }
  60. }
  61. }
  62. }