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


C# Query.GetAllRemainingParameter方法代码示例

本文整理汇总了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());
        }
开发者ID:Wox-launcher,项目名称:Wox.Plugin.Doc,代码行数:9,代码来源:Main.cs

示例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();
        }
开发者ID:modulexcite,项目名称:Wox.Plugin.Switcheroo,代码行数:32,代码来源:Plugin.cs

示例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();
        }
开发者ID:Jackie-Innover,项目名称:Wox,代码行数:31,代码来源:Main.cs

示例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();
            }
        }
开发者ID:Plasma-Paris,项目名称:Wox.Plugins,代码行数:33,代码来源:Main.cs

示例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;
        }
开发者ID:Rovak,项目名称:Wox,代码行数:31,代码来源:WebSearchPlugin.cs

示例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;
        }
开发者ID:ZhangHongJi,项目名称:Wox,代码行数:58,代码来源:WebSearchPlugin.cs

示例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;
        }
开发者ID:Rovak,项目名称:Wox,代码行数:36,代码来源:Main.cs

示例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;
        }
开发者ID:Wox-launcher,项目名称:Wox.Plugin.ClipboardManager,代码行数:36,代码来源:Main.cs


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