Exemplo n.º 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());
            }
        }
Exemplo n.º 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();
            }
        }
Exemplo n.º 3
0
        public void TextChanged(IQuickWindow quickWindow, System.Windows.Controls.TextChangedEventArgs e)
        {
            ResetPage();

            var timer = GetTimer(quickWindow);

            timer.Stop();

            var arg = quickWindow.GetArgument();

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

            timer.Start();
        }