SVN r834
SVN-Revision: r834
This commit is contained in:
@@ -41,6 +41,10 @@ namespace Lskj.Control
|
||||
/// 存储原文件名
|
||||
/// </summary>
|
||||
public string lasttext;
|
||||
/// <summary>
|
||||
/// 是否变更新增
|
||||
/// </summary>
|
||||
public bool changeAdd;
|
||||
public LabelRemarkEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -60,35 +64,25 @@ namespace Lskj.Control
|
||||
{
|
||||
var file = ((string[])e.Data.GetData(DataFormats.FileDrop))[0];
|
||||
string filename = Path.GetFileName(file);
|
||||
if (!string.IsNullOrEmpty(lasttext))
|
||||
if (!string.IsNullOrEmpty(lasttext) && string.Equals(lasttext, filename, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (string.Equals(lasttext, filename, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
|
||||
MessageUtil.Show("检测到更改文件和原文件完全一样!");
|
||||
}
|
||||
else
|
||||
{
|
||||
string prefix1 = GetPrefixBeforeLastS(filename, StringComparison.OrdinalIgnoreCase);
|
||||
string prefix2 = GetPrefixBeforeLastS(lasttext, StringComparison.OrdinalIgnoreCase);
|
||||
if (string.Equals(prefix1, prefix2, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
txtEdit.Text = filename;
|
||||
this.filepath = file;
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageUtil.Show("检测到更改文件和原文件不匹配!");
|
||||
}
|
||||
}
|
||||
MessageUtil.Show("检测到更改文件和原文件完全一样!");
|
||||
}
|
||||
else
|
||||
{
|
||||
txtEdit.Text = filename;
|
||||
this.filepath = file;
|
||||
OnLastTextEmpty();
|
||||
string prefix1 = GetPrefixBeforeLastS(filename, StringComparison.OrdinalIgnoreCase);
|
||||
string prefix2 = GetPrefixBeforeLastS(lasttext, StringComparison.OrdinalIgnoreCase);
|
||||
if (!string.IsNullOrEmpty(lasttext) && !string.Equals(prefix1, prefix2, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
MessageUtil.Show("检测到更改文件和原文件不匹配!");
|
||||
}
|
||||
else
|
||||
{
|
||||
txtEdit.Text = filename;
|
||||
this.filepath = file;
|
||||
OnLastTextEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 拖拽为空触发回调
|
||||
|
||||
Reference in New Issue
Block a user