本文整理汇总了C#中SearchFilter.ClearSearch方法的典型用法代码示例。如果您正苦于以下问题:C# SearchFilter.ClearSearch方法的具体用法?C# SearchFilter.ClearSearch怎么用?C# SearchFilter.ClearSearch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SearchFilter
的用法示例。
在下文中一共展示了SearchFilter.ClearSearch方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseSearchString
internal static bool ParseSearchString(string searchText, SearchFilter filter)
{
if (string.IsNullOrEmpty(searchText))
{
return false;
}
filter.ClearSearch();
string text = string.Copy(searchText);
SearchUtility.RemoveUnwantedWhitespaces(ref text);
bool result = false;
int i = SearchUtility.FindFirstPositionNotOf(text, " \t,");
if (i == -1)
{
i = 0;
}
while (i < text.Length)
{
int num = text.IndexOfAny(" \t,".ToCharArray(), i);
int num2 = text.IndexOf('"', i);
int num3 = -1;
if (num2 != -1)
{
num3 = text.IndexOf('"', num2 + 1);
if (num3 != -1)
{
num = text.IndexOfAny(" \t,".ToCharArray(), num3);
}
else
{
num = -1;
}
}
if (num == -1)
{
num = text.Length;
}
if (num > i)
{
string text2 = text.Substring(i, num - i);
if (SearchUtility.ParseSingleWord(text2, filter, num2, num3))
{
result = true;
}
else
{
filter.nameFilter = filter.nameFilter + ((!string.IsNullOrEmpty(filter.nameFilter)) ? " " : string.Empty) + text2;
}
}
i = num + 1;
}
return result;
}
示例2: ParseSearchString
internal static bool ParseSearchString(string searchText, SearchFilter filter)
{
if (string.IsNullOrEmpty(searchText))
{
return false;
}
filter.ClearSearch();
string searchString = string.Copy(searchText);
RemoveUnwantedWhitespaces(ref searchString);
bool flag = false;
int startIndex = FindFirstPositionNotOf(searchString, " \t,");
if (startIndex == -1)
{
startIndex = 0;
}
while (startIndex < searchString.Length)
{
int length = searchString.IndexOfAny(" \t,".ToCharArray(), startIndex);
int index = searchString.IndexOf('"', startIndex);
int num4 = -1;
if (index != -1)
{
num4 = searchString.IndexOf('"', index + 1);
if (num4 != -1)
{
length = searchString.IndexOfAny(" \t,".ToCharArray(), num4);
}
else
{
length = -1;
}
}
if (length == -1)
{
length = searchString.Length;
}
if (length > startIndex)
{
string str3 = searchString.Substring(startIndex, length - startIndex);
if (ParseSingleWord(str3, filter, index, num4))
{
flag = true;
}
else
{
filter.nameFilter = filter.nameFilter + (!string.IsNullOrEmpty(filter.nameFilter) ? " " : string.Empty) + str3;
}
}
startIndex = length + 1;
}
return flag;
}
示例3: ParseSearchString
internal static bool ParseSearchString(string searchText, SearchFilter filter)
{
if (string.IsNullOrEmpty(searchText))
return false;
filter.ClearSearch();
string searchString1 = string.Copy(searchText);
SearchUtility.RemoveUnwantedWhitespaces(ref searchString1);
bool flag = false;
int startIndex = SearchUtility.FindFirstPositionNotOf(searchString1, " \t,");
if (startIndex == -1)
startIndex = 0;
int num1;
for (; startIndex < searchString1.Length; startIndex = num1 + 1)
{
num1 = searchString1.IndexOfAny(" \t,".ToCharArray(), startIndex);
int quote1 = searchString1.IndexOf('"', startIndex);
int num2 = -1;
if (quote1 != -1)
{
num2 = searchString1.IndexOf('"', quote1 + 1);
num1 = num2 == -1 ? -1 : searchString1.IndexOfAny(" \t,".ToCharArray(), num2);
}
if (num1 == -1)
num1 = searchString1.Length;
if (num1 > startIndex)
{
string searchString2 = searchString1.Substring(startIndex, num1 - startIndex);
if (SearchUtility.CheckForKeyWords(searchString2, filter, quote1, num2))
{
flag = true;
}
else
{
SearchFilter searchFilter = filter;
string str = searchFilter.nameFilter + (!string.IsNullOrEmpty(filter.nameFilter) ? " " : string.Empty) + searchString2;
searchFilter.nameFilter = str;
}
}
}
return flag;
}