2023-04-13 11:51:03 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
2023-05-10 16:21:45 +08:00
|
|
|
|
namespace MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel.Params
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
|
|
|
|
public class PathFileParam : ParamBaseWithGenericValue<string>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public override string Value
|
|
|
|
|
{
|
|
|
|
|
get => _value;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_value = value;
|
2023-06-16 13:43:26 +08:00
|
|
|
|
ColumnPermChangedCallback?.Invoke(this);
|
2023-04-13 11:51:03 +08:00
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(_value))
|
|
|
|
|
{
|
|
|
|
|
FileName = "";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var index = _value.LastIndexOf("\\", StringComparison.Ordinal);
|
|
|
|
|
FileName = index > -1 ? _value.Substring(index + 1) : _value;
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-29 19:34:16 +08:00
|
|
|
|
NotifyOfPropertyChange();
|
|
|
|
|
|
|
|
|
|
IsSaved = false;
|
2023-04-13 11:51:03 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private string _fileName;
|
|
|
|
|
public string FileName
|
|
|
|
|
{
|
2023-06-29 19:34:16 +08:00
|
|
|
|
get => _fileName;
|
2023-04-13 11:51:03 +08:00
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_fileName = value;
|
|
|
|
|
NotifyOfPropertyChange(nameof(FileName));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private string _prefixPath;
|
|
|
|
|
public string PrefixPath
|
|
|
|
|
{
|
2023-06-29 19:34:16 +08:00
|
|
|
|
get => _prefixPath;
|
2023-04-13 11:51:03 +08:00
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_prefixPath = value;
|
|
|
|
|
NotifyOfPropertyChange(nameof(PrefixPath));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|