Supporting logic to handle the use of the backslash character

Supporting logic to handle the use of the backslash character, and question marks
Supporting logic to handle the use of the backslash character, dashes, and symbols
Supporting logic to handle the use of the backslash character and dashes
This commit is contained in:
2016-06-21 15:15:01 +00:00
parent 66b9792324
commit 4c6d09803d
17 changed files with 149 additions and 31 deletions

View File

@@ -174,16 +174,32 @@ namespace Volian.Controls.Library
doingfind = false;
this.Visible = false;
}
private string FixSymbol(string str)
{
StringBuilder sb = new StringBuilder();
foreach (char c in str)
{
if (c > 0xff)
sb.Append(string.Format(@"\u{0}?", (int)c));
else
sb.Append(c);
}
return sb.ToString();
}
private void btnFindNext_Click(object sender, EventArgs e)
{
AddToComboLists();
doingfind = true;
string fndStr = FixSymbol(cmboFindText.Text.Replace(@"\", @"\u9586?").Replace("-", @"\u8209?").Replace("\xa0", @"\u160?"));
while (!MyEditItem.FindText(cmboFindText.Text, cbxCaseSensitive.Checked, cbxWholeWord.Checked, cbxReverse.Checked))
{
ItemInfo next = (cbxReverse.Checked) ? MyEditItem.MyItemInfo.SearchPrev : MyEditItem.MyItemInfo.SearchNext;
while ((next != null) && !next.IsSection && !next.MyContent.Text.ToUpper().Contains(cmboFindText.Text.ToUpper()))
while ((next != null) && !next.IsSection && !next.MyContent.Text.Contains(fndStr))
{
next = (cbxReverse.Checked) ? next.SearchPrev : next.SearchNext;
}
if (next != null) Console.WriteLine("next {0} {1}", next.ItemID, next.MyContent.Text);
if ((next == null) || next.IsSection)
{
if (!findingbookmarks)