public override async Task IterateChildrenAsync()
        {
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            this.Name = this.project.Name;
            if (this.project.ProjectItems?.GetEnumerator().MoveNext() ?? false)
            {
                foreach (ProjectItem child in this.project.ProjectItems)
                {
                    var childItem = await SolutionModelFactory.BuildHierarchyTreeDownAsync(this, child);

                    if (childItem != null)
                    {
                        this.Children.Add(childItem);
                    }
                }
            }
        }
Beispiel #2
0
        protected override async Task ExecuteCommandAsync(OleMenuCommand menuCommand)
        {
            var selectedItems = await this.VisualStudio.GetSolutionWindowSelectedItemsAsync();

            if (selectedItems.Count() != 1)
            {
                this.ShowError("Invalid Selection", "Please select only one item.");
                return;
            }

            var selectedProjectNode = await SolutionModelFactory.BuildHierarchyPathUpAsync(selectedItems.Single()) as ProjectModelBase;

            var automationTestOptions = this.ShowCreateUIAutomationTestsWindow();
            var automationTestFiles   = await UIAutomationTestTemplateInstantiator.InstantiateAsync(selectedProjectNode, automationTestOptions);

            foreach (var file in automationTestFiles)
            {
                await file.OpenAsync();
            }
        }