public void InitModel(Lifetime lifetime, GotoByNameModel model)
 {
     model.CaptionText.Value              = "Enter generator name or it's type name:";
     model.IsCheckBoxVisible.Value        = false;
     model.IsCheckBoxCheckerVisible.Value = false;
     model.NotReadyMessage.Value          = "Preparing the list of items, please wait…";
     model.IsCheckBoxChecked.Value        = true;
 }
Ejemplo n.º 2
0
        public void InitModel(Lifetime lifetime, GotoByNameModel model)
        {
            model.IsCheckBoxCheckerVisible.FlowInto(
                lifetime, model.CheckBoxText, flag => flag ? "Middle match" : string.Empty);

            model.CaptionText.Value     = "Enter words:";
            model.NotReadyMessage.Value = "Some textual occurrences may be missing at the moment";
        }
        public void InitModel(Lifetime lifetime, GotoByNameModel model)
        {
            model.IsCheckBoxCheckerVisible.FlowInto(
            lifetime, model.CheckBoxText, flag => flag ? "Middle match" : string.Empty);

              model.CaptionText.Value = "Enter words:";
              model.NotReadyMessage.Value = "Some textual occurances may be missing at the moment";
        }
Ejemplo n.º 4
0
        public GotoWordIndexController(
            [NotNull] Lifetime lifetime, [NotNull] ISolution solution, LibrariesFlag librariesFlag,
            [NotNull] IShellLocks locks, [NotNull] ITaskHost taskHost, [NotNull] GotoByNameModel model)
            : base(lifetime, solution, solution, librariesFlag, locks, taskHost, false, model)
        {
            var manager = GotoByNameModelManager.GetInstance(solution);

            manager.ProcessModel <GotoWordModelInitializer>(Model, lifetime);
        }
        public void Execute(IDataContext context, DelegateExecute nextExecute)
        {
            var solution = context.GetData(DataConstants.SOLUTION);
              if (solution == null)
            return;

              var elements = context.GetData(UnitTestDataConstants.UNIT_TEST_ELEMENTS);
              if (elements == null || elements.ExplicitElements.IsEmpty())
            return;

              // ask user to enter category name, provide nice completition of existing categories

              var categoriesProvider = solution.GetComponent<IUnitTestingCategoriesProvider>();

              var ltd = Lifetimes.Define(solution.GetLifetime());

              var completionPicker = new CompletionPickerPopupDialog(solution.GetComponent<IUIApplication>(), solution.GetComponent<ITooltipManager>(), solution.GetComponent<IMainWindow>(), solution.GetComponent<IWindowsHookManager>(), solution.GetComponent<MainWindowPopupWindowContext>(), solution.GetComponent<PopupWindowManager>(), solution)
              {
            LabelText = new RichTextBlock("Enter category name"),
            Text = "Tag tests"
              };
              var settings = new CompletionPickerSettings();
              var completion = new GotoByNameModel(ltd.Lifetime);
              completion.FilterText.Change.Advise(ltd.Lifetime, args =>
              {
            completion.Items.Clear();
            if (!args.HasNew)
              return;
            completion.Items.AddRange(SuggestCategories(categoriesProvider, args.New).Select(str => new JetPopupMenuItem(str, new SimpleMenuItem(str, UnitTestingThemedIcons.Category.Id, null))));
              });
              settings.CompletionModel.Value = completion;
              completionPicker.Settings.Value = settings;

              if (completionPicker.ShowDialog() == DialogResult.OK)
              {
            // finally mark explicitly selected tests with chosen category
            var psiServices = solution.GetComponent<IPsiServices>();
            psiServices.Transactions.Execute("Tag test", () =>
            {
              foreach (var element in elements.ExplicitElements)
            element.MarkWithCategory(completionPicker.TypeChooserText.Value);
            });
              }

              ltd.Terminate();
        }
Ejemplo n.º 6
0
        private static void MakeBusyIconVisibleOnEmptyFilter(GotoByNameMenu menu, GotoByNameModel model, Lifetime lifetime)
        {
            EditboxGlyph     glyph  = null;
            EditboxCueBanner banner = null;
            JetPopupMenuView view   = menu.MenuView.GetValue();

            foreach (Control control in view.Title.QuickSearchEditbox.Controls)
            {
                glyph  = glyph ?? control as EditboxGlyph;
                banner = banner ?? control as EditboxCueBanner;
                if (glyph != null && banner != null)
                {
                    break;
                }
            }

            IProperty <bool> property = model.IsReady.CreateNot(lifetime);
            IProperty <bool> target   = new Property <bool>(lifetime, "isShowGlyphDeferred");
            PropertyBindingDeferred <bool> propertyBindingDeferred =
                new PropertyBindingDeferred <bool>(lifetime, property, target, TimeSpan.FromSeconds(0.3));

            target.Change.Advise_HasNew(lifetime, args => glyph.Visible = args.New);
            property.WhenTrueOnce(lifetime, () => banner.Visible        = false);
        }