/// <summary>
        /// Returns the name of the generated file that will contain the interface.
        /// </summary>
        public string GetTargetFileName()
        {
            var dialog = DialogHelpers.GetOpenDialogById(GetMainWindowHWnd(), ExtractInterfaceDialogID);

            var fileNameTextBox = dialog.FindDescendantByAutomationId("FileNameTextBox");

            return(fileNameTextBox.GetValue());
        }
        /// <summary>
        /// Clicks the checkbox on the given item, cycling it from on to off or from off to on.
        /// </summary>
        /// <param name="item"></param>
        public void ToggleItem(string item)
        {
            var dialog = DialogHelpers.GetOpenDialogById(GetMainWindowHWnd(), ExtractInterfaceDialogID);

            var memberSelectionList = dialog.FindDescendantByAutomationId("MemberSelectionList");
            var checkBox            = memberSelectionList.FindDescendantByAutomationId(item);

            checkBox.Toggle();
        }
Exemple #3
0
        public IUIAutomationElement GetDialog(string dialogAutomationId)
        {
            var dialog = DialogHelpers.GetOpenDialogById(
                _instance.Shell.GetHWnd(),
                dialogAutomationId
                );

            return(dialog);
        }
        public string[] GetNewFileComboBoxItems()
        {
            var dialog = DialogHelpers.GetOpenDialogById(GetMainWindowHWnd(), GenerateTypeDialogID);
            var createNewFileComboBox = dialog.FindDescendantByAutomationId("CreateNewFileComboBox");

            createNewFileComboBox.Expand();

            var children = createNewFileComboBox.FindDescendantsByClass("ListBoxItem");

            createNewFileComboBox.Collapse();

            return(children.Cast <AutomationElement>().Select(element => element.Current.Name).ToArray());
        }
Exemple #5
0
        /// <summary>
        /// Gets the set of members that are currently checked.
        /// </summary>
        public string[] GetSelectedItems()
        {
            var dialog = DialogHelpers.GetOpenDialogById(GetMainWindowHWnd(), ExtractInterfaceDialogID);

            var memberSelectionList = dialog.FindDescendantByAutomationId("MemberSelectionList");
            var listItems           = memberSelectionList.FindDescendantsByClass("ListBoxItem");

            return(listItems.Cast <AutomationElement>()
                   .Select(item => item.FindDescendantByClass("CheckBox"))
                   .Where(checkBox => checkBox.IsToggledOn())
                   .Select(checkbox => checkbox.Current.AutomationId)
                   .ToArray());
        }
        public string[] GetNewFileComboBoxItems()
        {
            var dialog = DialogHelpers.GetOpenDialogById(GetMainWindowHWnd(), GenerateTypeDialogID);
            var createNewFileComboBox = dialog.FindDescendantByAutomationId("CreateNewFileComboBox");

            createNewFileComboBox.Expand();

            var children = createNewFileComboBox.FindDescendantsByClass("ListBoxItem");

            createNewFileComboBox.Collapse();

            var result = new string[children.Length];

            for (int i = 0; i < children.Length; i++)
            {
                result[i] = children.GetElement(i).CurrentName;
            }

            return(result);
        }