本文整理汇总了C#中Query.GetAllRemainingParameter方法的典型用法代码示例。如果您正苦于以下问题:C# Query.GetAllRemainingParameter方法的具体用法?C# Query.GetAllRemainingParameter怎么用?C# Query.GetAllRemainingParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Query
的用法示例。
在下文中一共展示了Query.GetAllRemainingParameter方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Query
public List<Result> Query(Query query)
{
if (string.IsNullOrEmpty(query.GetAllRemainingParameter().Trim()))
{
return new List<Result>();
}
return docSet.Query(query.GetAllRemainingParameter());
}
示例2: Query
public List<Result> Query(Query query)
{
var queryString = query.GetAllRemainingParameter();
S.CoreStuff.WindowList.Clear();
S.CoreStuff.GetWindows();
var filterResults = S.CoreStuff.FilterList(queryString).ToList();
return filterResults.Select(o =>
{
return new Result()
{
Title = o.AppWindow.Title,
SubTitle = o.AppWindow.ProcessTitle,
IcoPath = IconImageDataUri(o.AppWindow),
Action = con =>
{
context.HideApp();
if (con.SpecialKeyState.CtrlPressed)
{
o.AppWindow.PostClose();
o.AppWindow.SwitchTo();
}
else
{
o.AppWindow.SwitchTo();
}
return true;
}
};
}).ToList();
}
示例3: Query
public List<Result> Query(Query query)
{
string param = query.GetAllRemainingParameter().TrimStart();
// Should top results be returned? (true if no search parameters have been passed)
var topResults = string.IsNullOrEmpty(param);
var returnList = cachedBookmarks;
if (!topResults)
{
// Since we mixed chrome and firefox bookmarks, we should order them again
var fuzzyMatcher = FuzzyMatcher.Create(param);
returnList = cachedBookmarks.Where(o => MatchProgram(o, fuzzyMatcher)).ToList();
returnList = returnList.OrderByDescending(o => o.Score).ToList();
}
return returnList.Select(c => new Result()
{
Title = c.Name,
SubTitle = "Bookmark: " + c.Url,
IcoPath = @"Images\bookmark.png",
Score = 5,
Action = (e) =>
{
context.API.HideApp();
context.API.ShellRun(c.Url);
return true;
}
}).ToList();
}
示例4: Query
public List<Result> Query(Query query)
{
if (query == null)
throw new ArgumentNullException("query", "query is null.");
if (query.ActionParameters.Count < 3)
return ShowUsage(query);
_context.API.StartLoadingBar();
BaseTranslateService service;
switch (_settings.ApiName)
{
case SettingElements.K_API_MYMEMORY:
service = new MyMemoryTranslateService(_settings, _context);
break;
case SettingElements.K_API_YANDEX:
default:
service = new YandexTranslateService(_settings, _context);
break;
}
try
{
string queryString = service.GetQueryString(query.GetAllRemainingParameter());
var response = service.GetResponse(queryString);
return service.TransformResponseToResults(response);
}
finally
{
_context.API.StopLoadingBar();
}
}
示例5: QueryInternal
protected override List<Result> QueryInternal(Query query)
{
List<Result> results = new List<Result>();
if (string.IsNullOrEmpty(query.ActionName)) return results;
WebSearch webSearch =
CommonStorage.Instance.UserSetting.WebSearches.FirstOrDefault(o => o.ActionWord == query.ActionName && o.Enabled);
if (webSearch != null)
{
string keyword = query.ActionParameters.Count > 0 ? query.GetAllRemainingParameter() : "";
string title = string.Format("Search {0} for \"{1}\"", webSearch.Title, keyword);
if (string.IsNullOrEmpty(keyword))
{
title = "Search " + webSearch.Title;
}
results.Add(new Result()
{
Title = title,
Score = 6,
IcoPath = webSearch.IconPath,
Action = (c) =>
{
Process.Start(webSearch.Url.Replace("{q}", keyword));
return true;
}
});
}
return results;
}
示例6: QueryInternal
protected override List<Result> QueryInternal(Query query)
{
List<Result> results = new List<Result>();
if (string.IsNullOrEmpty(query.ActionName)) return results;
WebSearch webSearch =
UserSettingStorage.Instance.WebSearches.FirstOrDefault(o => o.ActionWord == query.ActionName && o.Enabled);
if (webSearch != null)
{
string keyword = query.ActionParameters.Count > 0 ? query.GetAllRemainingParameter() : "";
string title = keyword;
string subtitle = "Search " + webSearch.Title;
if (string.IsNullOrEmpty(keyword))
{
title = subtitle;
subtitle = null;
}
context.PushResults(query, new List<Result>()
{
new Result()
{
Title = title,
SubTitle = subtitle,
Score = 6,
IcoPath = webSearch.IconPath,
Action = (c) =>
{
Process.Start(webSearch.Url.Replace("{q}", keyword));
return true;
}
}
});
if (!string.IsNullOrEmpty(keyword))
{
ISuggestionSource sugg = new Google();
var result = sugg.GetSuggestions(keyword);
if (result != null)
{
context.PushResults(query, result.Select(o => new Result()
{
Title = o,
SubTitle = subtitle,
Score = 5,
IcoPath = webSearch.IconPath,
Action = (c) =>
{
Process.Start(webSearch.Url.Replace("{q}", o));
return true;
}
}).ToList());
}
}
}
return results;
}
示例7: Query
public List<Result> Query(Query query)
{
var results = new List<Result>();
List<string> displayData = new List<string>();
if (query.ActionParameters.Count == 0)
{
displayData = dataList;
}
else
{
displayData = dataList.Where(i => i.ToLower().Contains(query.GetAllRemainingParameter().ToLower()))
.ToList();
}
results.AddRange(displayData.Select(o => new Result
{
Title = o,
IcoPath = "Images\\clipboard.png",
Action = c =>
{
if (c.SpecialKeyState.CtrlPressed)
{
context.ShowCurrentResultItemTooltip(o);
return false;
}
else
{
System.Windows.Forms.Clipboard.SetText(o);
context.HideApp();
keyboardSimulator.ModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.VK_V);
return true;
}
}
}).Reverse());
return results;
}
示例8: Query
public List<Result> Query(Query query)
{
var results = new List<Result>();
List<string> displayData;
if (query.ActionParameters.Count == 0)
{
displayData = dataList;
}
else
{
displayData = dataList.Where(i => i.ToLower().Contains(query.GetAllRemainingParameter().ToLower()))
.ToList();
}
results.AddRange(displayData.Select(o => new Result
{
Title = o.Trim(),
IcoPath = "Images\\clipboard.png",
Action = c =>
{
try
{
System.Windows.Forms.Clipboard.SetText(o);
context.API.HideApp();
keyboardSimulator.ModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.VK_V);
return true;
}
catch (Exception e)
{
context.API.ShowMsg("Error", e.Message, null);
return false;
}
}
}).Reverse());
return results;
}