当前位置: 首页>>代码示例>>C#>>正文


C# SearchFilter.ClearSearch方法代码示例

本文整理汇总了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;
		}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:52,代码来源:SearchUtility.cs

示例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;
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:52,代码来源:SearchUtility.cs

示例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;
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:41,代码来源:SearchUtility.cs


注:本文中的SearchFilter.ClearSearch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。