Пример #1
0
        public void TextChanged(IQuickWindow quickWindow, TextChangedEventArgs e)
        {
            var arg = quickWindow.GetArgument();

            if (arg == null)
            {
                GetCache().ClearCache();
                quickWindow.ResetMethods();
                return;
            }

            CalcResult(quickWindow);

            QuickCalcItemType[]  types = { QuickCalcItemType.ToDecimal,
                                           QuickCalcItemType.ToHex,
                                           QuickCalcItemType.ToBinary, };
            List <QuickCalcItem> calcItemList = new List <QuickCalcItem>();

            foreach (var type in types)
            {
                QuickCalcItem item = new QuickCalcItem(GetRoot(), type);
                calcItemList.Add(item);
            }
            if (calcItemList.Count > 0)
            {
                quickWindow.ReplaceMethods(calcItemList.ToArray());
            }
        }
Пример #2
0
        public void TextChanged(IQuickWindow quickWindow, TextChangedEventArgs e)
        {
            if (TabKeyPressed)
            {
                TabKeyPressed = false;
                TextDirty     = false;
            }
            else
            {
                TextDirty = true;
            }

            // 在没有参数传进来的时候,因为已经退出了SubModel
            var arg = quickWindow.GetArgument();

            if (arg == null)
            {
                quickWindow.ResetMethods();
                return;
            }

            List <string> matchedFiles = new List <string>();

            matchedFiles = GetCurrentPathFileNames(arg);

            List <QuickRunItem> runItemList = new List <QuickRunItem>();

            foreach (var r in matchedFiles)
            {
                QuickRunItem item = new QuickRunItem(GetRoot(), Path.GetFileNameWithoutExtension(r), MatchCommonShortcutPath(r) ?? r);
                runItemList.Add(item);
            }

            if (runItemList.Count > 0)
            {
                quickWindow.ReplaceMethods(runItemList.ToArray());
            }
            else
            {
                quickWindow.ResetMethods();
            }
        }
Пример #3
0
        private void ReplaceMethods(IQuickWindow quickWindow, int count)
        {
            const int            bufsize      = 260;
            StringBuilder        buf          = new StringBuilder(bufsize);
            List <QuickFindItem> findItemList = new List <QuickFindItem>();

            for (int i = 0; i < count; i++)
            {
                QuickEverything.Everything_GetResultFullPathNameW(i, buf, bufsize);
                EVERYTHING_RESULT result = (EVERYTHING_RESULT)QuickEverything.Everything_GetLastError();
                if (result != EVERYTHING_RESULT.EVERYTHING_OK)
                {
                    continue;
                }

                QuickFindItem item = new QuickFindItem(GetRoot(), buf.ToString());
                findItemList.Add(item);
            }

            quickWindow.ReplaceMethods(findItemList.ToArray());
        }