B2026-053-Find-Unlinked-Values-of-Selected

This commit is contained in:
2026-07-30 12:51:24 -04:00
parent bc9407f52f
commit 43b63e2843
+53 -25
View File
@@ -2028,10 +2028,8 @@ namespace Volian.Controls.Library
SearchString = TextSearchString;
Dictionary<string, string> rtnByWord = GetByWordSettings(TextSearchString);
// B2022-031 - added a cbxProcSectSrch to filter out procedure and section titles from global search results.
SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, TextSearchString /*.Replace(@"\",@"\u9586?")*/, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, cbxProcSectSrch.Checked ? 1 : 0, cbxIncROTextSrch.Checked ? ItemSearchIncludeLinks.Value : ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars, unitPrefix, rtnByWord["byWordPrefix"], rtnByWord["byWordSuffix"]);
SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, TextSearchString /*.Replace(@"\",@"\u9586?")*/, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, cbxProcSectSrch.Checked ? 1 : 0, cbxIncROTextSrch.Checked ? ItemSearchIncludeLinks.Value : ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars, unitPrefix, GetByWordSettings(TextSearchString, true), GetByWordSettings(TextSearchString, false));
cmbResultsStyleIndex = 3; // display step text in results
//}
@@ -2065,9 +2063,7 @@ namespace Volian.Controls.Library
if (cbxFndUnLnkROVals.Enabled && cbxFndUnLnkROVals.Checked)
{
Dictionary<string, string> rtnByWord = GetByWordSettings(ROSearchList);
SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, ROSearchList, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, cbxProcSectSrch.Checked ? 1 : 0, ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars, unitPrefix, rtnByWord["byWordPrefix"], rtnByWord["byWordSuffix"]);
SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, ROSearchList, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, cbxProcSectSrch.Checked ? 1 : 0, ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars, unitPrefix, GetByWordSettings(ROSearchList, true), GetByWordSettings(ROSearchList, false));
cmbResultsStyleIndex = 3; // display step text in results
}
else
@@ -2177,27 +2173,59 @@ namespace Volian.Controls.Library
}
OnSearchComplete(new DisplaySearchEventArgs(TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks)));
}
private Dictionary<string, string> GetByWordSettings(string ss)
private string GetByWordSettings(string ss, bool checkstart)
{
Dictionary<string, string> settings = new Dictionary<string, string>();
//if (Regex.IsMatch(ss, @"^[\d\.]")) // starts with a number or '.' decimal pt
//{
// settings.Add("byWordPrefix", @"[^0-9a-zA-Z.vbpi:\\-]");
//}
//else if (Regex.IsMatch(ss, @"^[a-zA-Z]")) // starts with a letter
//{
// settings.Add("byWordPrefix", @"[^a-zA-Z]");
//}
//if (Regex.IsMatch(ss, @"^[\d\.]")) // ends with a number or decimal
//{
// settings.Add("byWordSuffix", @"[^0-9a-zA-Z.vbpi:\\-]");
//}
//else if (Regex.IsMatch(ss, @"[a-zA-Z]$")) // ends with a letter
//{
// settings.Add("byWordSuffix", @"[^a-zA-Z]");
//}
//return settings;
if (ss.Length > 0)
{
//checking start
if (checkstart)
{
// starts with a number or '.' decimal pt
if (char.IsNumber(ss, 0) || ss[0] == '.')
{
return @"[^0-9a-zA-Z.vbpi:\\-]";
}
// starts with a letter
else if (char.IsLetter(ss, 0))
{
return @"[^a-zA-Z]";
}
}
//checking end
else
{
// ends with a number or '.' decimal pt
if (char.IsNumber(ss, ss.Length - 1) || ss[ss.Length - 1] == '.')
{
return @"[^0-9a-zA-Z.vbpi:\\-]";
}
// ends with a letter
else if (char.IsLetter(ss, ss.Length - 1))
{
return @"[^a-zA-Z]";
}
}
}
if (Regex.IsMatch(ss, @"^[\d\.]")) // starts with a number or '.' decimal pt
{
settings.Add("byWordPrefix", @"[^0-9a-zA-Z.vbpi:\\-]");
}
else if (Regex.IsMatch(ss, @"^[a-zA-Z]")) // starts with a letter
{
settings.Add("byWordPrefix", @"[^a-zA-Z]");
}
if (Regex.IsMatch(ss, @"^[\d\.]")) // ends with a number or decimal
{
settings.Add("byWordSuffix", @"[^0-9a-zA-Z.vbpi:\\-]");
}
else if (Regex.IsMatch(ss, @"[a-zA-Z]$")) // ends with a letter
{
settings.Add("byWordSuffix", @"[^a-zA-Z]");
}
return settings;
//default
return string.Empty;
}
private void ClearResults() // B2021-103 if no results when RNO only, clear results list. (moved from btnSearch_Click)
{