B2026-053-Find-Unlinked-Values-of-Selected
This commit is contained in:
@@ -2078,7 +2078,7 @@ namespace Volian.Controls.Library
|
|||||||
|
|
||||||
if (cbxFndUnLnkROVals.Enabled && cbxFndUnLnkROVals.Checked)
|
if (cbxFndUnLnkROVals.Enabled && cbxFndUnLnkROVals.Checked)
|
||||||
{
|
{
|
||||||
string ROSearchList2 = checkPercentChar(ROSearchList); // B2026-053 match exact string
|
string ROSearchList2 = exactsearch(ROSearchList); // B2026-053 match exact string
|
||||||
// B2022-031 - added a cbxProcSectSrch to filter out procedure and section titles from global search results.
|
// B2022-031 - added a cbxProcSectSrch to filter out procedure and section titles from global search results.
|
||||||
SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, ROSearchList2, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, cbxProcSectSrch.Checked ? 1 : 0, ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars, unitPrefix, string.Empty, string.Empty);
|
SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, ROSearchList2, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, cbxProcSectSrch.Checked ? 1 : 0, ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars, unitPrefix, string.Empty, string.Empty);
|
||||||
cmbResultsStyleIndex = 3; // display step text in results
|
cmbResultsStyleIndex = 3; // display step text in results
|
||||||
@@ -2191,50 +2191,23 @@ namespace Volian.Controls.Library
|
|||||||
OnSearchComplete(new DisplaySearchEventArgs(TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks)));
|
OnSearchComplete(new DisplaySearchEventArgs(TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private string checkPercentChar(string SearchString) // B2026-053
|
private string exactsearch(string SearchString) // B2026-053
|
||||||
{
|
{
|
||||||
string ss = "";
|
StringBuilder ss = new StringBuilder();
|
||||||
string pattern = "%"; // B2026-053 Pattern to match the percentage sign
|
int sl = SearchString.Length;
|
||||||
Match match = Regex.Match(SearchString, pattern);
|
int LstIdxSp = SearchString.LastIndexOf(' ');
|
||||||
if (match.Success) // Special case for percents.
|
if (sl == LstIdxSp + 1) // B2026-053 if ' ' the last char.
|
||||||
{
|
{
|
||||||
int sl = SearchString.Length;
|
ss.Append(' ');
|
||||||
int precentIdx = SearchString.LastIndexOf('%');
|
ss.Append(SearchString); // B2026-053 add a space prefix to make the search exact if the end of the searchString is a space.
|
||||||
int startIndex = 0;
|
|
||||||
if (sl == precentIdx + 1) // % the last char.
|
|
||||||
{
|
|
||||||
ss = SearchString.Substring(startIndex, sl - 1);
|
|
||||||
var isNumeric = int.TryParse(ss, out int n);
|
|
||||||
if (isNumeric == true) // B2026-053 other that a % are the rest of the characters numbers.
|
|
||||||
{
|
|
||||||
ss = ' ' + SearchString + ' '; // to get exact match add spaces before and after search string.
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ss = ' ' + SearchString + ' '; // string it not a percent.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int strl2 = SearchString.Length;
|
|
||||||
int prcIdx2 = SearchString.LastIndexOf(' ');
|
|
||||||
int strIdx2 = 0;
|
|
||||||
if (strl2 == prcIdx2 + 1) // if the last char is ' ' the last char.
|
|
||||||
{
|
|
||||||
ss = ' ' + SearchString; //B2026-053 add a space prefix to make the search exact. If search is 5% this makes it excult 25% 55% etc.;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ss = ' ' + SearchString + ' '; // Exact match add spaces before and after search string.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ss = ' ' + SearchString + ' '; // Exact match add spaces before and after search string.
|
ss.Append(' ');
|
||||||
|
ss.Append(SearchString); // B2026-053 Exact match add spaces before and after searchString.
|
||||||
|
ss.Append(' ');
|
||||||
}
|
}
|
||||||
return ss;
|
return ss.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ClearResults() // B2021-103 if no results when RNO only, clear results list. (moved from btnSearch_Click)
|
private void ClearResults() // B2021-103 if no results when RNO only, clear results list. (moved from btnSearch_Click)
|
||||||
|
|||||||
Reference in New Issue
Block a user