├── .gitattributes ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature_request.md │ └── general-question.md ├── dependabot.yml ├── policies │ └── resourceManagement.yml └── pull_request_template.md ├── .gitignore ├── CODE_OF_CONDUCT.md ├── Contributing.md ├── LICENSE ├── README.md ├── SECURITY.md ├── brand ├── brand-blue-128px.png └── brand-blue-48px.png ├── build ├── NetStandardAll.targets ├── NetStandardRelease.targets ├── NetStandardTest.targets ├── check-dependencies.yml ├── common.targets ├── delaysign.targets ├── prbuild.yml ├── settings.targets └── signedbuild.yml ├── docs ├── AccessingInternals.md ├── AddUnitTests.md ├── AutomationReference.md ├── BuildingTheCode.md ├── CustomUIA.md ├── DebuggingTips.md ├── FAQ.md ├── GitBranchSetup.md ├── NewProject.md ├── Overview.md ├── RulesDescription.md ├── RulesOverview.md ├── SetUpDevEnv.md ├── Telemetry.md ├── UnitTestBarAndStandards.md ├── VirusScannerExclusions.md ├── localization.md └── solution.md ├── keys └── FinalPublicKey.snk ├── src ├── .editorconfig ├── Actions │ ├── Actions.csproj │ ├── Actions │ │ ├── CaptureAction.cs │ │ ├── ControlPatternAction.cs │ │ ├── CustomUIAAction.cs │ │ ├── DataManager.cs │ │ ├── GetDataAction.cs │ │ ├── ListenAction.cs │ │ ├── LoadAction.cs │ │ ├── LoadActionParts.cs │ │ ├── PrivacyExtensions.cs │ │ ├── SaveAction.cs │ │ ├── ScreenShotAction.cs │ │ ├── SelectAction.cs │ │ ├── SetDataAction.cs │ │ └── StreamName.cs │ ├── AssemblyInfo.cs │ ├── Attributes │ │ └── InteractionLevelAttribute.cs │ ├── Contexts │ │ ├── DefaultActionContext.cs │ │ ├── ElementContext.cs │ │ ├── ElementDataContext.cs │ │ ├── IActionContext.cs │ │ └── ScopedActionContext.cs │ ├── Enums │ │ └── Enums.cs │ ├── Misc │ │ └── ExtensionMethods.cs │ ├── Resources │ │ ├── ErrorMessages.Designer.cs │ │ └── ErrorMessages.resx │ └── Trackers │ │ ├── BaseTracker.cs │ │ ├── FocusTracker.cs │ │ ├── MouseTracker.cs │ │ └── TreeTracker.cs ├── ActionsTests │ ├── Actions │ │ ├── CaptureActionTests.cs │ │ ├── DataManagerTests.cs │ │ └── ScreenShotActionTests.cs │ ├── ActionsTests.csproj │ ├── Contexts │ │ ├── DefaultActionContextTests.cs │ │ └── ScopedActionContextTests.cs │ └── Misc │ │ └── ExtensionMethodsTests.cs ├── Attributes │ └── AttributesInfo.cs ├── Automation │ ├── AssemblyInfo.cs │ ├── Automation.csproj │ ├── AxeWindowsActions.cs │ ├── AxeWindowsAutomationException.cs │ ├── DPIAwareness.cs │ ├── Data │ │ ├── Config.cs │ │ ├── ElementInfo.cs │ │ ├── OutputFile.cs │ │ ├── ScanOptions.cs │ │ ├── ScanOutput.cs │ │ ├── ScanResult.cs │ │ └── WindowScanOutput.cs │ ├── Enums │ │ └── OutputFileFormat.cs │ ├── Factory.cs │ ├── Interfaces │ │ ├── IAxeWindowsActions.cs │ │ ├── IDPIAwareness.cs │ │ ├── IFactory.cs │ │ ├── IOutputFileHelper.cs │ │ ├── IScanResultsAssembler.cs │ │ ├── IScanTools.cs │ │ ├── IScanToolsBuilder.cs │ │ ├── IScanner.cs │ │ └── ITargetElementLocator.cs │ ├── OutputFileHelper.cs │ ├── ReadMe.md │ ├── Resources │ │ ├── ErrorMessages.Designer.cs │ │ └── ErrorMessages.resx │ ├── ScanResultsAssembler.cs │ ├── ScanTools.cs │ ├── ScanToolsBuilder.cs │ ├── Scanner.cs │ ├── ScannerFactory.cs │ ├── SnapshotCommand.cs │ └── TargetElementLocator.cs ├── AutomationTests │ ├── A11yAutomationUtilities.cs │ ├── AutomationIntegrationTests.cs │ ├── AutomationTests.csproj │ ├── ConfigTests.cs │ ├── DummyDisposable.cs │ ├── OutputFileHelperTests.cs │ ├── ScanResultsAssemblerTests.cs │ ├── ScanToolsBuilderTests.cs │ ├── SnapshotCommandTests.cs │ └── TimedExecutionWrapper.cs ├── AxeWindows.sln ├── CI │ ├── App.config │ ├── Axe.Windows.nuspec │ ├── CI.csproj │ ├── Program.cs │ └── packages.config ├── CLI │ ├── AppManifests │ │ └── app.manifest │ ├── AssemblyInfo.cs │ ├── BrowserAbstraction.cs │ ├── CLI.csproj │ ├── IBrowserAbstraction.cs │ ├── IOptions.cs │ ├── IOutputGenerator.cs │ ├── IProcessAbstraction.cs │ ├── IProcessHelper.cs │ ├── IScanDelay.cs │ ├── Options.cs │ ├── OptionsEvaluator.cs │ ├── OutputGenerator.cs │ ├── ParameterException.cs │ ├── ProcessAbstraction.cs │ ├── ProcessHelper.cs │ ├── Program.cs │ ├── README.MD │ ├── Resources │ │ ├── DisplayStrings.Designer.cs │ │ ├── DisplayStrings.resx │ │ ├── OptionsHelpText.Designer.cs │ │ └── OptionsHelpText.resx │ ├── ReturnValueChooser.cs │ ├── ScanDelay.cs │ ├── ScanRunner.cs │ └── VerbosityLevel.cs ├── CLITests │ ├── CLITests.csproj │ ├── OptionsEvaluatorTests.cs │ ├── OptionsTests.cs │ ├── OutputGeneratorTests.cs │ ├── ProcessHelperTests.cs │ ├── ScanDelayTests.cs │ └── TextWriterVerifier.cs ├── CLI_Full │ ├── BuildNotes.md │ └── CLI_Full.csproj ├── CLI_Installer │ ├── CLI_Installer.wixproj │ ├── Product.wxs │ └── Resources │ │ ├── DialogBackground.png │ │ ├── WixDialogBanner.png │ │ └── eula.rtf ├── Core │ ├── AssemblyInfo.cs │ ├── Attributes │ │ ├── PatternEventAttribute.cs │ │ └── PatternMethodAttribute.cs │ ├── Bases │ │ ├── A11yElement.cs │ │ ├── A11yElementData.cs │ │ ├── A11yPattern.cs │ │ ├── A11yPatternProperty.cs │ │ ├── A11yProperty.cs │ │ ├── IA11yElement.cs │ │ ├── IA11yEventMessage.cs │ │ ├── IA11yPattern.cs │ │ └── ICoreA11yElement.cs │ ├── Core.csproj │ ├── CustomObjects │ │ ├── Config.cs │ │ ├── Converters │ │ │ ├── BoolTypeConverter.cs │ │ │ ├── DoubleTypeConverter.cs │ │ │ ├── ElementTypeConverter.cs │ │ │ ├── EnumTypeConverter.cs │ │ │ ├── ITypeConverter.cs │ │ │ ├── IntTypeConverter.cs │ │ │ ├── PointTypeConverter.cs │ │ │ └── StringTypeConverter.cs │ │ └── CustomProperty.cs │ ├── Enums │ │ ├── CustomUIAPropertyType.cs │ │ ├── FrameworkId.cs │ │ ├── OrientationType.cs │ │ ├── RuleId.cs │ │ ├── TreeViewMode.cs │ │ └── UrlType.cs │ ├── Exceptions │ │ ├── AxeWindowsException.cs │ │ └── TreeNavigationFailedException.cs │ ├── HelpLinks │ │ └── HelpUrl.cs │ ├── Misc │ │ ├── BoundedCounter.cs │ │ ├── Delegates.cs │ │ ├── ExtensionMethods.cs │ │ ├── FileHelpers.cs │ │ ├── ListHelper.cs │ │ ├── PackageInfo.cs │ │ └── Utility.cs │ ├── Resources │ │ ├── DisplayStrings.Designer.cs │ │ ├── DisplayStrings.resx │ │ ├── ErrorMessages.Designer.cs │ │ └── ErrorMessages.resx │ ├── Results │ │ ├── RuleResult.cs │ │ ├── ScanMetaInfo.cs │ │ ├── ScanResult.cs │ │ ├── ScanResults.cs │ │ └── ScanStatus.cs │ └── Types │ │ ├── ControlType.cs │ │ ├── HeadingLevelType.cs │ │ ├── LandmarkType.cs │ │ ├── LegacyIAccessibleRoleType.cs │ │ ├── PatternType.cs │ │ ├── PlatformPropertyType.cs │ │ ├── PropertyType.cs │ │ └── TypeBase.cs ├── CoreTests │ ├── Bases │ │ ├── A11yElementTests.cs │ │ ├── A11yPatternPropertyTests.cs │ │ ├── A11yPatternTests.cs │ │ └── A11yPropertyTests.cs │ ├── CoreTests.csproj │ ├── CustomObjects │ │ ├── ConfigTests.cs │ │ ├── Converters │ │ │ ├── BoolConverterTests.cs │ │ │ ├── DoubleConverterTests.cs │ │ │ ├── ElementConverterTests.cs │ │ │ ├── EnumConverterTests.cs │ │ │ ├── IntConverterTests.cs │ │ │ ├── PointConverterTests.cs │ │ │ └── StringConverterTests.cs │ │ └── CustomPropertyTests.cs │ ├── Misc │ │ ├── BoundedCounterTests.cs │ │ ├── MiscTests.cs │ │ ├── PackageInfoTests.cs │ │ └── UtilityTests.cs │ ├── Resources │ │ ├── A11yElementTest.hier │ │ ├── A11yPatternTest.hier │ │ └── A11yPropertyTest.hier │ ├── Results │ │ └── ScanMetaInfoTests.cs │ └── Types │ │ ├── ControlTypesTests.cs │ │ ├── HeadingLevelTypeTests.cs │ │ ├── LegacyIAccessibleRuleTypeTests.cs │ │ ├── PatternTypesTests.cs │ │ ├── PropertyTypesTests.cs │ │ └── TypeBaseTests.cs ├── CurrentFileVersionCompatibilityTests │ ├── App.config │ ├── Assert.cs │ ├── CurrentFileVersionCompatibilityTests.csproj │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── packages.config ├── Desktop │ ├── AssemblyInfo.cs │ ├── ColorContrastAnalyzer │ │ ├── AnalyzerVersion.cs │ │ ├── BitmapCollection.cs │ │ ├── Color.cs │ │ ├── ColorContrastConfig.cs │ │ ├── ColorContrastConfigBuilder.cs │ │ ├── ColorContrastResult.cs │ │ ├── ColorContrastResultV2.cs │ │ ├── ColorContrastRunner.cs │ │ ├── ColorContrastRunnerV2.cs │ │ ├── ColorPair.cs │ │ ├── ContrastTransition.cs │ │ ├── CountMap.cs │ │ ├── IColorContrastConfig.cs │ │ ├── IColorContrastResult.cs │ │ ├── ImageCollection.cs │ │ ├── Pixel.cs │ │ ├── RowResultV2.cs │ │ └── RowResultV2Accumulator.cs │ ├── Desktop.csproj │ ├── Resources │ │ ├── ErrorMessages.Designer.cs │ │ └── ErrorMessages.resx │ ├── Settings │ │ └── SnapshotMetaInfo.cs │ ├── Styles │ │ ├── ActiveEnd.cs │ │ ├── AnimationStyle.cs │ │ ├── BulletStyle.cs │ │ ├── CapStyle.cs │ │ ├── CaretBidiMode.cs │ │ ├── CaretPosition.cs │ │ ├── FlowDirection.cs │ │ ├── FontWeight.cs │ │ ├── HorizontalTextAlignment.cs │ │ ├── OutlineStyle.cs │ │ ├── SayAsInterpretAs.cs │ │ ├── StyleId.cs │ │ └── TextDecorationLineStyle.cs │ ├── Types │ │ ├── AnnotationType.cs │ │ ├── ChangeInfoType.cs │ │ ├── EventType.cs │ │ ├── ListenScope.cs │ │ ├── TextAttributeTemplate.cs │ │ └── TextAttributeType.cs │ ├── UIAutomation │ │ ├── A11yAutomation.cs │ │ ├── A11yPatternFactory.cs │ │ ├── CustomObjects │ │ │ └── Registrar.cs │ │ ├── DesktopDataContext.cs │ │ ├── DesktopElement.cs │ │ ├── DesktopElementExtensionMethods.cs │ │ ├── DesktopElementHelper.cs │ │ ├── EventHandlers │ │ │ ├── ActiveTextPositionChangedEventListener.cs │ │ │ ├── ChangesEventListener.cs │ │ │ ├── EventListener.cs │ │ │ ├── EventListenerBase.cs │ │ │ ├── EventListenerFactory.cs │ │ │ ├── EventMessage.cs │ │ │ ├── FocusChangedEventListener.cs │ │ │ ├── NotificationEventListener.cs │ │ │ ├── PropertyChangedEventListener.cs │ │ │ ├── StructureChangedEventListener.cs │ │ │ └── TextEditTextChangedEventListener.cs │ │ ├── Patterns │ │ │ ├── AnnotationPattern.cs │ │ │ ├── CustomNavigationPattern.cs │ │ │ ├── DockPattern.cs │ │ │ ├── DragPattern.cs │ │ │ ├── DropTargetPattern.cs │ │ │ ├── ExpandCollapsePattern.cs │ │ │ ├── GridItemPattern.cs │ │ │ ├── GridPattern.cs │ │ │ ├── InvokePattern.cs │ │ │ ├── ItemContainerPattern.cs │ │ │ ├── LegacyIAccessiblePattern.cs │ │ │ ├── MultipleViewPattern.cs │ │ │ ├── ObjectModelPattern.cs │ │ │ ├── RangeValuePattern.cs │ │ │ ├── ScrollItemPattern.cs │ │ │ ├── ScrollPattern.cs │ │ │ ├── SelectionItemPattern.cs │ │ │ ├── SelectionPattern.cs │ │ │ ├── SelectionPattern2.cs │ │ │ ├── SpreadsheetItemPattern.cs │ │ │ ├── SpreadsheetPattern.cs │ │ │ ├── StylesPattern.cs │ │ │ ├── SynchronizedInputPattern.cs │ │ │ ├── TableItemPattern.cs │ │ │ ├── TablePattern.cs │ │ │ ├── TextChildPattern.cs │ │ │ ├── TextEditPattern.cs │ │ │ ├── TextPattern.cs │ │ │ ├── TextPattern2.cs │ │ │ ├── TextRange.cs │ │ │ ├── TogglePattern.cs │ │ │ ├── TransformPattern.cs │ │ │ ├── TransformPattern2.cs │ │ │ ├── UnKnownPattern.cs │ │ │ ├── ValuePattern.cs │ │ │ ├── VirtualizedItemPattern.cs │ │ │ └── WindowPattern.cs │ │ ├── Support │ │ │ └── TextRangeFinder.cs │ │ └── TreeWalkers │ │ │ ├── DesktopElementAncestry.cs │ │ │ ├── TreeWalkerForLive.cs │ │ │ └── TreeWalkerForTest.cs │ └── Utility │ │ ├── ExtensionMethods.cs │ │ ├── ProcessItem.cs │ │ ├── StandardLinksHelper.cs │ │ └── SupportedEvents.cs ├── DesktopTests │ ├── ColorContrastAnalyzer │ │ ├── BitmapCollectionTests.cs │ │ ├── ColorContrastConfigBuilderTests.cs │ │ ├── ColorPairTests.cs │ │ ├── ColorTests.cs │ │ ├── ImageTests.cs │ │ └── ImageTestsV2.cs │ ├── DesktopTests.csproj │ ├── Styles │ │ └── StyleIdTests.cs │ ├── TestImages │ │ ├── button_icon_antialiased.bmp │ │ ├── cortana_with_offset_down.bmp │ │ ├── cortana_with_offset_up.bmp │ │ ├── outlook_get_add_ins.bmp │ │ ├── outlook_share_to_teams.bmp │ │ ├── outlook_translate.bmp │ │ ├── simple_black_and_grey_button.bmp │ │ ├── simple_black_and_white.bmp │ │ ├── simple_black_and_white_title.bmp │ │ ├── simple_blue_and_white_text.bmp │ │ ├── simple_grey_and_white_title.bmp │ │ ├── simple_purple_and_white_button.bmp │ │ ├── simple_white_and_black_text.bmp │ │ ├── visual_studio_tab.bmp │ │ ├── weird_text_arrangement.bmp │ │ ├── wildlife_manager_listbox_beetle.bmp │ │ ├── wildlife_manager_listbox_mouse.bmp │ │ ├── wildlife_manager_listbox_owl.bmp │ │ ├── wildlife_manager_listbox_owl_cropped.bmp │ │ └── wildlife_manager_species_label.bmp │ ├── Types │ │ └── TextAttributeTemplateTests.cs │ ├── UIAutomation │ │ ├── CustomObjects │ │ │ └── RegistrarTests.cs │ │ ├── DesktopDataContextTests.cs │ │ └── TreeWalkers │ │ │ └── TreeWalkerForTestTests.cs │ └── Utility │ │ └── SupportedEventsTests.cs ├── InteropDummy │ ├── InteropDummy.csproj │ └── Program.cs ├── MsiFileTests │ ├── MsiFileTests.csproj │ └── WxsValidationTests.cs ├── OldFileVersionCompatibilityTests │ ├── LoadOldFileVersions.cs │ ├── OldFileVersionCompatibilityTests.csproj │ └── TestFiles │ │ ├── WildlifeManager_AxeWindows_0_1_0.a11ytest │ │ ├── WildlifeManager_AxeWindows_0_2_0.a11ytest │ │ └── WildlifeManager_AxeWindows_0_3_1.a11ytest ├── RuleSelection │ ├── AssemblyInfo.cs │ ├── DefaultReferenceLinks.cs │ ├── Interfaces │ │ ├── IReferenceLink.cs │ │ └── IReferenceLinks.cs │ ├── ReferenceLink.cs │ ├── ReferenceLinks.cs │ ├── Resources │ │ ├── DefaultGuidelineShortDescriptions.Designer.cs │ │ ├── DefaultGuidelineShortDescriptions.resx │ │ ├── DefaultGuidelineUrls.Designer.cs │ │ ├── DefaultGuidelineUrls.resx │ │ ├── ErrorMessages.Designer.cs │ │ └── ErrorMessages.resx │ ├── RuleRunner.cs │ ├── RuleSelection.csproj │ └── RuleVersions.cs ├── RuleSelectionTests │ ├── DefaultReferenceLinksTests.cs │ ├── ReferenceLinksTests.cs │ └── RuleSelectionTests.csproj ├── Rules │ ├── A11yCriteriaId.cs │ ├── AssemblyInfo.cs │ ├── Conditions │ │ ├── AndCondition.cs │ │ ├── Condition.cs │ │ ├── ConditionContext.cs │ │ ├── ContextCondition.cs │ │ ├── ControlTypeCondition.cs │ │ ├── DelegateCondition.cs │ │ ├── NotCondition.cs │ │ ├── OrCondition.cs │ │ ├── PatternCondition.cs │ │ ├── RecursiveCondition.cs │ │ ├── StringDecoratorCondition.cs │ │ ├── TreeDescentCondition.cs │ │ └── ValueCondition.cs │ ├── EvaluationCode.cs │ ├── Extensions │ │ └── ExtensionMethods.cs │ ├── IRuleFactory.cs │ ├── Library │ │ ├── BoundingRectangleCompletelyObscuresContainer.cs │ │ ├── BoundingRectangleContainedInParent.cs │ │ ├── BoundingRectangleDataFormatCorrect.cs │ │ ├── BoundingRectangleNotAllZeros.cs │ │ ├── BoundingRectangleNotNull.cs │ │ ├── BoundingRectangleNotNullListViewXAML.cs │ │ ├── BoundingRectangleNotNullTextBlockXAML.cs │ │ ├── BoundingRectangleNotValidButOffScreen.cs │ │ ├── BoundingRectangleSizeReasonable.cs │ │ ├── ButtonInvokeAndExpandeCollapsePatterns.cs │ │ ├── ButtonInvokeAndTogglePatterns.cs │ │ ├── ButtonShouldHavePatterns.cs │ │ ├── ButtonToggleAndExpandeCollapsePatterns.cs │ │ ├── ChildrenNotAllowedInContentView.cs │ │ ├── ChromiumComponentsShouldUseWebScanner.cs │ │ ├── ClickablePointOffScreen.cs │ │ ├── ClickablePointOnScreen.cs │ │ ├── ClickablePointOnScreenWPF.cs │ │ ├── ComboBoxShouldNotSupportScrollPattern.cs │ │ ├── ControlShouldNotSupportInvokePattern.cs │ │ ├── ControlShouldNotSupportScrollPattern.cs │ │ ├── ControlShouldNotSupportValuePattern.cs │ │ ├── ControlShouldNotSupportWindowPattern.cs │ │ ├── ControlShouldSupportExpandCollapsePattern.cs │ │ ├── ControlShouldSupportGridItemPattern.cs │ │ ├── ControlShouldSupportGridPattern.cs │ │ ├── ControlShouldSupportInvokePattern.cs │ │ ├── ControlShouldSupportScrollItemPattern.cs │ │ ├── ControlShouldSupportSelectionItemPattern.cs │ │ ├── ControlShouldSupportSelectionPattern.cs │ │ ├── ControlShouldSupportSetInfoWPF.cs │ │ ├── ControlShouldSupportSetInfoXAML.cs │ │ ├── ControlShouldSupportSpreadsheetItemPattern.cs │ │ ├── ControlShouldSupportTableItemPattern.cs │ │ ├── ControlShouldSupportTablePattern.cs │ │ ├── ControlShouldSupportTextPattern.cs │ │ ├── ControlShouldSupportTextPatternEditWinform.cs │ │ ├── ControlShouldSupportTogglePattern.cs │ │ ├── ControlShouldSupportTransformPattern.cs │ │ ├── EdgeBrowserHasBeenDeprecated.cs │ │ ├── EditSupportsIncorrectRangeValuePattern.cs │ │ ├── FrameworkDoesNotSupportUIAutomation.cs │ │ ├── HeadingLevelDescendsWhenNested.cs │ │ ├── HelpTextExcludesPrivateUnicodeCharacters.cs │ │ ├── HelpTextNotEqualToName.cs │ │ ├── HyperlinkNameShouldBeUnique.cs │ │ ├── IsContentElementFalseOptional.cs │ │ ├── IsContentElementPropertyExists.cs │ │ ├── IsContentElementTrueOptional.cs │ │ ├── IsControlElementPropertyExists.cs │ │ ├── IsControlElementTrueOptional.cs │ │ ├── IsControlElementTrueRequired.cs │ │ ├── IsControlElementTrueRequiredButtonWPF.cs │ │ ├── IsControlElementTrueRequiredTextInEditXAML.cs │ │ ├── IsKeyboardFocusableDescendantTextPattern.cs │ │ ├── IsKeyboardFocusableFalseButDisabled.cs │ │ ├── IsKeyboardFocusableFalseButOffscreen.cs │ │ ├── IsKeyboardFocusableForCustomShouldBeTrue.cs │ │ ├── IsKeyboardFocusableForListItemShouldBeTrue.cs │ │ ├── IsKeyboardFocusableOnEmptyContainer.cs │ │ ├── IsKeyboardFocusableShouldBeFalse.cs │ │ ├── IsKeyboardFocusableShouldBeTrue.cs │ │ ├── IsKeyboardFocusableTopLevelTextPattern.cs │ │ ├── ItemStatusExists.cs │ │ ├── ItemTypeRecommended.cs │ │ ├── LandmarkBannerIsTopLevel.cs │ │ ├── LandmarkComplementaryIsTopLevel.cs │ │ ├── LandmarkContentInfoIsTopLevel.cs │ │ ├── LandmarkMainIsTopLevel.cs │ │ ├── LandmarkNoDuplicateBanner.cs │ │ ├── LandmarkNoDuplicateContentInfo.cs │ │ ├── ListItemSiblingsUnique.cs │ │ ├── LocalizedControlTypeExcludesPrivateUnicodeCharacters.cs │ │ ├── LocalizedControlTypeIsNotCustom.cs │ │ ├── LocalizedControlTypeIsNotCustomWPFGridCell.cs │ │ ├── LocalizedControlTypeIsNotEmpty.cs │ │ ├── LocalizedControlTypeIsNotNull.cs │ │ ├── LocalizedControlTypeIsNotWhiteSpace.cs │ │ ├── LocalizedControlTypeIsReasonable.cs │ │ ├── LocalizedLandmarkTypeExcludesPrivateUnicodeCharacters.cs │ │ ├── LocalizedLandmarkTypeIsReasonableLength.cs │ │ ├── LocalizedLandmarkTypeNotCustom.cs │ │ ├── LocalizedLandmarkTypeNotEmpty.cs │ │ ├── LocalizedLandmarkTypeNotNull.cs │ │ ├── LocalizedLandmarkTypeNotWhiteSpace.cs │ │ ├── NameExcludesControlType.cs │ │ ├── NameExcludesLocalizedControlType.cs │ │ ├── NameExcludesPrivateUnicodeCharacters.cs │ │ ├── NameIsEmptyButElementIsNotKeyboardFocusable.cs │ │ ├── NameIsInformative.cs │ │ ├── NameIsNotEmpty.cs │ │ ├── NameIsNotNull.cs │ │ ├── NameIsNotWhiteSpace.cs │ │ ├── NameIsNullButElementIsNotKeyboardFocusable.cs │ │ ├── NameIsReasonableLength.cs │ │ ├── NameNoSiblingsOfSameType.cs │ │ ├── NameOnCustomWithParentWPFDataItem.cs │ │ ├── NameOnOptionalType.cs │ │ ├── NameWithValidBoundingRectangle.cs │ │ ├── OrientationPropertyExists.cs │ │ ├── ParentChildShouldNotHaveSameNameAndLocalizedControlType.cs │ │ ├── ProgressBarRangeValue.cs │ │ ├── SelectionItemPatternSingleSelection.cs │ │ ├── SelectionPatternSelectionRequired.cs │ │ ├── SelectionPatternSingleSelection.cs │ │ ├── SiblingUniqueAndFocusable.cs │ │ ├── SiblingUniqueAndFocusableWin32.cs │ │ ├── SiblingUniqueAndNotFocusable.cs │ │ ├── SplitButtonInvokeAndTogglePatterns.cs │ │ └── Structure │ │ │ ├── ContentView │ │ │ ├── Button.cs │ │ │ ├── Calendar.cs │ │ │ ├── CheckBox.cs │ │ │ ├── ComboBox.cs │ │ │ ├── DataGrid.cs │ │ │ ├── Edit.cs │ │ │ ├── Hyperlink.cs │ │ │ ├── List.cs │ │ │ ├── ListItem.cs │ │ │ ├── Menu.cs │ │ │ ├── ProgressBar.cs │ │ │ ├── RadioButton.cs │ │ │ ├── Slider.cs │ │ │ ├── Spinner.cs │ │ │ ├── SplitButton.cs │ │ │ ├── StatusBar.cs │ │ │ ├── Tab.cs │ │ │ ├── Tree.cs │ │ │ └── TreeItem.cs │ │ │ └── ControlView │ │ │ ├── Button.cs │ │ │ ├── Calendar.cs │ │ │ ├── CheckBox.cs │ │ │ ├── ComboBox.cs │ │ │ ├── DataGrid.cs │ │ │ ├── Edit.cs │ │ │ ├── Header.cs │ │ │ ├── HeaderItem.cs │ │ │ ├── Hyperlink.cs │ │ │ ├── Image.cs │ │ │ ├── List.cs │ │ │ ├── ListItem.cs │ │ │ ├── Menu.cs │ │ │ ├── ProgressBar.cs │ │ │ ├── RadioButton.cs │ │ │ ├── Scrollbar.cs │ │ │ ├── SemanticZoom.cs │ │ │ ├── Separator.cs │ │ │ ├── Slider.cs │ │ │ ├── Spinner.cs │ │ │ ├── SplitButton.cs │ │ │ ├── StatusBar.cs │ │ │ ├── Tab.cs │ │ │ ├── Thumb.cs │ │ │ ├── ToolTip.cs │ │ │ ├── Tree.cs │ │ │ └── TreeItem.cs │ ├── Misc │ │ ├── ControlTypeStrings.cs │ │ ├── ControlTypeStrings.tt │ │ └── Helpers.cs │ ├── PropertyConditions │ │ ├── BoolProperties.cs │ │ ├── BoundingRectangle.cs │ │ ├── ClickablePoint.cs │ │ ├── ContentView.cs │ │ ├── Context.cs │ │ ├── ControlType.cs │ │ ├── ControlView.cs │ │ ├── ElementGroups.cs │ │ ├── EnumProperty.cs │ │ ├── Framework.cs │ │ ├── General.cs │ │ ├── IntProperties.cs │ │ ├── IntProperty.cs │ │ ├── Landmarks.cs │ │ ├── Patterns.cs │ │ ├── PlatformProperties.cs │ │ ├── Relationships.cs │ │ ├── ScrollPattern.cs │ │ ├── SelectionItemPattern .cs │ │ ├── SelectionPattern.cs │ │ ├── StringProperties.cs │ │ ├── StringProperty.cs │ │ ├── SystemProperties.cs │ │ └── UWP.cs │ ├── ReadME.MD │ ├── Resources │ │ ├── ConditionDescriptions.Designer.cs │ │ ├── ConditionDescriptions.resx │ │ ├── Descriptions.Designer.cs │ │ ├── Descriptions.resx │ │ ├── ErrorMessages.Designer.cs │ │ ├── ErrorMessages.resx │ │ ├── HowToFix.Designer.cs │ │ ├── HowToFix.resx │ │ ├── LocalizedControlTypeNames.Designer.cs │ │ └── LocalizedControlTypeNames.resx │ ├── Rule.cs │ ├── RuleFactory.cs │ ├── RuleInfo.cs │ ├── RuleProvider.cs │ ├── RuleRunner.cs │ ├── Rules.cs │ ├── Rules.csproj │ ├── RulesSettings.cs │ └── RunResult.cs ├── RulesMD │ ├── App.config │ ├── CLIOptions.cs │ ├── EvaluationCodeDescriptions.md │ ├── Helpers.cs │ ├── MarkdownCreator.tt │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── RulesMD.csproj │ └── packages.config ├── RulesTest │ ├── .editorconfig │ ├── AllRules.test.cs │ ├── Conditions │ │ ├── AndConditionTests.cs │ │ ├── ConditionTests.cs │ │ ├── ControlTypeConditionTests.cs │ │ ├── NotConditionTests.cs │ │ ├── OrConditionTests.cs │ │ ├── PatternConditionTests.cs │ │ └── TreeDescentConditionTests.cs │ ├── ControlType.cs │ ├── Extensions.cs │ ├── Library │ │ ├── BoundingRectangleCompletelyObscuresContainerTests.cs │ │ ├── BoundingRectangleContainedInParentTests.cs │ │ ├── BoundingRectangleDataFormatCorrectTests.cs │ │ ├── BoundingRectangleNotAllZerosTests.cs │ │ ├── BoundingRectangleNotNullListViewXAMLTests.cs │ │ ├── BoundingRectangleNotNullTests.cs │ │ ├── BoundingRectangleNotNullTextBlockXAMLTests.cs │ │ ├── BoundingRectangleNotValidButOffScreenTests.cs │ │ ├── BoundingRectangleSizeReasonableTests.cs │ │ ├── ButtonInvokeAndExpandCollapsePatternsTests.cs │ │ ├── ButtonInvokeAndTogglePatternsTests.cs │ │ ├── ButtonShouldHavePatternsTests.cs │ │ ├── ButtonToggleAndExpandCollapsePatternsTests.cs │ │ ├── ChromiumComponentsShouldUseWebScannerTests.cs │ │ ├── ClickablePointOffScreenTests.cs │ │ ├── ClickablePointOnScreenTests.cs │ │ ├── ClickablePointOnScreenWPFTests.cs │ │ ├── ComboBoxShouldNotSupportScrollPatternTests.cs │ │ ├── ControlShouldNotSupportInvokePatternTests.cs │ │ ├── ControlShouldNotSupportScrollPatternTests.cs │ │ ├── ControlShouldSupportExpandCollapsePatternTests.cs │ │ ├── ControlShouldSupportGridPatternTests.cs │ │ ├── ControlShouldSupportSetInfoWPFTests.cs │ │ ├── ControlShouldSupportSetInfoXAMLTests.cs │ │ ├── ControlShouldSupportTablePatternTests.cs │ │ ├── ControlShouldSupportTextPatternEditWinformTests.cs │ │ ├── ControlShouldSupportTextPatternTests.cs │ │ ├── EdgeBrowserHasBeenDeprecatedTests.cs │ │ ├── FrameworkDoesNotSupportUIAutomationTests.cs │ │ ├── HeadingLevelDescendsWhenNestedTests.cs │ │ ├── HelpTextExcludesPrivateUnicodeCharactersTests.cs │ │ ├── HyperlinkNameShouldBeUniqueTests.cs │ │ ├── IsControlElementTrueRequiredButtonWPFTests.cs │ │ ├── IsControlElementTrueRequiredTests.cs │ │ ├── IsControlElementTrueRequiredTextInEditXAMLTests.cs │ │ ├── IsKeyboardFocusableOnEmptyContainerTests.cs │ │ ├── IsKeyboardFocusableShouldBeTrueTests.cs │ │ ├── IsKeyboardFocusableTopLevelTextPatternTests.cs │ │ ├── LandmarkIsTopLevelTests.cs │ │ ├── ListItemSiblingUniqueTests.cs │ │ ├── LocalizedControlTypeExcludesPrivateUnicodeCharactersTests.cs │ │ ├── LocalizedControlTypeIsNotCustomTests.cs │ │ ├── LocalizedControlTypeIsNotCustomWPFGridCellTests.cs │ │ ├── LocalizedControlTypeIsNotEmptyTests.cs │ │ ├── LocalizedControlTypeIsNotNullTests.cs │ │ ├── LocalizedControlTypeIsNotWhiteSpaceTests.cs │ │ ├── LocalizedControlTypeIsReasonableTests.cs │ │ ├── LocalizedLandmarkTypeExcludesPrivateUnicodeCharactersTests.cs │ │ ├── LocalizedLandmarkTypeNotCustomTests.cs │ │ ├── NameExcludesControlTypeTests.cs │ │ ├── NameExcludesLocalizedControlTypeTests.cs │ │ ├── NameExcludesPrivateUnicodeCharactersTests.cs │ │ ├── NameIsEmptyButElementIsNotKeyboardFocusableTests.cs │ │ ├── NameIsInformativeTests.cs │ │ ├── NameIsNotEmptyTests.cs │ │ ├── NameIsNotNullTests.cs │ │ ├── NameIsNotWhiteSpaceTests.cs │ │ ├── NameIsNullButElementIsNotKeyboardFocusableTests.cs │ │ ├── NameIsReasonableLengthTests.cs │ │ ├── ParentChildShouldNotHaveSameNameAndLocalizedControlTypeTests.cs │ │ ├── ProgressBarRangeValueTests.cs │ │ ├── SelectionItemPatternSingleSelectionTests.cs │ │ ├── SelectionPatternSelectionRequiredTests.cs │ │ ├── SiblingUniqueAndFocusableTests.cs │ │ ├── SiblingUniqueAndNotFocusableTests.cs │ │ ├── SplitButtonInvokeAndTogglePatternsTests.cs │ │ ├── Structure │ │ │ ├── ContentView │ │ │ │ └── SpinnerTests.cs │ │ │ └── ControlView │ │ │ │ ├── ScrollbarTests.cs │ │ │ │ └── SpinnerTests.cs │ │ └── UWPTests.cs │ ├── MockA11yElement.cs │ ├── MonsterTest.cs │ ├── PatternIDs.cs │ ├── PropertyConditions │ │ ├── BoolPropertiesTests.cs │ │ ├── BoundingRectangleTests.cs │ │ ├── ClickablePointTests.cs │ │ ├── ContentViewTests.cs │ │ ├── ControlViewTests.cs │ │ ├── ElementGroupsTests.cs │ │ ├── EnumPropertyTests.cs │ │ ├── IntPropertiesTests.cs │ │ ├── IntPropertyTests.cs │ │ ├── LandmarksTests.cs │ │ ├── NameTests.cs │ │ ├── PatternsTests.cs │ │ ├── PlatformPropertiesTests.cs │ │ ├── RelationshipsTests.cs │ │ ├── ScrollPatternTests.cs │ │ ├── SelectionItemPatternTests.cs │ │ ├── SelectionPatternTests.cs │ │ ├── StringPropertiesTests.cs │ │ ├── SystemPropertiesTests.cs │ │ └── ValueConditionTests.cs │ ├── RuleRunnerTests.cs │ ├── RulesProviderTests.cs │ └── RulesTests.csproj ├── SystemAbstractions │ ├── Abstractions │ │ ├── IMicrosoft.cs │ │ ├── IMicrosoftFactory.cs │ │ ├── IMicrosoftWin32.cs │ │ ├── IMicrosoftWin32Registry.cs │ │ ├── ISystem.cs │ │ ├── ISystemDateTime.cs │ │ ├── ISystemEnvironment.cs │ │ ├── ISystemFactory.cs │ │ ├── ISystemIO.cs │ │ └── ISystemIODirectory.cs │ ├── AssemblyInfo.cs │ ├── Concretions │ │ ├── Microsoft.cs │ │ ├── MicrosoftFactory.cs │ │ ├── MicrosoftWin32.cs │ │ ├── MicrosoftWin32Registry.cs │ │ ├── System.cs │ │ ├── SystemDateTime.cs │ │ ├── SystemEnvironment.cs │ │ ├── SystemFactory.cs │ │ ├── SystemIO.cs │ │ └── SystemIODirectory.cs │ └── SystemAbstractions.csproj ├── SystemAbstractionsTests │ ├── MicrosoftUnitTests.cs │ ├── SystemAbstractionsTests.csproj │ └── SystemUnitTests.cs ├── Telemetry │ ├── AssemblyInfo.cs │ ├── ExcludedException.cs │ ├── ExcludingExceptionWrapper.cs │ ├── IAxeWindowsTelemetry.cs │ ├── Logger.cs │ ├── Telemetry.csproj │ ├── TelemetryAction.cs │ └── TelemetryProperty.cs ├── TelemetryTests │ ├── ExcludingExceptionWrapperUnitTests.cs │ ├── LoggerTests.cs │ └── TelemetryTests.csproj ├── UIAAssemblies │ ├── Win10.17713 │ │ └── Interop.UIAutomationClient.dll │ └── readme.md ├── UnitTestSharedLibrary │ ├── Snapshots │ │ ├── MonsterButton.snapshot │ │ ├── MonsterDataGrid.snapshot │ │ ├── MonsterEdit.snapshot │ │ ├── MonsterListView.snapshot │ │ ├── MonsterMenu.snapshot │ │ ├── MonsterUserControl.snapshot │ │ └── Taskbar.snapshot │ ├── TestCategory.cs │ ├── UnitTestSharedLibrary.csproj │ └── Utility.cs ├── Win32 │ ├── AssemblyInfo.cs │ ├── HighContrast.cs │ ├── HighContrastData.cs │ ├── NativeMethods.cs │ ├── Win32.csproj │ ├── Win32Constants.cs │ ├── Win32Enums.cs │ └── Win32Helper.cs ├── Win32Tests │ ├── Win32ApisTests.cs │ └── Win32Tests.csproj ├── loc │ └── lcl │ │ ├── CHS │ │ ├── Axe.Windows.Core.lcl │ │ ├── Axe.Windows.RuleSelection.lcl │ │ └── Axe.Windows.Rules.lcl │ │ ├── CHT │ │ ├── Axe.Windows.Core.lcl │ │ ├── Axe.Windows.RuleSelection.lcl │ │ └── Axe.Windows.Rules.lcl │ │ ├── CSY │ │ ├── Axe.Windows.Core.lcl │ │ ├── Axe.Windows.RuleSelection.lcl │ │ └── Axe.Windows.Rules.lcl │ │ ├── DEU │ │ ├── Axe.Windows.Core.lcl │ │ ├── Axe.Windows.RuleSelection.lcl │ │ └── Axe.Windows.Rules.lcl │ │ ├── ESN │ │ ├── Axe.Windows.Core.lcl │ │ ├── Axe.Windows.RuleSelection.lcl │ │ └── Axe.Windows.Rules.lcl │ │ ├── FRA │ │ ├── Axe.Windows.Core.lcl │ │ ├── Axe.Windows.RuleSelection.lcl │ │ └── Axe.Windows.Rules.lcl │ │ ├── ITA │ │ ├── Axe.Windows.Core.lcl │ │ ├── Axe.Windows.RuleSelection.lcl │ │ └── Axe.Windows.Rules.lcl │ │ ├── JPN │ │ ├── Axe.Windows.Core.lcl │ │ ├── Axe.Windows.RuleSelection.lcl │ │ └── Axe.Windows.Rules.lcl │ │ ├── KOR │ │ ├── Axe.Windows.Core.lcl │ │ ├── Axe.Windows.RuleSelection.lcl │ │ └── Axe.Windows.Rules.lcl │ │ ├── PLK │ │ ├── Axe.Windows.Core.lcl │ │ ├── Axe.Windows.RuleSelection.lcl │ │ └── Axe.Windows.Rules.lcl │ │ ├── PTB │ │ ├── Axe.Windows.Core.lcl │ │ ├── Axe.Windows.RuleSelection.lcl │ │ └── Axe.Windows.Rules.lcl │ │ ├── RUS │ │ ├── Axe.Windows.Core.lcl │ │ ├── Axe.Windows.RuleSelection.lcl │ │ └── Axe.Windows.Rules.lcl │ │ └── TRK │ │ ├── Axe.Windows.Core.lcl │ │ ├── Axe.Windows.RuleSelection.lcl │ │ └── Axe.Windows.Rules.lcl └── props │ └── version.props ├── thirdpartynotices.html └── tools ├── LocTestingSampleApp ├── LocTestingSampleApp.csproj ├── LocTestingSampleApp.sln ├── Program.cs └── README.md ├── WebViewSample ├── WebViewSample.exe └── src │ ├── App.xaml │ ├── App.xaml.cs │ ├── AssemblyInfo.cs │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ ├── README.md │ └── WebViewSample.csproj ├── WildlifeManager ├── WildlifeManager.exe ├── WildlifeManager.exe.config └── src │ ├── WildlifeManager.sln │ └── WildlifeManager │ ├── App.config │ ├── App.xaml │ ├── App.xaml.cs │ ├── CustomButton.cs │ ├── CustomControl.xaml │ ├── CustomControl.xaml.cs │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings │ └── WildlifeManager.csproj ├── Win32ControlSampler ├── Win32ControlSampler.exe └── src │ ├── Win32ControlSampler.sln │ └── Win32ControlSampler │ ├── Win32ControlSampler.cpp │ ├── Win32ControlSampler.h │ ├── Win32ControlSampler.ico │ ├── Win32ControlSampler.rc │ ├── Win32ControlSampler.vcxproj │ ├── Win32ControlSampler.vcxproj.filters │ ├── framework.h │ ├── resource.h │ ├── small.ico │ └── targetver.h ├── WindowsFormsControlSampler ├── WindowsFormsControlSampler.exe ├── WindowsFormsControlSampler.exe.config └── src │ ├── WindowsFormsControlSampler.sln │ └── WindowsFormsControlSampler │ ├── App.config │ ├── Form1.Designer.cs │ ├── Form1.cs │ ├── Form1.resx │ ├── Program.cs │ ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings │ └── WindowsFormsControlSampler.csproj ├── WindowsFormsMultiWindowSample ├── WindowsFormsMultiWindowSample.exe ├── WindowsFormsMultiWindowSample.exe.config └── src │ ├── WindowsFormsMultiWindowSample.sln │ └── WindowsFormsMultiWindowSample │ ├── App.config │ ├── Form1.Designer.cs │ ├── Form1.cs │ ├── Form1.resx │ ├── Program.cs │ ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings │ └── WindowsFormsMultiWindowSample.csproj ├── WpfControlSampler ├── WpfControlSampler.exe ├── WpfControlSampler.exe.config └── src │ ├── WpfControlSampler.sln │ └── WpfControlSampler │ ├── App.config │ ├── App.xaml │ ├── App.xaml.cs │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings │ └── WpfControlSampler.csproj └── scripts ├── BuildZippedCLI.ps1 ├── CopyLocalizedFiles.ps1 ├── check-automation.ps1 ├── pipeline └── build │ ├── clearly-defined │ ├── ValidateScript.bat │ ├── check-clearly-defined.ps1 │ └── clearly-defined-exclusions.json │ └── create-tsa-config.ps1 └── verification.scripts ├── LicenseHeader.txt ├── LicenseHeaderVerification.ps1 ├── ResourceStringCommentVerification.ps1 └── ValidateCLI.ps1 /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text=auto 3 | 4 | # Declare files that will always have CRLF line endings on checkout. 5 | *.appmanifest text eol=crlf 6 | *.config text eol=crlf 7 | *.controls text eol=crlf 8 | *.cs text eol=crlf 9 | *.csproj text eol=crlf 10 | *.css text eol=crlf 11 | *.js text eol=crlf 12 | *.json text eol=crlf 13 | *.jsproj text eol=crlf 14 | *.manifest text eol=crlf 15 | *.md text eol=crlf 16 | *.nuspec text eol=crlf 17 | *.orderedtest text eol=crlf 18 | *.ps1 text eol=crlf 19 | *.psd1 text eol=crlf 20 | *.psm1 text eol=crlf 21 | *.resjson text eol=crlf 22 | *.resx text eol=crlf 23 | *.rtf text eol=crlf 24 | *.runsettings text eol=crlf 25 | *.settings text eol=crlf 26 | *.sln text eol=crlf 27 | *.txt text eol=crlf 28 | *.uitest text eol=crlf 29 | *.wixproj text eol=crlf 30 | *.wxs text eol=crlf 31 | *.xaml text eol=crlf 32 | *.xml text eol=crlf 33 | 34 | # Denote all files that are truly binary and should not be modified. 35 | *.dll binary 36 | *.ico binary 37 | *.jpg binary 38 | *.msi binary 39 | *.png binary 40 | *.snk binary 41 | *.ttf binary 42 | *.wav binary 43 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # default owners for everything in the repository. 2 | * @microsoft/accessibility-insights-code-owners -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "[BUG] " 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | Please check whether the bug has [already been filed](https://github.com/Microsoft/axe-windows/issues). 10 | 11 | ## Describe the bug 12 | 13 | 14 | 15 | **To Reproduce** 16 | Steps to reproduce the behavior: 17 | 18 | 1. Go to '...' 19 | 2. Click on '....' 20 | 3. Scroll down to '....' 21 | 4. See error 22 | 23 | ## Expected behavior 24 | 25 | 26 | 27 | ## Actual behavior 28 | 29 | 30 | 31 | ## Screenshots or .GIF 32 | 33 | 34 | 35 | ## Desktop (please complete the following information): 36 | 37 | - OS: [e.g. Windows 10 1809] (Get the version by running `winver` from the command line) 38 | - Accessibility Insights for Windows Version: 39 | - Target Application: [e.g. Chrome, Wildlife Manager] 40 | - Target Application Version: [e.g. 22] 41 | 42 | ## Additional context 43 | 44 | Priority requested - 45 | 46 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: "[Feature Request]" 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Is your feature request related to a problem? Please describe. 11 | 12 | 13 | ## Describe the solution you'd like 14 | 15 | 16 | ## Describe alternatives you've considered 17 | 18 | 19 | ## Additional context 20 | 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/general-question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: General Question 3 | about: This is a template for people to ask questions that don't fit into any other issue categories 4 | title: "[General Question] " 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Your question here 11 | 12 | 16 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | #### Details 2 | 3 | 4 | 5 | ##### Motivation 6 | 7 | 8 | 9 | ##### Context 10 | 11 | 12 | 13 | 14 | 15 | #### Pull request checklist 16 | 17 | - [ ] Addresses an existing issue: #0000 18 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | 3 | 4 | ## Code of conduct 5 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 6 | 7 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or 8 | contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /brand/brand-blue-128px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/brand/brand-blue-128px.png -------------------------------------------------------------------------------- /brand/brand-blue-48px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/brand/brand-blue-48px.png -------------------------------------------------------------------------------- /build/NetStandardAll.targets: -------------------------------------------------------------------------------- 1 |  3 | 4 | 5 | 6 | true 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /build/NetStandardTest.targets: -------------------------------------------------------------------------------- 1 |  3 | 4 | 5 | 6 | false 7 | 1701;1702;CA1416 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /build/check-dependencies.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft. All rights reserved. 2 | # Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | # This template checks for assemblies that may need harvesting in ClearlyDefined 4 | 5 | parameters: 6 | configuration: '' 7 | 8 | jobs: 9 | - job: CheckDependencies 10 | displayName: Check Dependencies 11 | condition: succeeded() 12 | pool: 13 | name: $(a11yInsightsPool) 14 | image: windows-2022-secure 15 | os: windows 16 | steps: 17 | - task: NuGetToolInstaller@1 18 | displayName: 'Use NuGet 5.x' 19 | inputs: 20 | versionSpec: '5.x' 21 | 22 | - task: NuGetCommand@2 23 | displayName: 'NuGet restore' 24 | 25 | - task: PowerShell@2 26 | displayName: 'Check ClearlyDefined' 27 | inputs: 28 | filePath: '$(Build.SourcesDirectory)\tools\scripts\pipeline\build\clearly-defined\check-clearly-defined.ps1' 29 | arguments: '-Verbose -PipelineType ado' 30 | -------------------------------------------------------------------------------- /build/common.targets: -------------------------------------------------------------------------------- 1 |  3 | 4 | 5 | 8 | 9 | 12 | 13 | $(Features);flow-analysis 14 | 15 | -------------------------------------------------------------------------------- /build/delaysign.targets: -------------------------------------------------------------------------------- 1 |  3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | $(DefineConstants);ENABLE_SIGNING; 15 | true 16 | ..\..\keys\FinalPublicKey.snk 17 | true 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/DebuggingTips.md: -------------------------------------------------------------------------------- 1 | 3 | 4 | ## Debugging tips 5 | 6 | ### Skip the intermediate build 7 | If you are working on a client that consumes Axe.Windows (for example, Accessibility Insights for Windows), you may encounter situations where the inner dev loop is 8 | - Build Axe.Windows 9 | - Publish the `.nupkg` file 10 | - Consume the `.nupkg` file 11 | - Build the client 12 | - Run the client/evaluate results 13 | - Repeat 14 | 15 | This loop will be needed for changes that modify the interface, but since most cases do _not_ modify the interface, a simple script can often streamline the process: 16 | ``` 17 | xcopy /y "$(AxeWindowsRoot)\src\CI\bin\release\axe.windows\*.dll" "$(YourClientDropFolder)" 18 | ``` 19 | 20 | You'll still need to build your project the first time, then your inner dev loop simplifies to 21 | - Build Axe.Windows 22 | - Run the script 23 | - Run the client/evaluate results 24 | - Repeat 25 | 26 | -------------------------------------------------------------------------------- /docs/NewProject.md: -------------------------------------------------------------------------------- 1 |  3 | 4 | ## Adding a new project 5 | 6 | ### All project types 7 | 8 | 1. Add your new project to the Axe.Windows Solution (`src\AxeWindows.sln`). 9 | 2. Before creating a pull request, verify that Visual Studio can successfully load and build the entire solution in both Debug and Release. 10 | 3. If your project requires NuGet dependencies which need to be installed alongside it, update the section of `./src/ci/axe.windows.nuspec`. 11 | 12 | #### For *production (not test)* .NET Standard projects 13 | 14 | 1. Use src\Core\Core.csproj as your template. Remove all ItemGroup blocks except the one that includes the analyzers. 15 | 2. Update the `AssemblyName` and `RootNamespace` entries to match your new project. 16 | 3. Add the new project to the assembly. 17 | 4. Add your files in Visual Studio 18 | 19 | #### For *test* .NET Standard projects 20 | 21 | 1. Use src\CoreTests\CoreTests.csproj as your template. Remove all ItemGroup blocks except the one that includes the test adapters, test framework, Moq, etc. 22 | 2. Add the new project to the assembly. 23 | 3. Add your files in Visual Studio 24 | -------------------------------------------------------------------------------- /docs/SetUpDevEnv.md: -------------------------------------------------------------------------------- 1 | 3 | 4 | ## Set up your development environment 5 | 6 | ### Install Visual Studio 7 | 1. Install Visual Studio 2022 from [here](https://visualstudio.microsoft.com/vs/) 8 | - Choose ".NET desktop development" option 9 | - Add ".NET Framework 4.7.2 development tools" (used for some non-production projects) 10 | -------------------------------------------------------------------------------- /docs/VirusScannerExclusions.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | ## Virus scanner exclusions 7 | 8 | When running locally, virus scanners have been known to have a significant impact on execution time. To prevent this, you may wish to exclude the entire repo from virus scanning. The specifics of how to do this will vary between virus scanners, between operating systems, and possibly between different versions of the same virus scanner. 9 | 10 | ### Microsoft Defender (Windows only) 11 | The following steps allow you to exclude a folder and all its descendants from Microsoft Defender. These instructions have been validated on both Windows 10 and Windows 11: 12 | - From the start menu, run **Windows Security** 13 | - Enter the **Virus & threat protection** tab 14 | - Under **Virus & threat protection settings**, click **Manage settings** 15 | - Under **Exclusions**, click **Add or remove exclusions** 16 | - If prompted for permissions, grant permissions 17 | - Click **Add an exclusion** 18 | - Select **Folder** as the exclusion type 19 | - Specify the folder to ignore--all descendants of this folder will be ignored 20 | - Click **Select folder** 21 | 22 | ### Other antivirus products 23 | Please consult your antivirus product's documentation. -------------------------------------------------------------------------------- /docs/localization.md: -------------------------------------------------------------------------------- 1 | 3 | 4 | ## axe-windows localization 5 | 6 | The axe-windows package has been partially localized from version 2.1.0 on. Note that not all package content is localized, only the strings that are user facing (such as rules descriptions and conditions). Error messages and strings not contained in the axe-windows nuget package (such as those associated with the CLI) are not localized. 7 | 8 | ### Localization Process 9 | 10 | Translations for localizable strings are checked into this repo in the `.LCL` files in `../src/loc/lcl/*`. These translations include many technical UI Automation terms which should be translated in accordance with the translated versions of the [UIA docs pages](https://learn.microsoft.com/dotnet/framework/ui-automation/). The translation files are used in our build process to create localized resource `.dll`s alongside each localized assembly, which are eventually signed and bundled into the axe-windows package. 11 | 12 | ### Testing Localized Packages 13 | 14 | Localized versions of the axe-windows package can be tested using the localization testing app located in the [tools directory](../tools/LocTestingSampleApp). See the app's [README](../tools/LocTestingSampleApp/README.md) for details. 15 | -------------------------------------------------------------------------------- /keys/FinalPublicKey.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/keys/FinalPublicKey.snk -------------------------------------------------------------------------------- /src/Actions/Actions/CustomUIAAction.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Actions.Contexts; 5 | using Axe.Windows.Core.CustomObjects; 6 | using System; 7 | using System.Collections.Generic; 8 | 9 | namespace Axe.Windows.Actions 10 | { 11 | public static class CustomUIAAction 12 | { 13 | public static Config ReadConfigFromFile(string path) { return Config.ReadFromFile(path); } 14 | 15 | public static void RegisterCustomProperties(IEnumerable properties) 16 | { 17 | RegisterCustomProperties(properties, DefaultActionContext.GetDefaultInstance()); 18 | } 19 | 20 | internal static void RegisterCustomProperties(IEnumerable properties, IActionContext actionContext) 21 | { 22 | if (properties == null) throw new ArgumentNullException(nameof(properties)); 23 | foreach (CustomProperty p in properties) 24 | { 25 | actionContext.Registrar.RegisterCustomProperty(p); 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Actions/Actions/StreamName.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.Actions 5 | { 6 | /// 7 | /// Names for files (streams) inside an a11ytest file 8 | /// 9 | internal class StreamName 10 | { 11 | public const string ElementFileName = "el.snapshot"; 12 | public const string ScreenshotFileName = "scshot.png"; 13 | public const string MetadataFileName = "metadata.json"; 14 | public const string CustomPropsFileName = "CustomProperties.json"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Actions/Attributes/InteractionLevelAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Actions.Enums; 5 | using System; 6 | 7 | namespace Axe.Windows.Actions.Attributes 8 | { 9 | /// 10 | /// Describes the amount of user interaction an Action offers 11 | /// 12 | [AttributeUsage(AttributeTargets.Class)] 13 | sealed class InteractionLevelAttribute : Attribute 14 | { 15 | /// 16 | /// The ux interaction level of described class 17 | /// 18 | public UxInteractionLevel InteractionLevel { get; } 19 | 20 | /// 21 | /// Constructor 22 | /// 23 | /// 24 | public InteractionLevelAttribute(UxInteractionLevel interactionLevel) : base() 25 | { 26 | InteractionLevel = interactionLevel; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/ActionsTests/ActionsTests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0 5 | Axe.Windows.ActionsTests 6 | 7 | 8 | 9 | 10 | 11 | all 12 | runtime; build; native; contentfiles; analyzers; buildtransitive 13 | 14 | 15 | 16 | all 17 | runtime; build; native; contentfiles; analyzers; buildtransitive 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/Attributes/AttributesInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | // This file contains attributes that need to be set on all shipping projects 5 | 6 | [assembly: System.CLSCompliant(false)] // Required to avoid CA1014 analyzer warning 7 | -------------------------------------------------------------------------------- /src/Automation/DPIAwareness.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.Automation 5 | { 6 | internal class DPIAwareness : IDPIAwareness 7 | { 8 | public object Enable() 9 | { 10 | Win32.NativeMethods.SetProcessDPIAware(); 11 | return null; 12 | } 13 | 14 | public void Restore(object _) 15 | { 16 | // Default restore does nothing 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Automation/Data/ScanResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Rules; 5 | 6 | namespace Axe.Windows.Automation 7 | { 8 | /// 9 | /// The result of a single rule test on a single element 10 | /// 11 | public class ScanResult 12 | { 13 | /// 14 | /// Information about the rule that evaluated the element specified by 15 | /// 16 | public RuleInfo Rule { get; internal set; } 17 | 18 | /// 19 | /// The element which was tested against the rule specified in 20 | /// 21 | public ElementInfo Element { get; internal set; } 22 | } // class 23 | } // namespace 24 | -------------------------------------------------------------------------------- /src/Automation/Enums/OutputFileFormat.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | 6 | namespace Axe.Windows.Automation 7 | { 8 | #pragma warning disable CA1714 // We cannot change the enum name without breaking backward compatibility because the API has been released to the public 9 | /// 10 | /// Bit flags to specify which output file formats a should write 11 | /// 12 | [Flags] 13 | public enum OutputFileFormat 14 | { 15 | /// 16 | /// Create no output files 17 | /// 18 | None = 0, 19 | 20 | /// 21 | /// Create output files which can be opened using Accessibility Insights for Windows. 22 | /// 23 | A11yTest = 1, 24 | } // enum 25 | #pragma warning restore CA1714 26 | } // namespace 27 | -------------------------------------------------------------------------------- /src/Automation/Interfaces/IDPIAwareness.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.Automation 5 | { 6 | /// 7 | /// UIA operates in physical screen coordinates, so DPI awareness must be enabled while scanning. 8 | /// Methods on this interface will be called before the first scan begins and after the last scan completes. 9 | /// 10 | public interface IDPIAwareness 11 | { 12 | /// 13 | /// Enable DPI awareness for the scan 14 | /// 15 | /// An object that will be passed as a parameter 16 | object Enable(); 17 | 18 | /// 19 | /// Restore DPI awareness to its original state 20 | /// 21 | /// The object returned from the call to 22 | void Restore(object dataFromEnable); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Automation/Interfaces/IFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.Automation 5 | { 6 | /// 7 | /// Factory used to create objects for internal use 8 | /// 9 | interface IFactory 10 | { 11 | IOutputFileHelper CreateOutputFileHelper(string outputDirectory); 12 | IScanResultsAssembler CreateResultsAssembler(); 13 | ITargetElementLocator CreateTargetElementLocator(); 14 | IAxeWindowsActions CreateAxeWindowsActions(); 15 | IDPIAwareness CreateDPIAwareness(); 16 | } // interface 17 | } // namespace 18 | -------------------------------------------------------------------------------- /src/Automation/Interfaces/IOutputFileHelper.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | 6 | namespace Axe.Windows.Automation 7 | { 8 | internal interface IOutputFileHelper 9 | { 10 | void EnsureOutputDirectoryExists(); 11 | string GetNewA11yTestFilePath(Func decorator); 12 | void SetScanId(string scanId); 13 | } // interface 14 | } // namespace 15 | -------------------------------------------------------------------------------- /src/Automation/Interfaces/IScanResultsAssembler.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Bases; 5 | 6 | namespace Axe.Windows.Automation 7 | { 8 | /// 9 | /// Provides methods used to assemble and objects 10 | /// 11 | internal interface IScanResultsAssembler 12 | { 13 | /// 14 | /// Assembles failed scans from the provided element 15 | /// 16 | /// Root element from which the scan output will be assembled 17 | /// A WindowScanOutput object containing the relevant errors and error count 18 | WindowScanOutput AssembleWindowScanOutputFromElement(A11yElement element); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Automation/Interfaces/IScanTools.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | 6 | namespace Axe.Windows.Automation 7 | { 8 | /// 9 | /// Encapsulates the set of tools used to scan, assemble results, and write output files 10 | /// 11 | internal interface IScanTools 12 | { 13 | IOutputFileHelper OutputFileHelper { get; } 14 | IScanResultsAssembler ResultsAssembler { get; } 15 | ITargetElementLocator TargetElementLocator { get; } 16 | IAxeWindowsActions Actions { get; } 17 | IDPIAwareness DpiAwareness { get; } 18 | IntPtr ScanRootWindowHandle { get; set; } 19 | } // interface 20 | } // namespace 21 | -------------------------------------------------------------------------------- /src/Automation/Interfaces/IScanToolsBuilder.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.Automation 5 | { 6 | internal interface IScanToolsBuilder 7 | { 8 | IScanToolsBuilder WithOutputDirectory(string outputDirectory); 9 | IScanToolsBuilder WithDPIAwareness(IDPIAwareness dpiAwareness); 10 | IScanTools Build(); 11 | } // interface 12 | } // namespace 13 | -------------------------------------------------------------------------------- /src/Automation/Interfaces/ITargetElementLocator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Actions.Contexts; 5 | using Axe.Windows.Core.Bases; 6 | using System.Collections.Generic; 7 | 8 | namespace Axe.Windows.Automation 9 | { 10 | internal interface ITargetElementLocator 11 | { 12 | IEnumerable LocateRootElements(int processId, IActionContext actionContext, System.IntPtr rootWindowHandle); 13 | } // interface 14 | } // namespace 15 | -------------------------------------------------------------------------------- /src/Automation/ScannerFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | 6 | namespace Axe.Windows.Automation 7 | { 8 | /// 9 | /// Create objects that implement IScanner 10 | /// 11 | public static class ScannerFactory 12 | { 13 | /// 14 | /// Create an object that implements IScanner 15 | /// 16 | /// 17 | /// 18 | public static IScanner CreateScanner(Config config) 19 | { 20 | if (config == null) throw new ArgumentNullException(nameof(config)); 21 | 22 | var scanToolsBuilder = Factory.CreateScanToolsBuilder(); 23 | var scanTools = scanToolsBuilder 24 | .WithOutputDirectory(config.OutputDirectory) 25 | .WithDPIAwareness(config.DPIAwareness) 26 | .Build(); 27 | return new Scanner(config, scanTools); 28 | } 29 | } // class 30 | } // namespace 31 | -------------------------------------------------------------------------------- /src/AutomationTests/DummyDisposable.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | 6 | namespace Axe.Windows.AutomationTests 7 | { 8 | /// 9 | /// Placeholder class for where we need an IDisposable. It exposes the disposed count at 10 | /// any point in time 11 | /// 12 | class DummyDisposable : IDisposable 13 | { 14 | public int TimesDisposed { get; private set; } 15 | 16 | /// 17 | /// Dispose method. We explicitly DO NOT use the "fancy" disposal, since we want to 18 | /// detect cases where the owner incorrectly double-disposes 19 | /// 20 | public void Dispose() 21 | { 22 | TimesDisposed++; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/CI/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/CI/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Automation; 5 | using System; 6 | 7 | namespace Axe.Windows.CI 8 | { 9 | class Program 10 | { 11 | /// 12 | /// Entry point for dummy app 13 | /// 14 | static void Main() 15 | { 16 | if (Config.Builder.ForProcessId(0) == null) 17 | { 18 | Console.WriteLine("This will never be written"); 19 | } 20 | Console.WriteLine("This is just a placeholder app to gather the Axe.Windows assemblies."); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/CI/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /src/CLI/AppManifests/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | true/pm 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/CLI/BrowserAbstraction.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System.Diagnostics; 5 | 6 | namespace AxeWindowsCLI 7 | { 8 | internal class BrowserAbstraction : IBrowserAbstraction 9 | { 10 | public void Open(string pathToFile) 11 | { 12 | Process.Start(new ProcessStartInfo("cmd", $"/c \"" + pathToFile + "\"") 13 | { 14 | CreateNoWindow = true 15 | }); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/CLI/IBrowserAbstraction.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace AxeWindowsCLI 5 | { 6 | internal interface IBrowserAbstraction 7 | { 8 | void Open(string pathToFile); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/CLI/IOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace AxeWindowsCLI 5 | { 6 | internal interface IOptions 7 | { 8 | string OutputDirectory { get; } 9 | string ScanId { get; } 10 | System.IntPtr ScanRootWindowHandle { get; } 11 | int ProcessId { get; } 12 | string ProcessName { get; } 13 | VerbosityLevel VerbosityLevel { get; } 14 | int DelayInSeconds { get; } 15 | string CustomUia { get; } 16 | bool AlwaysSaveTestFile { get; } 17 | bool TestAllChromiumContent { get; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/CLI/IOutputGenerator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Automation; 5 | using System; 6 | 7 | namespace AxeWindowsCLI 8 | { 9 | internal interface IOutputGenerator 10 | { 11 | void WriteBanner(IOptions options); 12 | void WriteOutput(IOptions options, WindowScanOutput scanResults, Exception caughtException); 13 | void WriteThirdPartyNoticeOutput(string pathToFile); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/CLI/IProcessAbstraction.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System.Diagnostics; 5 | 6 | namespace AxeWindowsCLI 7 | { 8 | internal interface IProcessAbstraction 9 | { 10 | Process[] GetProcessesByName(string name); 11 | Process GetProcessById(int id); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/CLI/IProcessHelper.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace AxeWindowsCLI 5 | { 6 | internal interface IProcessHelper 7 | { 8 | int ProcessIdFromName(string processName); 9 | string ProcessNameFromId(int processId); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/CLI/IScanDelay.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace AxeWindowsCLI 5 | { 6 | interface IScanDelay 7 | { 8 | void DelayWithCountdown(IOptions options); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/CLI/ParameterException.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | 6 | namespace AxeWindowsCLI 7 | { 8 | internal class ParameterException : ArgumentException 9 | { 10 | public ParameterException(string message, Exception innerException) : 11 | base(message, innerException) 12 | { } 13 | 14 | public ParameterException(string message) 15 | : this(message, null) 16 | { } 17 | 18 | public ParameterException() 19 | { } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/CLI/ProcessAbstraction.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System.Diagnostics; 5 | 6 | namespace AxeWindowsCLI 7 | { 8 | internal class ProcessAbstraction : IProcessAbstraction 9 | { 10 | public Process GetProcessById(int id) 11 | { 12 | return Process.GetProcessById(id); 13 | } 14 | 15 | public Process[] GetProcessesByName(string name) 16 | { 17 | return Process.GetProcessesByName(name); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/CLI/VerbosityLevel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace AxeWindowsCLI 5 | { 6 | public enum VerbosityLevel 7 | { 8 | Quiet, 9 | Default, 10 | Verbose, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/CLITests/CLITests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0 5 | AxeWindowsCLITests 6 | 7 | 8 | 9 | 10 | 11 | all 12 | runtime; build; native; contentfiles; analyzers; buildtransitive 13 | 14 | 15 | all 16 | runtime; build; native; contentfiles; analyzers; buildtransitive 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/CLI_Full/BuildNotes.md: -------------------------------------------------------------------------------- 1 | # Build notes for CLI_Full project 2 | 3 | The `CLI_Full` project exists to gather the CLI into a self-contained format (.zip) where all necessary .NET Core runtime files are gathered by the compiler. We compile the code from the `CLI` project is used, but specify extra flags to create the self-contained version. We end up with two versions of `AxeWindowsCLI.exe`, which are not interchangeable due to compiler-generated differences inside the binaries. The csproj file that builds CLI_Full actually _copies_ AxeWindowsCLI.dll as part of the build. This was added to ensure that resources are identical between the 2 flavors. 4 | 5 | The _only_ changes to be made in the `CLI_Full` project are those change that impact the packaging of the zip file. 6 | -------------------------------------------------------------------------------- /src/CLI_Installer/Resources/DialogBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/CLI_Installer/Resources/DialogBackground.png -------------------------------------------------------------------------------- /src/CLI_Installer/Resources/WixDialogBanner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/CLI_Installer/Resources/WixDialogBanner.png -------------------------------------------------------------------------------- /src/Core/Attributes/PatternEventAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | 6 | namespace Axe.Windows.Core.Attributes 7 | { 8 | /// 9 | /// PatternEventAttribute class 10 | /// indicate the expected events for the pattern 11 | /// 12 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] 13 | public sealed class PatternEventAttribute : Attribute 14 | { 15 | /// 16 | /// Event ID 17 | /// 18 | public int Id { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Core/Attributes/PatternMethodAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | 6 | namespace Axe.Windows.Core.Attributes 7 | { 8 | /// 9 | /// PatternActionAttribute class 10 | /// indicate the method is actionable via UI 11 | /// 12 | [AttributeUsage(AttributeTargets.Method)] 13 | public sealed class PatternMethodAttribute : Attribute 14 | { 15 | /// 16 | /// if it is true, the method is related with UI Action 17 | /// 18 | public bool IsUIAction { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Core/Bases/A11yElementData.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System.Collections.Generic; 5 | 6 | namespace Axe.Windows.Core.Bases 7 | { 8 | /// 9 | /// Container for Property and Patterns for passing these over wires. 10 | /// 11 | public class A11yElementData 12 | { 13 | #pragma warning disable CA2227 // Collection properties should be read only 14 | /// 15 | /// Properties. it is populated automatically at construction 16 | /// 17 | public Dictionary Properties { get; set; } 18 | 19 | /// 20 | /// Patterns 21 | /// 22 | public IList Patterns { get; set; } 23 | #pragma warning restore CA2227 // Collection properties should be read only 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Core/Bases/IA11yEventMessage.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System.Collections.Generic; 5 | 6 | namespace Axe.Windows.Core.Bases 7 | { 8 | public interface IA11yEventMessage 9 | { 10 | int EventId { get; set; } 11 | 12 | /// 13 | /// Time stamp with millisecond accuracy 14 | /// 15 | string TimeStamp { get; set; } 16 | 17 | IList> Properties { get; } 18 | 19 | A11yElement Element { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Core/Bases/IA11yPattern.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | namespace Axe.Windows.Core.Bases 4 | { 5 | public interface IA11yPattern 6 | { 7 | int Id { get; } 8 | T GetValue(string propertyName); 9 | } // class 10 | } // namespace 11 | -------------------------------------------------------------------------------- /src/Core/Bases/ICoreA11yElement.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.Core.Bases 5 | { 6 | /// 7 | /// Extend IA11yElement to expose the properties that we need for unit tests. 8 | /// (IA11yElement exposes only what is needed for rules) 9 | /// 10 | internal interface ICoreA11yElement : IA11yElement 11 | { 12 | /// 13 | /// The Accelerator key for this element (null if property does not exist) 14 | /// 15 | string AcceleratorKey { get; } 16 | 17 | /// 18 | /// The Access key for this element (null if property does not exist) 19 | /// 20 | string AccessKey { get; } 21 | 22 | /// 23 | /// The Culture for this element (null if property does not exist) 24 | /// 25 | string Culture { get; } 26 | 27 | /// 28 | /// Unique Id of the element 29 | /// 30 | int UniqueId { get; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Core/CustomObjects/Config.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Newtonsoft.Json; 5 | using System.IO; 6 | 7 | namespace Axe.Windows.Core.CustomObjects 8 | { 9 | public class Config 10 | { 11 | #pragma warning disable CA1819 // Properties should not return arrays: represents a JSON collection 12 | [JsonProperty("properties")] 13 | public CustomProperty[] Properties { get; set; } 14 | #pragma warning restore CA1819 // Properties should not return arrays: represents a JSON collection 15 | 16 | public static Config ReadFromText(string text) { return JsonConvert.DeserializeObject(text); } 17 | 18 | public static Config ReadFromFile(string path) { return Config.ReadFromText(File.ReadAllText(path)); } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Core/CustomObjects/Converters/BoolTypeConverter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | using System.Globalization; 6 | 7 | namespace Axe.Windows.Core.CustomObjects.Converters 8 | { 9 | public class BoolTypeConverter : ITypeConverter 10 | { 11 | public string Render(dynamic value) 12 | { 13 | if (value == null) throw new ArgumentNullException(nameof(value)); 14 | return ((bool)value).ToString(CultureInfo.InvariantCulture); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Core/CustomObjects/Converters/DoubleTypeConverter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | using System.Globalization; 6 | 7 | namespace Axe.Windows.Core.CustomObjects.Converters 8 | { 9 | public class DoubleTypeConverter : ITypeConverter 10 | { 11 | public string Render(dynamic value) 12 | { 13 | if (value == null) throw new ArgumentNullException(nameof(value)); 14 | return ((double)value).ToString(CultureInfo.InvariantCulture); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Core/CustomObjects/Converters/ElementTypeConverter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Bases; 5 | using System; 6 | 7 | namespace Axe.Windows.Core.CustomObjects.Converters 8 | { 9 | public class ElementTypeConverter : ITypeConverter 10 | { 11 | public string Render(dynamic value) 12 | { 13 | if (value == null) throw new ArgumentNullException(nameof(value)); 14 | return ((A11yElement)value).Glimpse; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Core/CustomObjects/Converters/EnumTypeConverter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Resources; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Globalization; 8 | 9 | namespace Axe.Windows.Core.CustomObjects.Converters 10 | { 11 | public class EnumTypeConverter : ITypeConverter 12 | { 13 | /// A user-specified mapping of enumeration members to friendly descriptions. 14 | private IReadOnlyDictionary _values { get; } 15 | 16 | public EnumTypeConverter(IReadOnlyDictionary values) { _values = values; } 17 | 18 | public string Render(dynamic value) 19 | { 20 | if (value == null) throw new ArgumentNullException(nameof(value)); 21 | int raw = (int)value; 22 | if (_values.TryGetValue(raw, out string friendlyName)) 23 | return $"{friendlyName} ({raw})"; 24 | return string.Format(CultureInfo.CurrentCulture, DisplayStrings.UnknownFormat, raw); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Core/CustomObjects/Converters/ITypeConverter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.Core.CustomObjects.Converters 5 | { 6 | public interface ITypeConverter 7 | { 8 | string Render(dynamic value); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Core/CustomObjects/Converters/IntTypeConverter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | using System.Globalization; 6 | 7 | namespace Axe.Windows.Core.CustomObjects.Converters 8 | { 9 | public class IntTypeConverter : ITypeConverter 10 | { 11 | public string Render(dynamic value) 12 | { 13 | if (value == null) throw new ArgumentNullException(nameof(value)); 14 | return ((int)value).ToString(CultureInfo.InvariantCulture); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Core/CustomObjects/Converters/PointTypeConverter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Resources; 5 | using System; 6 | using System.Globalization; 7 | 8 | namespace Axe.Windows.Core.CustomObjects.Converters 9 | { 10 | public class PointTypeConverter : ITypeConverter 11 | { 12 | public string Render(dynamic value) 13 | { 14 | if (value == null) throw new ArgumentNullException(nameof(value)); 15 | double[] arr = (double[])value; 16 | return string.Format(CultureInfo.CurrentCulture, DisplayStrings.PointFormat, arr[0], arr[1]); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Core/CustomObjects/Converters/StringTypeConverter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | 6 | namespace Axe.Windows.Core.CustomObjects.Converters 7 | { 8 | public class StringTypeConverter : ITypeConverter 9 | { 10 | public string Render(dynamic value) 11 | { 12 | if (value == null) throw new ArgumentNullException(nameof(value)); 13 | return ((string)value); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Core/Enums/CustomUIAPropertyType.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.Core.Enums 5 | { 6 | public enum CustomUIAPropertyType 7 | { 8 | Unset = 0, 9 | #pragma warning disable CA1720 // Identifier contains type name: type names from JSON 10 | String, 11 | Int, 12 | Bool, 13 | Double, 14 | Point, 15 | Element, 16 | Enum 17 | #pragma warning restore CA1720 // Identifier contains type name: type names from JSON 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Core/Enums/FrameworkId.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | namespace Axe.Windows.Core.Enums 4 | { 5 | public static class FrameworkId 6 | { 7 | public const string DirectUI = "DirectUI"; 8 | public const string Edge = "MicrosoftEdge"; 9 | public const string InternetExplorer = "InternetExplorer"; 10 | public const string Chrome = "Chrome"; 11 | public const string WPF = "WPF"; 12 | public const string WinForm = "WinForm"; 13 | public const string Win32 = "Win32"; 14 | public const string XAML = "XAML"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Core/Enums/OrientationType.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | namespace Axe.Windows.Core.Enums 4 | { 5 | public enum OrientationType 6 | { 7 | None, 8 | Horizontal, 9 | Vertical 10 | } // enum 11 | } // namespace 12 | -------------------------------------------------------------------------------- /src/Core/Enums/TreeViewMode.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | namespace Axe.Windows.Core.Enums 4 | { 5 | /// 6 | /// Mode for TreeWalking 7 | /// Raw: Everything 8 | /// Control: ... 9 | /// Content: ... 10 | /// Based on UIAutomation definition. but we can use it for other platforms later. 11 | /// 12 | public enum TreeViewMode 13 | { 14 | Raw, 15 | Control, 16 | Content 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Core/Enums/UrlType.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | namespace Axe.Windows.Core.Enums 4 | { 5 | /// 6 | /// Type of Help Urls 7 | /// 8 | public enum UrlType 9 | { 10 | Info, 11 | Snippet, 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Core/Exceptions/AxeWindowsException.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | using System.Runtime.Serialization; 6 | 7 | namespace Axe.Windows.Core.Exceptions 8 | { 9 | /// 10 | /// AxeWindowsException 11 | /// Thrown by Axe.Windows libraries 12 | /// 13 | [Serializable] 14 | public class AxeWindowsException : Exception 15 | { 16 | public AxeWindowsException() 17 | { 18 | } 19 | 20 | public AxeWindowsException(string message) : base(message) 21 | { 22 | } 23 | 24 | public AxeWindowsException(string message, Exception innerException) : base(message, innerException) 25 | { 26 | } 27 | 28 | protected AxeWindowsException(SerializationInfo info, StreamingContext context) : base(info, context) 29 | { 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Core/Exceptions/TreeNavigationFailedException.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | using System.Runtime.Serialization; 6 | 7 | namespace Axe.Windows.Core.Exceptions 8 | { 9 | /// 10 | /// Expect this exception when attempting to navigate the UIA hierarchy, or another accessibility hierarchy, and the attempted navigation is unsuccessful. 11 | /// This exception is meant to indicate that the requested navigation was not possible, 12 | /// and any user facing error handling logic should be performed. 13 | /// 14 | [Serializable] 15 | public class TreeNavigationFailedException : Exception 16 | { 17 | public TreeNavigationFailedException() : base() { } 18 | 19 | public TreeNavigationFailedException(string message) : base(message) { } 20 | 21 | public TreeNavigationFailedException(string message, Exception innerException) : base(message, innerException) { } 22 | 23 | protected TreeNavigationFailedException(SerializationInfo serializationInfo, StreamingContext streamingContext) : base(serializationInfo, streamingContext) { } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Core/HelpLinks/HelpUrl.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Enums; 5 | 6 | namespace Axe.Windows.Core.HelpLinks 7 | { 8 | /// 9 | /// HelpUrl class 10 | /// 11 | public class HelpUrl 12 | { 13 | #pragma warning disable CA1056 // Uri properties should not be strings 14 | public string Url { get; set; } 15 | #pragma warning restore CA1056 // Uri properties should not be strings 16 | 17 | public UrlType Type { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Core/Misc/Delegates.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | namespace Axe.Windows.Core.Misc 4 | { 5 | public delegate string GetStringValue(); 6 | } 7 | -------------------------------------------------------------------------------- /src/Core/Misc/ListHelper.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | 7 | namespace Axe.Windows.Core.Misc 8 | { 9 | internal static class ListHelper 10 | { 11 | public static void DisposeAllItemsAndClearList(IList items) where T : IDisposable 12 | { 13 | DisposeAllItems(items); 14 | items?.Clear(); 15 | } 16 | 17 | public static void DisposeAllItems(IList items) where T : IDisposable 18 | { 19 | if (items != null) 20 | { 21 | foreach (T item in items) 22 | { 23 | item.Dispose(); 24 | } 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Core/Misc/PackageInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | using System.Reflection; 6 | 7 | namespace Axe.Windows.Core.Misc 8 | { 9 | /// 10 | /// Provides information about the Axe.Windows package 11 | /// 12 | public static class PackageInfo 13 | { 14 | private static readonly Lazy ThisAssembly = new Lazy(() => Assembly.GetExecutingAssembly(), true); 15 | private static readonly Lazy LazyInformationalVersion = new Lazy(GetInformationalVersion, true); 16 | 17 | private static string GetInformationalVersion() 18 | { 19 | var attribute = ThisAssembly.Value.GetCustomAttribute(); 20 | 21 | return attribute?.InformationalVersion; 22 | } 23 | 24 | /// 25 | /// Version string with suffix (e.g., "-prerelease") if the suffix exists 26 | /// 27 | public static string InformationalVersion => LazyInformationalVersion.Value; 28 | } // class 29 | } // namespace 30 | -------------------------------------------------------------------------------- /src/Core/Misc/Utility.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Telemetry; 5 | using System; 6 | using System.Diagnostics; 7 | 8 | namespace Axe.Windows.Core.Misc 9 | { 10 | internal static class Utility 11 | { 12 | public static string GetProcessName(int processId) 13 | { 14 | if (!TryGetProcessById(processId, out Process process)) return null; 15 | 16 | return process?.ProcessName; 17 | } 18 | 19 | private static bool TryGetProcessById(int processId, out Process process) 20 | { 21 | process = null; 22 | 23 | if (processId == 0) return false; 24 | 25 | try 26 | { 27 | process = Process.GetProcessById(processId); 28 | } 29 | catch (ArgumentException e) 30 | { 31 | e.ReportException(); 32 | // occurs when an invalid process id is passed to GetProcessById 33 | return false; 34 | } 35 | 36 | return true; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Core/Results/ScanStatus.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | namespace Axe.Windows.Core.Results 4 | { 5 | /// 6 | /// Test status enum 7 | /// 8 | public enum ScanStatus 9 | { 10 | NoResult = 0, 11 | Pass = 1, 12 | Uncertain = 2, 13 | Fail = 3, 14 | ScanNotSupported = 4, // for the cases like HTML framework which we don't support. 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/CoreTests/Bases/A11yPatternTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Bases; 5 | using Axe.Windows.UnitTestSharedLibrary; 6 | using Microsoft.VisualStudio.TestTools.UnitTesting; 7 | 8 | namespace Axe.Windows.CoreTests.Bases 9 | { 10 | /// 11 | /// Tests A11yPattern class 12 | /// 13 | [TestClass] 14 | public class A11yPatternTests 15 | { 16 | /// 17 | /// Test ToString and constructor for A11yPattern 18 | /// 19 | [TestMethod] 20 | public void ToStringTest() 21 | { 22 | A11yElement element = Utility.LoadA11yElementsFromJSON("Resources/A11yPatternTest.hier"); 23 | 24 | Assert.AreEqual("SelectionPattern: False", element.Patterns[0].ToString()); 25 | Assert.AreEqual("ScrollPattern: False", element.Patterns[1].ToString()); 26 | Assert.AreEqual("ExpandCollapsePattern: 0", element.Patterns[2].ToString()); 27 | Assert.AreEqual("ItemContainerPattern: ", element.Patterns[3].ToString()); 28 | Assert.AreEqual("SynchronizedInputPattern: ", element.Patterns[4].ToString()); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/CoreTests/CustomObjects/Converters/BoolConverterTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.CustomObjects.Converters; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | using System; 7 | 8 | namespace Axe.Windows.CoreTests.CustomObjects.Converters 9 | { 10 | [TestClass] 11 | public class BoolConverterTests 12 | { 13 | [TestMethod, Timeout(1000)] 14 | public void TrueRenderTest() 15 | { 16 | Assert.AreEqual("True", new BoolTypeConverter().Render(true)); 17 | } 18 | 19 | [TestMethod, Timeout(1000)] 20 | public void FalseRenderTest() 21 | { 22 | Assert.AreEqual("False", new BoolTypeConverter().Render(false)); 23 | } 24 | 25 | [TestMethod, Timeout(1000)] 26 | public void NullRenderTest() 27 | { 28 | Assert.ThrowsException(() => new BoolTypeConverter().Render(null)); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/CoreTests/CustomObjects/Converters/DoubleConverterTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.CustomObjects.Converters; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | using System; 7 | 8 | namespace Axe.Windows.CoreTests.CustomObjects.Converters 9 | { 10 | [TestClass] 11 | public class DoubleConverterTests 12 | { 13 | [TestMethod, Timeout(1000)] 14 | public void RenderTest() 15 | { 16 | Assert.AreEqual("0", new DoubleTypeConverter().Render(0.0)); 17 | } 18 | 19 | [TestMethod, Timeout(1000)] 20 | public void NullRenderTest() 21 | { 22 | Assert.ThrowsException(() => new DoubleTypeConverter().Render(null)); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/CoreTests/CustomObjects/Converters/ElementConverterTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Bases; 5 | using Axe.Windows.Core.CustomObjects.Converters; 6 | using Microsoft.VisualStudio.TestTools.UnitTesting; 7 | using System; 8 | 9 | namespace Axe.Windows.CoreTests.CustomObjects.Converters 10 | { 11 | [TestClass] 12 | public class ElementConverterTests 13 | { 14 | [TestMethod, Timeout(1000)] 15 | public void RenderTest() 16 | { 17 | A11yElement elem = new A11yElement 18 | { 19 | Glimpse = "the glimpse" 20 | }; 21 | Assert.AreEqual("the glimpse", new ElementTypeConverter().Render(elem)); 22 | } 23 | 24 | [TestMethod, Timeout(1000)] 25 | public void NullRenderTest() 26 | { 27 | Assert.ThrowsException(() => new ElementTypeConverter().Render(null)); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/CoreTests/CustomObjects/Converters/EnumConverterTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.CustomObjects.Converters; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | using System; 7 | using System.Collections.Generic; 8 | 9 | namespace Axe.Windows.CoreTests.CustomObjects.Converters 10 | { 11 | [TestClass] 12 | public class EnumConverterTests 13 | { 14 | [TestMethod, Timeout(1000)] 15 | public void RenderTest() 16 | { 17 | Dictionary vals = new Dictionary 18 | { 19 | [42] = "success" 20 | }; 21 | ITypeConverter tc = new EnumTypeConverter(vals); 22 | Assert.AreEqual("success (42)", tc.Render(42)); 23 | Assert.AreEqual("Unknown (43)", tc.Render(43)); 24 | } 25 | 26 | [TestMethod, Timeout(1000)] 27 | public void NullRenderTest() 28 | { 29 | Assert.ThrowsException(() => new EnumTypeConverter(new Dictionary()).Render(null)); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/CoreTests/CustomObjects/Converters/IntConverterTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.CustomObjects.Converters; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | using System; 7 | 8 | namespace Axe.Windows.CoreTests.CustomObjects.Converters 9 | { 10 | [TestClass] 11 | public class IntConverterTests 12 | { 13 | [TestMethod, Timeout(1000)] 14 | public void RenderTest() 15 | { 16 | Assert.AreEqual("42", new IntTypeConverter().Render(42)); 17 | } 18 | 19 | [TestMethod, Timeout(1000)] 20 | public void NullRenderTest() 21 | { 22 | Assert.ThrowsException(() => new IntTypeConverter().Render(null)); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/CoreTests/CustomObjects/Converters/PointConverterTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.CustomObjects.Converters; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | using System; 7 | 8 | namespace Axe.Windows.CoreTests.CustomObjects.Converters 9 | { 10 | [TestClass] 11 | public class PointConverterTests 12 | { 13 | [TestMethod, Timeout(1000)] 14 | public void RenderTest() 15 | { 16 | dynamic value = new double[2] { 42.0, 42.0 }; 17 | Assert.AreEqual("[x=42,y=42]", new PointTypeConverter().Render(value)); 18 | } 19 | 20 | [TestMethod, Timeout(1000)] 21 | public void NullRenderTest() 22 | { 23 | Assert.ThrowsException(() => new PointTypeConverter().Render(null)); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/CoreTests/CustomObjects/Converters/StringConverterTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.CustomObjects.Converters; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | using System; 7 | 8 | namespace Axe.Windows.CoreTests.CustomObjects.Converters 9 | { 10 | [TestClass] 11 | public class StringConverterTests 12 | { 13 | [TestMethod, Timeout(1000)] 14 | public void RenderTest() 15 | { 16 | Assert.AreEqual("test", new StringTypeConverter().Render("test")); 17 | } 18 | 19 | [TestMethod, Timeout(1000)] 20 | public void NullRenderTest() 21 | { 22 | Assert.ThrowsException(() => new StringTypeConverter().Render(null)); 23 | } 24 | 25 | [TestMethod, Timeout(1000)] 26 | public void EmptyRenderTest() 27 | { 28 | Assert.AreEqual(string.Empty, new StringTypeConverter().Render(string.Empty)); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/CoreTests/Misc/PackageInfoTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Misc; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | using System.Reflection; 7 | 8 | namespace Axe.Windows.CoreTests.Misc 9 | { 10 | [TestClass] 11 | public class PackageInfoTests 12 | { 13 | [TestMethod] 14 | public void PackageInfo_ExpectedInformationalVersion() 15 | { 16 | var assembly = Assembly.GetAssembly(typeof(PackageInfo)); 17 | var attribute = assembly.GetCustomAttribute(); 18 | Assert.IsNotNull(attribute?.InformationalVersion); 19 | Assert.AreEqual(PackageInfo.InformationalVersion, attribute.InformationalVersion); 20 | } 21 | } // class 22 | } // namespace 23 | -------------------------------------------------------------------------------- /src/CoreTests/Types/PatternTypesTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Types; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | 7 | namespace Axe.Windows.CoreTests.Types 8 | { 9 | [TestClass] 10 | public class PatternTypesTests 11 | { 12 | [TestMethod] 13 | public void CheckExists() 14 | { 15 | Assert.AreEqual(PatternType.GetInstance().Exists(PatternType.UIA_DockPatternId), true); 16 | Assert.AreEqual(PatternType.GetInstance().Exists(0), false); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/CoreTests/Types/TypeBaseTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Types; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | using System; 7 | using System.Linq; 8 | 9 | namespace Axe.Windows.CoreTests.Types 10 | { 11 | [TestClass] 12 | public class TypeBaseTests 13 | { 14 | private class DummyType : TypeBase 15 | { 16 | public DummyType() : base("NFL_") 17 | { } 18 | 19 | public const int NFL_Falcons = 1; 20 | public const int NFL_Seahawks = 2; 21 | public const int NFL_Colts = 3; 22 | public const int MLB_Braves = 4; 23 | } 24 | 25 | [TestMethod] 26 | public void TypeBase_CreatesDictionaryAsExpected() 27 | { 28 | var dummy = new DummyType(); 29 | Assert.AreEqual(3, dummy.Values.Count()); 30 | Assert.IsTrue(dummy.Values.Contains(DummyType.NFL_Falcons)); 31 | Assert.IsFalse(dummy.Values.Contains(DummyType.MLB_Braves)); 32 | } 33 | } // class 34 | } // namespace 35 | -------------------------------------------------------------------------------- /src/CurrentFileVersionCompatibilityTests/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/CurrentFileVersionCompatibilityTests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/Desktop/ColorContrastAnalyzer/AnalyzerVersion.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.Desktop.ColorContrastAnalyzer 5 | { 6 | public enum AnalyzerVersion 7 | { 8 | Default, // Use whatever the current default happens to be 9 | V1, // Decides based on the contents of a single scanline 10 | V2, // Decides based on all scanlines in the image 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Desktop/ColorContrastAnalyzer/BitmapCollection.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.Desktop.ColorContrastAnalyzer 5 | { 6 | public class BitmapCollection : ImageCollection 7 | { 8 | private readonly System.Drawing.Bitmap _bitmap; 9 | 10 | public BitmapCollection(System.Drawing.Bitmap bitmap, IColorContrastConfig colorContrastConfig) 11 | : base(colorContrastConfig) 12 | { 13 | _bitmap = bitmap; 14 | } 15 | 16 | public override int NumColumns() 17 | { 18 | return _bitmap.Width; 19 | } 20 | 21 | public override int NumRows() 22 | { 23 | return _bitmap.Height; 24 | } 25 | 26 | public override Color GetColor(int row, int column) 27 | { 28 | System.Drawing.Color color = _bitmap.GetPixel(column, row); 29 | 30 | return new Color(color); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Desktop/ColorContrastAnalyzer/ColorContrastResultV2.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.Desktop.ColorContrastAnalyzer 5 | { 6 | internal class ColorContrastResultV2 : IColorContrastResult 7 | { 8 | public ColorPair MostLikelyColorPair { get; } 9 | public Confidence Confidence { get; } 10 | 11 | public ColorContrastResultV2(ColorPair mostLikelycolorPair, Confidence confidence) 12 | { 13 | MostLikelyColorPair = mostLikelycolorPair; 14 | Confidence = confidence; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Desktop/ColorContrastAnalyzer/IColorContrastResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.Desktop.ColorContrastAnalyzer 5 | { 6 | // The order of these matters for combining confidences. Please do not change them 7 | public enum Confidence { None, Low, Mid, High } 8 | 9 | public interface IColorContrastResult 10 | { 11 | ColorPair MostLikelyColorPair { get; } 12 | 13 | Confidence Confidence { get; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Desktop/ColorContrastAnalyzer/Pixel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.Desktop.ColorContrastAnalyzer 5 | { 6 | public class Pixel 7 | { 8 | public int Row { get; } 9 | public int Column { get; } 10 | public Color Color { get; } 11 | 12 | public Pixel(Color color, int row, int column) 13 | { 14 | Row = row; 15 | Column = column; 16 | Color = color; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Desktop/ColorContrastAnalyzer/RowResultV2.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.Desktop.ColorContrastAnalyzer 5 | { 6 | internal class RowResultV2 7 | { 8 | internal Color BackgroundColor { get; } 9 | 10 | internal Color ForegroundColor { get; } 11 | 12 | internal int TransitionCount { get; } 13 | 14 | public RowResultV2(Color backgroundColor = null, 15 | Color foregroundColor = null, 16 | int transitionCount = 0) 17 | { 18 | BackgroundColor = backgroundColor; 19 | ForegroundColor = foregroundColor; 20 | TransitionCount = transitionCount; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Desktop/Types/ListenScope.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | namespace Axe.Windows.Desktop.Types 4 | { 5 | /// 6 | /// Defines values that specify the scope of elements within the automation tree 7 | /// that should be listened to for events 8 | /// 9 | public enum ListenScope 10 | { 11 | None, 12 | Element, 13 | Descendants, 14 | Subtree, 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Desktop/UIAutomation/DesktopDataContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Desktop.UIAutomation.CustomObjects; 5 | using System.Threading; 6 | 7 | namespace Axe.Windows.Desktop.UIAutomation 8 | { 9 | /// 10 | /// Data context for refreshing tree data for test 11 | /// 12 | public class DesktopDataContext 13 | { 14 | public static readonly DesktopDataContext DefaultContext = new DesktopDataContext(Registrar.GetDefaultInstance(), A11yAutomation.GetDefaultInstance(), CancellationToken.None); 15 | 16 | public Registrar Registrar { get; } 17 | 18 | public A11yAutomation A11yAutomation { get; } 19 | 20 | public CancellationToken CancellationToken { get; } 21 | 22 | public DesktopDataContext(Registrar registrar, A11yAutomation a11yAutomation, CancellationToken cancellationToken) 23 | { 24 | Registrar = registrar; 25 | A11yAutomation = a11yAutomation; 26 | CancellationToken = cancellationToken; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Desktop/UIAutomation/Patterns/UnKnownPattern.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Bases; 5 | using Axe.Windows.Core.Types; 6 | 7 | namespace Axe.Windows.Desktop.UIAutomation.Patterns 8 | { 9 | /// 10 | /// Control pattern wrapper for Unknown Control Pattern 11 | /// 12 | public class UnKnownPattern : A11yPattern 13 | { 14 | public UnKnownPattern(A11yElement e, int id, string name) : base(e, id, name) 15 | { 16 | if (!PatternType.GetInstance().Exists(id)) 17 | { 18 | // be silent since Unknown pattern was created since pattern interface couldn't be retrieved by unknown reason. 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Desktop/UIAutomation/Patterns/VirtualizedItemPattern.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Attributes; 5 | using Axe.Windows.Core.Bases; 6 | using Axe.Windows.Core.Types; 7 | using UIAutomationClient; 8 | 9 | namespace Axe.Windows.Desktop.UIAutomation.Patterns 10 | { 11 | /// 12 | /// Control pattern wrapper for VirtualizedItem Control Pattern 13 | /// 14 | public class VirtualizedItemPattern : A11yPattern 15 | { 16 | IUIAutomationVirtualizedItemPattern _pattern; 17 | 18 | public VirtualizedItemPattern(A11yElement e, IUIAutomationVirtualizedItemPattern p) : base(e, PatternType.UIA_VirtualizedItemPatternId) 19 | { 20 | _pattern = p; 21 | } 22 | 23 | [PatternMethod] 24 | public void Realize() 25 | { 26 | _pattern.Realize(); 27 | } 28 | 29 | protected override void Dispose(bool disposing) 30 | { 31 | if (_pattern != null) 32 | { 33 | System.Runtime.InteropServices.Marshal.ReleaseComObject(_pattern); 34 | _pattern = null; 35 | } 36 | 37 | base.Dispose(disposing); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Desktop/Utility/ProcessItem.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | using System.Diagnostics; 6 | 7 | using static System.FormattableString; 8 | 9 | namespace Axe.Windows.Desktop.Utility 10 | { 11 | public class ProcessItem 12 | { 13 | public IntPtr HWnd { get; } 14 | public int ProcessID { get; } 15 | public string MainWindowTitle { get; } 16 | 17 | public ProcessItem(Process p) 18 | { 19 | if (p == null) throw new ArgumentNullException(nameof(p)); 20 | 21 | HWnd = p.MainWindowHandle; 22 | ProcessID = p.Id; 23 | MainWindowTitle = p.MainWindowTitle; 24 | } 25 | 26 | public override string ToString() 27 | { 28 | return Invariant($"{ProcessID}:{MainWindowTitle}"); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/DesktopTests/ColorContrastAnalyzer/ColorPairTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Desktop.ColorContrastAnalyzer; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | 7 | namespace Axe.Windows.DesktopTests.ColorContrastAnalyzer 8 | { 9 | [TestClass] 10 | public class ColorPairTests 11 | { 12 | [TestMethod, Timeout(2000)] 13 | public void IsVisiblySimilarToTest() 14 | { 15 | ColorPair colorPair1 = new ColorPair(new Color(0, 0, 0), new Color(1, 1, 1)); 16 | ColorPair colorPair2 = new ColorPair(new Color(2, 2, 2), new Color(3, 3, 3)); 17 | 18 | Assert.IsTrue(colorPair1.IsVisiblySimilarTo(colorPair2)); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /src/DesktopTests/TestImages/button_icon_antialiased.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/DesktopTests/TestImages/button_icon_antialiased.bmp -------------------------------------------------------------------------------- /src/DesktopTests/TestImages/cortana_with_offset_down.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/DesktopTests/TestImages/cortana_with_offset_down.bmp -------------------------------------------------------------------------------- /src/DesktopTests/TestImages/cortana_with_offset_up.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/DesktopTests/TestImages/cortana_with_offset_up.bmp -------------------------------------------------------------------------------- /src/DesktopTests/TestImages/outlook_get_add_ins.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/DesktopTests/TestImages/outlook_get_add_ins.bmp -------------------------------------------------------------------------------- /src/DesktopTests/TestImages/outlook_share_to_teams.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/DesktopTests/TestImages/outlook_share_to_teams.bmp -------------------------------------------------------------------------------- /src/DesktopTests/TestImages/outlook_translate.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/DesktopTests/TestImages/outlook_translate.bmp -------------------------------------------------------------------------------- /src/DesktopTests/TestImages/simple_black_and_grey_button.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/DesktopTests/TestImages/simple_black_and_grey_button.bmp -------------------------------------------------------------------------------- /src/DesktopTests/TestImages/simple_black_and_white.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/DesktopTests/TestImages/simple_black_and_white.bmp -------------------------------------------------------------------------------- /src/DesktopTests/TestImages/simple_black_and_white_title.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/DesktopTests/TestImages/simple_black_and_white_title.bmp -------------------------------------------------------------------------------- /src/DesktopTests/TestImages/simple_blue_and_white_text.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/DesktopTests/TestImages/simple_blue_and_white_text.bmp -------------------------------------------------------------------------------- /src/DesktopTests/TestImages/simple_grey_and_white_title.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/DesktopTests/TestImages/simple_grey_and_white_title.bmp -------------------------------------------------------------------------------- /src/DesktopTests/TestImages/simple_purple_and_white_button.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/DesktopTests/TestImages/simple_purple_and_white_button.bmp -------------------------------------------------------------------------------- /src/DesktopTests/TestImages/simple_white_and_black_text.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/DesktopTests/TestImages/simple_white_and_black_text.bmp -------------------------------------------------------------------------------- /src/DesktopTests/TestImages/visual_studio_tab.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/DesktopTests/TestImages/visual_studio_tab.bmp -------------------------------------------------------------------------------- /src/DesktopTests/TestImages/weird_text_arrangement.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/DesktopTests/TestImages/weird_text_arrangement.bmp -------------------------------------------------------------------------------- /src/DesktopTests/TestImages/wildlife_manager_listbox_beetle.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/DesktopTests/TestImages/wildlife_manager_listbox_beetle.bmp -------------------------------------------------------------------------------- /src/DesktopTests/TestImages/wildlife_manager_listbox_mouse.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/DesktopTests/TestImages/wildlife_manager_listbox_mouse.bmp -------------------------------------------------------------------------------- /src/DesktopTests/TestImages/wildlife_manager_listbox_owl.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/DesktopTests/TestImages/wildlife_manager_listbox_owl.bmp -------------------------------------------------------------------------------- /src/DesktopTests/TestImages/wildlife_manager_listbox_owl_cropped.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/DesktopTests/TestImages/wildlife_manager_listbox_owl_cropped.bmp -------------------------------------------------------------------------------- /src/DesktopTests/TestImages/wildlife_manager_species_label.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/DesktopTests/TestImages/wildlife_manager_species_label.bmp -------------------------------------------------------------------------------- /src/DesktopTests/Types/TextAttributeTemplateTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Desktop.Types; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | using System; 7 | using System.Linq; 8 | 9 | namespace Axe.Windows.DesktopTests.Types 10 | { 11 | [TestClass] 12 | public class TextAttributeTemplateTests 13 | { 14 | private static readonly int[] IgnoreIds = new int[] { 15 | TextAttributeType.UIA_AnnotationObjectsAttributeId, 16 | TextAttributeType.UIA_LinkAttributeId, 17 | }; 18 | 19 | [TestMethod] 20 | public void TextAttributeTemplate_HasExpectedEntries() 21 | { 22 | var templateList = TextAttributeTemplate.GetTemplate(); 23 | var ids = TextAttributeType.GetInstance().Values; 24 | 25 | foreach (var id in ids) 26 | { 27 | if (IgnoreIds.Contains(id)) continue; 28 | 29 | Assert.IsTrue(templateList.Any(data => data.Item1 == id), $"{TextAttributeType.GetInstance().GetNameById(id)} was not found in the TextAttribute template"); 30 | } 31 | } 32 | } // class 33 | } // namespace 34 | -------------------------------------------------------------------------------- /src/DesktopTests/Utility/SupportedEventsTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Types; 5 | using Axe.Windows.Desktop.Types; 6 | using Axe.Windows.Desktop.Utility; 7 | using Microsoft.VisualStudio.TestTools.UnitTesting; 8 | using System.Linq; 9 | 10 | namespace Axe.Windows.DesktopTests.Utility 11 | { 12 | [TestClass] 13 | public class SupportedEventsTests 14 | { 15 | /// 16 | /// Testing whether the mappings contain / don't contain correct button events 17 | /// 18 | [TestMethod] 19 | public void EventTypeMappingsTest() 20 | { 21 | var mappings = SupportedEvents.EventTypeMappings.ToList(); 22 | Assert.IsTrue(mappings.Contains((ControlType.UIA_ButtonControlTypeId, EventType.UIA_Invoke_InvokedEventId, PatternType.UIA_InvokePatternId))); 23 | Assert.IsFalse(mappings.Contains((ControlType.UIA_ButtonControlTypeId, EventType.UIA_InputDiscardedEventId, null))); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/InteropDummy/InteropDummy.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | InteropDummy 7 | InteropDummy 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/InteropDummy/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Interop.UIAutomationCore; 5 | using System; 6 | 7 | namespace InteropDummy 8 | { 9 | class Program 10 | { 11 | static int Main(string[] _) 12 | { 13 | var fakeType = new CUIAutomationRegistrar().GetType(); 14 | 15 | #pragma warning disable CA1303 // Do not pass literals as localized parameters 16 | Console.WriteLine("This program exists to import Interop.UIAutomationCore.Signed.dll"); 17 | Console.WriteLine("in a way that makes it easy to handle the licensing."); 18 | #pragma warning restore CA1303 // Do not pass literals as localized parameters 19 | 20 | return (fakeType == typeof(int)) ? 1 : 0; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/MsiFileTests/MsiFileTests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0 5 | 6 | 7 | 8 | 9 | 10 | all 11 | runtime; build; native; contentfiles; analyzers; buildtransitive 12 | 13 | 14 | 15 | all 16 | runtime; build; native; contentfiles; analyzers; buildtransitive 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/OldFileVersionCompatibilityTests/TestFiles/WildlifeManager_AxeWindows_0_1_0.a11ytest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/OldFileVersionCompatibilityTests/TestFiles/WildlifeManager_AxeWindows_0_1_0.a11ytest -------------------------------------------------------------------------------- /src/OldFileVersionCompatibilityTests/TestFiles/WildlifeManager_AxeWindows_0_2_0.a11ytest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/OldFileVersionCompatibilityTests/TestFiles/WildlifeManager_AxeWindows_0_2_0.a11ytest -------------------------------------------------------------------------------- /src/OldFileVersionCompatibilityTests/TestFiles/WildlifeManager_AxeWindows_0_3_1.a11ytest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/OldFileVersionCompatibilityTests/TestFiles/WildlifeManager_AxeWindows_0_3_1.a11ytest -------------------------------------------------------------------------------- /src/RuleSelection/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System.Reflection; 5 | using System.Resources; 6 | using System.Runtime.CompilerServices; 7 | 8 | [assembly: AssemblyProduct("Axe.Windows.RuleSelection")] 9 | [assembly: AssemblyTitle("Axe.Windows.RuleSelection")] 10 | [assembly: AssemblyCopyright("Copyright © 2020")] 11 | 12 | [assembly: NeutralResourcesLanguage("en-US")] 13 | 14 | #if ENABLE_SIGNING 15 | [assembly: InternalsVisibleTo("RuleSelectionTests,PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] 16 | #else 17 | [assembly: InternalsVisibleTo("RuleSelectionTests")] 18 | #endif 19 | -------------------------------------------------------------------------------- /src/RuleSelection/Interfaces/IReferenceLink.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | 6 | namespace Axe.Windows.Extensions.Interfaces.ReferenceLinks 7 | { 8 | public interface IReferenceLink 9 | { 10 | string ShortDescription { get; } 11 | Uri Uri { get; } 12 | } // interface 13 | } // namespace 14 | -------------------------------------------------------------------------------- /src/RuleSelection/Interfaces/IReferenceLinks.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.Extensions.Interfaces.ReferenceLinks 5 | { 6 | /// 7 | /// Provides links to reference documentation 8 | /// which the Axe.Windows rules are meant to validate. 9 | /// 10 | public interface IReferenceLinks 11 | { 12 | IReferenceLink GetReferenceLink(string lookupToken); 13 | } // interface 14 | } // namespace 15 | -------------------------------------------------------------------------------- /src/RuleSelection/ReferenceLink.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Extensions.Interfaces.ReferenceLinks; 5 | using System; 6 | 7 | namespace Axe.Windows.RuleSelection 8 | { 9 | class ReferenceLink : IReferenceLink 10 | { 11 | public string ShortDescription { get; } 12 | public Uri Uri { get; } 13 | 14 | public ReferenceLink(string shortDescription, string url) 15 | { 16 | ShortDescription = shortDescription; 17 | Uri = new Uri(url); 18 | } 19 | 20 | public ReferenceLink(string shortDescription) 21 | { 22 | ShortDescription = shortDescription; 23 | } 24 | } // class 25 | } // namespace 26 | -------------------------------------------------------------------------------- /src/RuleSelection/RuleVersions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | namespace Axe.Windows.RuleSelection 4 | { 5 | static class RuleVersions 6 | { 7 | public const string Version = "1.0"; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/RuleSelectionTests/ReferenceLinksTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Rules; 5 | using Axe.Windows.RuleSelection; 6 | using Microsoft.VisualStudio.TestTools.UnitTesting; 7 | using System; 8 | 9 | namespace Axe.Windows.RuleSelectionTests 10 | { 11 | [TestClass] 12 | public class ReferenceLinksTests 13 | { 14 | [TestMethod] 15 | public void EnsureAllReferencesHaveValidLinks() 16 | { 17 | foreach (A11yCriteriaId id in Enum.GetValues(typeof(A11yCriteriaId))) 18 | { 19 | var link = ReferenceLinks.GetGuidelineInfo(id); 20 | Assert.IsNotNull(link); 21 | Assert.IsFalse(string.IsNullOrWhiteSpace(link.ShortDescription)); 22 | Assert.IsFalse(string.IsNullOrWhiteSpace(link.Url)); 23 | } 24 | } 25 | 26 | [TestMethod] 27 | public void EnsureNoExceptionsAreThrown() 28 | { 29 | var link = ReferenceLinks.GetGuidelineInfo((A11yCriteriaId)0xFFFF); 30 | Assert.IsNotNull(link); 31 | Assert.IsFalse(string.IsNullOrWhiteSpace(link.ShortDescription)); 32 | } 33 | } // class 34 | } // namespace 35 | -------------------------------------------------------------------------------- /src/RuleSelectionTests/RuleSelectionTests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0 5 | Axe.Windows.RuleSelectionTests 6 | 7 | 8 | 9 | 10 | 11 | all 12 | runtime; build; native; contentfiles; analyzers; buildtransitive 13 | 14 | 15 | all 16 | runtime; build; native; contentfiles; analyzers; buildtransitive 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/Rules/Conditions/AndCondition.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Bases; 5 | using Axe.Windows.Core.Misc; 6 | using Axe.Windows.Rules.Resources; 7 | using System; 8 | 9 | namespace Axe.Windows.Rules 10 | { 11 | class AndCondition : Condition 12 | { 13 | private readonly Condition _a; 14 | private readonly Condition _b; 15 | 16 | public AndCondition(Condition a, Condition b) 17 | { 18 | _a = a ?? throw new ArgumentNullException(nameof(a)); 19 | _b = b ?? throw new ArgumentNullException(nameof(b)); 20 | } 21 | 22 | public override bool Matches(IA11yElement element) 23 | { 24 | return _a.Matches(element) 25 | && _b.Matches(element); 26 | } 27 | 28 | public override string ToString() 29 | { 30 | return ConditionDescriptions.And.WithParameters(_a.ToString(), _b.ToString()); 31 | } 32 | } // class 33 | } // namespace 34 | -------------------------------------------------------------------------------- /src/Rules/Conditions/ConditionContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Bases; 5 | using System.Collections.Generic; 6 | 7 | namespace Axe.Windows.Rules 8 | { 9 | /// 10 | /// Contains state data that is accessible to all conditions while running rules 11 | /// Useful when one condition saves information to be accessed by another condition 12 | /// This is primarily used for comparing relations such as 13 | /// children, siblings, parents, ancestors, and descendants. 14 | /// 15 | class ConditionContext 16 | { 17 | public Stack ReferenceElements { get; } = new Stack(); 18 | } // class 19 | } // namespace 20 | -------------------------------------------------------------------------------- /src/Rules/Conditions/ControlTypeCondition.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Bases; 5 | using Axe.Windows.Rules.Resources; 6 | using System; 7 | 8 | namespace Axe.Windows.Rules 9 | { 10 | class ControlTypeCondition : Condition 11 | { 12 | public int ControlType { get; } 13 | 14 | public ControlTypeCondition(int controlType) 15 | { 16 | if (controlType == 0) throw new ArgumentException(ErrorMessages.IntParameterEqualsZero, nameof(controlType)); 17 | 18 | ControlType = controlType; 19 | } 20 | 21 | public override bool Matches(IA11yElement element) 22 | { 23 | if (element == null) throw new ArgumentNullException(nameof(element)); 24 | 25 | return element.ControlTypeId == ControlType; 26 | } 27 | 28 | public override string ToString() 29 | { 30 | // stripping away the integer name because it makes conditions harder to read 31 | var s = Axe.Windows.Core.Types.ControlType.GetInstance()?.GetNameById(ControlType); 32 | return s.Substring(0, s.IndexOf('(')); 33 | } 34 | } // class 35 | } // namespace 36 | -------------------------------------------------------------------------------- /src/Rules/Conditions/DelegateCondition.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Bases; 5 | using System; 6 | 7 | namespace Axe.Windows.Rules 8 | { 9 | class DelegateCondition : Condition 10 | { 11 | public delegate bool MatchesDelegate(IA11yElement element); 12 | private readonly MatchesDelegate _matches; 13 | 14 | public DelegateCondition(MatchesDelegate matches) 15 | { 16 | _matches = matches ?? throw new ArgumentNullException(nameof(matches)); 17 | } 18 | 19 | public override bool Matches(IA11yElement element) 20 | { 21 | return _matches(element); 22 | } 23 | 24 | public override string ToString() 25 | { 26 | return "DelegateCondition"; 27 | } 28 | } // class 29 | } // namespace 30 | -------------------------------------------------------------------------------- /src/Rules/Conditions/NotCondition.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Bases; 5 | using Axe.Windows.Core.Misc; 6 | using Axe.Windows.Rules.Resources; 7 | using System; 8 | 9 | namespace Axe.Windows.Rules 10 | { 11 | class NotCondition : Condition 12 | { 13 | private readonly Condition _a; 14 | 15 | public NotCondition(Condition a) 16 | { 17 | _a = a ?? throw new ArgumentNullException(nameof(a)); 18 | } 19 | 20 | public override bool Matches(IA11yElement element) 21 | { 22 | return !_a.Matches(element); 23 | } 24 | 25 | public override string ToString() 26 | { 27 | return ConditionDescriptions.Not.WithParameters(_a.ToString()); 28 | } 29 | } // class 30 | } // namespace 31 | -------------------------------------------------------------------------------- /src/Rules/Conditions/OrCondition.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Bases; 5 | using Axe.Windows.Core.Misc; 6 | using Axe.Windows.Rules.Resources; 7 | using System; 8 | 9 | namespace Axe.Windows.Rules 10 | { 11 | class OrCondition : Condition 12 | { 13 | private readonly Condition _a; 14 | private readonly Condition _b; 15 | 16 | public OrCondition(Condition a, Condition b) 17 | { 18 | _a = a ?? throw new ArgumentNullException(nameof(a)); 19 | _b = b ?? throw new ArgumentNullException(nameof(b)); 20 | } 21 | 22 | public override bool Matches(IA11yElement element) 23 | { 24 | return _a.Matches(element) 25 | || _b.Matches(element); 26 | } 27 | 28 | public override string ToString() 29 | { 30 | return ConditionDescriptions.Or.WithParameters(_a.ToString(), _b.ToString()); 31 | } 32 | } // class 33 | } // namespace 34 | -------------------------------------------------------------------------------- /src/Rules/Conditions/RecursiveCondition.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Bases; 5 | using System; 6 | 7 | namespace Axe.Windows.Rules 8 | { 9 | class RecursiveCondition : Condition 10 | { 11 | private Condition _a; 12 | 13 | private void Init(Condition a) 14 | { 15 | _a = a ?? throw new ArgumentNullException(nameof(a)); 16 | } 17 | 18 | public static RecursiveCondition operator %(RecursiveCondition r, Condition c) 19 | { 20 | r.Init(c); 21 | return r; 22 | } 23 | 24 | public override bool Matches(IA11yElement e) 25 | { 26 | if (e == null) throw new ArgumentNullException(nameof(e)); 27 | if (_a == null) return false; 28 | 29 | return _a.Matches(e); 30 | } 31 | 32 | public override string ToString() 33 | { 34 | return "Recursive"; 35 | } 36 | } // class 37 | } // namespace 38 | -------------------------------------------------------------------------------- /src/Rules/Conditions/StringDecoratorCondition.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Bases; 5 | using Axe.Windows.Core.Misc; 6 | using System; 7 | 8 | namespace Axe.Windows.Rules 9 | { 10 | /// 11 | /// This condition is used to change the output of the ToString function for a given condition. 12 | /// This can be useful for adding meaningful or simplified names to otherwise complicated conditions. 13 | /// 14 | class StringDecoratorCondition : Condition 15 | { 16 | private readonly Condition _sub; 17 | private readonly string _decoration; 18 | 19 | public StringDecoratorCondition(Condition c, string decoration) 20 | { 21 | _sub = c ?? throw new ArgumentNullException(nameof(c)); 22 | _decoration = decoration ?? throw new ArgumentNullException(nameof(decoration)); 23 | } 24 | 25 | public override bool Matches(IA11yElement element) 26 | { 27 | return _sub.Matches(element); 28 | } 29 | 30 | public override string ToString() 31 | { 32 | return _decoration.WithParameters(_sub); 33 | } 34 | } // class 35 | } // namespace 36 | -------------------------------------------------------------------------------- /src/Rules/IRuleFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Enums; 5 | 6 | namespace Axe.Windows.Rules 7 | { 8 | interface IRuleFactory 9 | { 10 | IRule CreateRule(RuleId id); 11 | } // interface 12 | } // namespace 13 | -------------------------------------------------------------------------------- /src/Rules/Library/ButtonInvokeAndTogglePatterns.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Bases; 5 | using Axe.Windows.Core.Enums; 6 | using Axe.Windows.Rules.PropertyConditions; 7 | using Axe.Windows.Rules.Resources; 8 | using static Axe.Windows.Rules.PropertyConditions.ControlType; 9 | 10 | namespace Axe.Windows.Rules.Library 11 | { 12 | [RuleInfo(ID = RuleId.ButtonInvokeAndTogglePatterns)] 13 | class ButtonInvokeAndTogglePatterns : Rule 14 | { 15 | public ButtonInvokeAndTogglePatterns() 16 | { 17 | Info.Description = Descriptions.ButtonInvokeAndTogglePatterns; 18 | Info.HowToFix = HowToFix.ButtonInvokeAndTogglePatterns; 19 | Info.Standard = A11yCriteriaId.NameRoleValue; 20 | Info.ErrorCode = EvaluationCode.Error; 21 | } 22 | 23 | public override bool PassesTest(IA11yElement e) 24 | { 25 | var rule = ~(Relationships.All(Patterns.Invoke, Patterns.Toggle)); 26 | 27 | return rule.Matches(e); 28 | } 29 | 30 | protected override Condition CreateCondition() 31 | { 32 | return Button; 33 | } 34 | } // class 35 | } // namespace 36 | -------------------------------------------------------------------------------- /src/Rules/Library/ChromiumComponentsShouldUseWebScanner.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Bases; 5 | using Axe.Windows.Core.Enums; 6 | using Axe.Windows.Rules.Resources; 7 | using static Axe.Windows.Rules.PropertyConditions.ElementGroups; 8 | 9 | namespace Axe.Windows.Rules.Library 10 | { 11 | [RuleInfo(ID = RuleId.ChromiumComponentsShouldUseWebScanner)] 12 | class ChromiumComponentsShouldUseWebScanner : Rule 13 | { 14 | public ChromiumComponentsShouldUseWebScanner() : base(excludedCondition: null) 15 | { 16 | Info.Description = Descriptions.ChromiumComponentsShouldUseWebScanner; 17 | Info.HowToFix = HowToFix.ChromiumComponentsShouldUseWebScanner; 18 | Info.ErrorCode = EvaluationCode.Error; 19 | } 20 | 21 | public override bool PassesTest(IA11yElement e) 22 | { 23 | return false; 24 | } 25 | 26 | protected override Condition CreateCondition() 27 | { 28 | return IsChromiumDocument; 29 | } 30 | } // class 31 | } // namespace 32 | -------------------------------------------------------------------------------- /src/Rules/Library/ItemStatusExists.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Bases; 5 | using Axe.Windows.Core.Enums; 6 | using Axe.Windows.Core.Types; 7 | using Axe.Windows.Rules.Resources; 8 | using static Axe.Windows.Rules.PropertyConditions.ControlType; 9 | using static Axe.Windows.Rules.PropertyConditions.StringProperties; 10 | 11 | namespace Axe.Windows.Rules.Library 12 | { 13 | [RuleInfo(ID = RuleId.ItemStatusExists)] 14 | class ItemStatusExists : Rule 15 | { 16 | public ItemStatusExists() 17 | { 18 | Info.Description = Descriptions.ItemStatusExists; 19 | Info.HowToFix = HowToFix.ItemStatusExists; 20 | Info.Standard = A11yCriteriaId.ObjectInformation; 21 | Info.PropertyID = PropertyType.UIA_ItemStatusPropertyId; 22 | Info.ErrorCode = EvaluationCode.NeedsReview; 23 | } 24 | 25 | public override bool PassesTest(IA11yElement e) 26 | { 27 | return false; 28 | } 29 | 30 | protected override Condition CreateCondition() 31 | { 32 | return HeaderItem & ItemStatus.Null; 33 | } 34 | } // class 35 | } // namespace 36 | -------------------------------------------------------------------------------- /src/Rules/Library/NameIsNotWhiteSpace.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Bases; 5 | using Axe.Windows.Core.Enums; 6 | using Axe.Windows.Core.Types; 7 | using Axe.Windows.Rules.Resources; 8 | using static Axe.Windows.Rules.PropertyConditions.StringProperties; 9 | 10 | namespace Axe.Windows.Rules.Library 11 | { 12 | [RuleInfo(ID = RuleId.NameNotWhiteSpace)] 13 | class NameIsNotWhiteSpace : Rule 14 | { 15 | public NameIsNotWhiteSpace() 16 | { 17 | Info.Description = Descriptions.NameNotWhiteSpace; 18 | Info.HowToFix = HowToFix.NameNotWhiteSpace; 19 | Info.Standard = A11yCriteriaId.ObjectInformation; 20 | Info.PropertyID = PropertyType.UIA_NamePropertyId; 21 | Info.ErrorCode = EvaluationCode.Error; 22 | } 23 | 24 | public override bool PassesTest(IA11yElement e) 25 | { 26 | return e.Name.Trim().Length > 0; 27 | } 28 | 29 | protected override Condition CreateCondition() 30 | { 31 | return Name.NotNullOrEmpty; 32 | } 33 | } // class 34 | } // namespace 35 | -------------------------------------------------------------------------------- /src/Rules/Library/NameOnOptionalType.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Bases; 5 | using Axe.Windows.Core.Enums; 6 | using Axe.Windows.Core.Types; 7 | using Axe.Windows.Rules.PropertyConditions; 8 | using Axe.Windows.Rules.Resources; 9 | using static Axe.Windows.Rules.PropertyConditions.StringProperties; 10 | 11 | namespace Axe.Windows.Rules.Library 12 | { 13 | [RuleInfo(ID = RuleId.NameOnOptionalType)] 14 | class NameOnOptionalType : Rule 15 | { 16 | public NameOnOptionalType() 17 | { 18 | Info.Description = Descriptions.NameOnOptionalType; 19 | Info.HowToFix = HowToFix.NameOnOptionalType; 20 | Info.Standard = A11yCriteriaId.ObjectInformation; 21 | Info.PropertyID = PropertyType.UIA_NamePropertyId; 22 | Info.ErrorCode = EvaluationCode.NeedsReview; 23 | } 24 | 25 | public override bool PassesTest(IA11yElement e) 26 | { 27 | return Name.NotNullOrEmpty.Matches(e); 28 | } 29 | 30 | protected override Condition CreateCondition() 31 | { 32 | return ElementGroups.NameOptional; 33 | } 34 | } // class 35 | } // namespace 36 | -------------------------------------------------------------------------------- /src/Rules/Misc/Helpers.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Types; 5 | using System; 6 | using UIAutomationClient; 7 | 8 | namespace Axe.Windows.Rules.Misc 9 | { 10 | static class Helpers 11 | { 12 | private static readonly Lazy DesktopLazy = new Lazy(GetDesktopElement); 13 | public static IUIAutomationElement Desktop => DesktopLazy.Value; 14 | 15 | private static IUIAutomationElement GetDesktopElement() 16 | { 17 | IUIAutomation uia = new CUIAutomation(); 18 | 19 | var cacheRequest = uia.CreateCacheRequest(); 20 | cacheRequest.AddProperty(PropertyType.UIA_BoundingRectanglePropertyId); 21 | 22 | return uia.GetRootElementBuildCache(cacheRequest); 23 | } 24 | } // class 25 | } // namespace 26 | -------------------------------------------------------------------------------- /src/Rules/PropertyConditions/Context.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Bases; 5 | 6 | namespace Axe.Windows.Rules.PropertyConditions 7 | { 8 | /// 9 | /// Used to push and pop context items such as elements from the per-thread context stack. 10 | /// This allows other conditions to reference saved values in addition to accessing just the properties of the given element in the Condition.Matches function. 11 | /// 12 | class Context 13 | { 14 | public static Condition Save(Condition c) 15 | { 16 | return new ContextCondition(c, InitializeElementContext, FinalizeElementContext); 17 | } 18 | 19 | private static void InitializeElementContext(IA11yElement e) 20 | { 21 | Condition.Context.Value.ReferenceElements.Push(e); 22 | } 23 | 24 | private static void FinalizeElementContext(IA11yElement e) 25 | { 26 | Condition.Context.Value.ReferenceElements.Pop(); 27 | } 28 | } // class 29 | } // namespace 30 | -------------------------------------------------------------------------------- /src/Rules/PropertyConditions/Framework.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Enums; 5 | 6 | namespace Axe.Windows.Rules.PropertyConditions 7 | { 8 | static class Framework 9 | { 10 | public static readonly Condition DirectUI = StringProperties.Framework.Is(FrameworkId.DirectUI); 11 | public static readonly Condition Edge = StringProperties.Framework.Is(FrameworkId.Edge); 12 | public static readonly Condition Chrome = StringProperties.Framework.Is(FrameworkId.Chrome); 13 | // The following name includes "Framework" to avoid clashing with the Win32 namespace 14 | public static readonly Condition Win32Framework = StringProperties.Framework.Is(FrameworkId.Win32); 15 | public static readonly Condition WinForms = StringProperties.Framework.Is(FrameworkId.WinForm); 16 | public static readonly Condition WPF = StringProperties.Framework.Is(FrameworkId.WPF); 17 | public static readonly Condition XAML = StringProperties.Framework.Is(FrameworkId.XAML); 18 | } // class 19 | } // namespace 20 | -------------------------------------------------------------------------------- /src/Rules/PropertyConditions/General.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | namespace Axe.Windows.Rules.PropertyConditions 4 | { 5 | static class General 6 | { 7 | public static Condition CreatePropertyExistsCondition(int propertyID) 8 | { 9 | return Condition.Create(e => e.TryGetPropertyValue(propertyID, out T value)); 10 | } 11 | } // class 12 | } // namespace 13 | -------------------------------------------------------------------------------- /src/Rules/PropertyConditions/IntProperties.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Enums; 5 | using Axe.Windows.Core.Types; 6 | using Axe.Windows.Rules.Resources; 7 | 8 | namespace Axe.Windows.Rules.PropertyConditions 9 | { 10 | static class IntProperties 11 | { 12 | public static EnumProperty Orientation = new EnumProperty(PropertyType.UIA_OrientationPropertyId); 13 | public static IntProperty HeadingLevel = new IntProperty(PropertyType.UIA_HeadingLevelPropertyId); 14 | public static IntProperty PositionInSet = new IntProperty(PropertyType.UIA_PositionInSetPropertyId); 15 | public static IntProperty SizeOfSet = new IntProperty(PropertyType.UIA_SizeOfSetPropertyId); 16 | public static IntProperty NativeWindowHandle = new IntProperty(PropertyType.UIA_NativeWindowHandlePropertyId, ConditionDescriptions.NativeWindowHandle); 17 | } // class 18 | } // namespace 19 | -------------------------------------------------------------------------------- /src/Rules/PropertyConditions/PlatformProperties.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Bases; 5 | using Axe.Windows.Core.Types; 6 | using System; 7 | 8 | namespace Axe.Windows.Rules.PropertyConditions 9 | { 10 | class PlatformProperties 11 | { 12 | public static Condition SimpleStyle = Condition.Create(IsSimpleStyle); 13 | 14 | private static bool IsSimpleStyle(IA11yElement e) 15 | { 16 | if (e == null) throw new ArgumentNullException(nameof(e)); 17 | 18 | var style = e.GetPlatformPropertyValue(PlatformPropertyType.Platform_WindowsStylePropertyId); 19 | 20 | const int CBS_SIMPLE = 1; 21 | 22 | return (style & CBS_SIMPLE) != 0; 23 | } 24 | } // class 25 | } // namespace 26 | -------------------------------------------------------------------------------- /src/Rules/PropertyConditions/SystemProperties.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.Rules.PropertyConditions 5 | { 6 | static class SystemProperties 7 | { 8 | private static readonly string SystemISOLanguageName = System.Globalization.CultureInfo.CurrentCulture.ThreeLetterISOLanguageName; 9 | 10 | internal static string OverriddenISOLanguageName { get; set; } 11 | 12 | public static Condition IsEnglish = CreateEnglishConditionWithTestOverride(); 13 | 14 | private static Condition CreateEnglishConditionWithTestOverride() 15 | { 16 | StringProperty cultureName = new StringProperty(_ => (OverriddenISOLanguageName ?? SystemISOLanguageName)); 17 | 18 | return cultureName.IsNoCase("eng"); 19 | } 20 | } // class 21 | } // namespace 22 | -------------------------------------------------------------------------------- /src/Rules/PropertyConditions/UWP.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using static Axe.Windows.Rules.PropertyConditions.Framework; 5 | using static Axe.Windows.Rules.PropertyConditions.Relationships; 6 | using static Axe.Windows.Rules.PropertyConditions.StringProperties; 7 | 8 | namespace Axe.Windows.Rules.PropertyConditions 9 | { 10 | static class UWP 11 | { 12 | public static Condition TopLevelElement = XAML & NotParent(XAML); 13 | public static Condition TitleBar = CreateTitleBarCondition(); 14 | public static Condition MenuBar = CreateMenuBarCondition(); 15 | 16 | private static Condition CreateTitleBarCondition() 17 | { 18 | var automationID = AutomationID.Is("TitleBar") | AutomationID.Is("TitleBarLeftButtons"); 19 | var className = ClassName.Is("ApplicationFrameTitleBarWindow"); 20 | return automationID & className & Win32Framework; 21 | } 22 | 23 | private static Condition CreateMenuBarCondition() 24 | { 25 | var automationID = AutomationID.Is("SystemMenuBar"); 26 | return automationID & Parent(Win32Framework); 27 | } 28 | } // class 29 | } // namespace 30 | -------------------------------------------------------------------------------- /src/Rules/ReadME.MD: -------------------------------------------------------------------------------- 1 | Before you create or modify any rules, please read this document. 2 | 3 | ##Creation of rules 4 | 1. Rules are created based on standards like MSDN and WCAG 5 | 2. Rules may be created based on existing accessibility tools after a review by Microsoft. 6 | 3. Rules that don't overlap with standards-based rules may be added after a review by Microsoft. 7 | 8 | ##Rule modification 9 | 1. Rules will be modified when standard guidelines or MSDN change. 10 | 2. Rules that don't overlap with standards-based rules may be modified after a review by Microsoft. 11 | 12 | ##Severity level of a scanned error 13 | 1. All errors , detected by Standard based rules, are reported as an error by default. 14 | 2. If there is a false positive reported by a customer, after a review by Microsoft, the severity level may be adjusted to warning. 15 | 16 | ##For this specific case, let's create 4 different rules for button pattern. 17 | - Invoke and Toggle can't exist together (if not, Error) 18 | - Invoke and ExpandCollapse may exist but not recommended. (if so, warning) 19 | - Toggle and ExpandCollapse can't exist together (if not, Error) 20 | 21 | ##Caveats 22 | Please don't remove or rename the RuleId(s). It will break backward compatibility since we serialize ruleIDs in string. -------------------------------------------------------------------------------- /src/Rules/RulesSettings.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.Rules 5 | { 6 | /// 7 | /// This class contains settings that influence the behavior of the rules engine. It is currently 8 | /// static for simplicity. This is a potential problem in the scenario of concurrent scans where the 9 | /// settings change in the middle of a scan. Given the very limited scope of the current settings, 10 | /// we are choosing to accept this limitation for now. 11 | /// 12 | internal static class RulesSettings 13 | { 14 | /// 15 | /// This setting controls whether the rules engine should test all Chromium content. This exists 16 | /// to allow browser teams to debug code that converts from HTML to UIA. It should be set to false 17 | /// in all other scenarios. 18 | /// 19 | internal static bool ShouldTestAllChromiumContent { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Rules/RunResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Bases; 5 | 6 | namespace Axe.Windows.Rules 7 | { 8 | /// 9 | /// Contains the result of the evaluation by a rule of a specific element. 10 | /// 11 | public class RunResult 12 | { 13 | /// 14 | /// Metadata about the rule that was run. 15 | /// 16 | public RuleInfo RuleInfo { get; set; } 17 | 18 | /// 19 | /// The element on which the rule was run. 20 | /// 21 | public IA11yElement element { get; set; } 22 | 23 | /// 24 | /// The result of the evaluation by the rule. 25 | /// 26 | public EvaluationCode EvaluationCode { get; set; } 27 | 28 | /// 29 | /// If contains the value , 30 | /// this property may contain a description of the error. 31 | /// Otherwise, it should be null. 32 | /// 33 | public string ErrorMessage { get; set; } 34 | } // class 35 | } // namespace 36 | -------------------------------------------------------------------------------- /src/RulesMD/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/RulesMD/CLIOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using CommandLine; 5 | 6 | namespace RulesMD 7 | { 8 | class CLIOptions 9 | { 10 | [Option('o', "output", Required = true, 11 | HelpText = "path to the markdown file to be created")] 12 | public string OutputPath { get; set; } 13 | } // class 14 | } // namespace 15 | -------------------------------------------------------------------------------- /src/RulesMD/EvaluationCodeDescriptions.md: -------------------------------------------------------------------------------- 1 | ## Severity descriptions 2 | 3 | ### Error 4 | 5 | The given element did not meet the success criteria of the rule evaluation. The problem likely can be addressed by the developer and the impact to users is significant. 6 | 7 | ### Warning 8 | 9 | The given element did not meet the success criteria of the rule evaluation, but the cause is known to be difficult for developers to fix (as in issues caused by the platform itself) or impact to users has been determined to be low. 10 | 11 | ### NeedsReview 12 | 13 | The rule highlights possible accessibility issues that need to be reviewed and verified by a human. 14 | -------------------------------------------------------------------------------- /src/RulesMD/Helpers.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Rules; 5 | using Axe.Windows.RuleSelection.Resources; 6 | 7 | namespace RulesMD 8 | { 9 | static class Helpers 10 | { 11 | public static string GetStandardName(A11yCriteriaId criteriaId) 12 | { 13 | switch (criteriaId) 14 | { 15 | case A11yCriteriaId.AvailableActions: 16 | return DefaultGuidelineShortDescriptions.AvailableActions; 17 | case A11yCriteriaId.InfoAndRelationships: 18 | return DefaultGuidelineShortDescriptions.InfoAndRelationships; 19 | case A11yCriteriaId.Keyboard: 20 | return DefaultGuidelineShortDescriptions.Keyboard; 21 | case A11yCriteriaId.NameRoleValue: 22 | return DefaultGuidelineShortDescriptions.NameRoleValue; 23 | case A11yCriteriaId.ObjectInformation: 24 | return DefaultGuidelineShortDescriptions.ObjectInformation; 25 | } 26 | 27 | return DefaultGuidelineShortDescriptions.None; 28 | } 29 | } // class 30 | } // namespace 31 | -------------------------------------------------------------------------------- /src/RulesMD/MarkdownCreator.tt: -------------------------------------------------------------------------------- 1 | <#@ template language="C#" #> 2 | <#@ assembly name="System.Core" #> 3 | <#@ import namespace="System.Linq" #> 4 | <#@ import namespace="System.Text" #> 5 | <#@ import namespace="System.Collections.Generic" #> 6 | <#@ import namespace="Rules=Axe.Windows.Rules.Rules"#> 7 | 8 | ## Rules in Axe.Windows 9 | 10 | Name | Severity | Description | Standard referenced 11 | --- | --- | --- | --- 12 | <# foreach (var rule in Rules.All.Values) 13 | { 14 | #> 15 | <#= rule.ID.ToString()#> | <#= rule.ErrorCode.ToString()#> | <#= rule.Description#> | <#= RulesMD.Helpers.GetStandardName(rule.Standard)#> <#= rule.Standard#> 16 | <#}#> 17 | 18 | <#@ include file="EvaluationCodeDescriptions.md" #> -------------------------------------------------------------------------------- /src/RulesMD/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using CommandLine; 5 | using System; 6 | using System.IO; 7 | 8 | namespace RulesMD 9 | { 10 | class Program 11 | { 12 | static void Main(string[] args) 13 | { 14 | try 15 | { 16 | DoWork(args); 17 | } 18 | catch (Exception ex) 19 | { 20 | Console.WriteLine(ex.Message); 21 | Environment.Exit(-1); 22 | } 23 | } 24 | 25 | static void DoWork(string[] args) 26 | { 27 | Parser.Default.ParseArguments(args) 28 | .WithParsed(Run); 29 | } 30 | 31 | private static void Run(CLIOptions options) 32 | { 33 | var markdownCreator = new MarkdownCreator(); 34 | var markdown = markdownCreator.TransformText(); 35 | 36 | var f = File.CreateText(options.OutputPath); 37 | f.Write(markdown); 38 | f.Close(); 39 | } 40 | } // class 41 | } // namespace 42 | -------------------------------------------------------------------------------- /src/RulesMD/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /src/RulesTest/.editorconfig: -------------------------------------------------------------------------------- 1 | # To learn more about .editorconfig see https://aka.ms/editorconfigdocs 2 | ################################################################# 3 | # .NET Coding Conventions (overridden for just this project # 4 | ################################################################# 5 | [*.{cs}] 6 | dotnet_style_object_initializer = false 7 | -------------------------------------------------------------------------------- /src/RulesTest/AllRules.test.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Rules; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | 7 | namespace Axe.Windows.RulesTests 8 | { 9 | [TestClass] 10 | public class AllRules 11 | { 12 | [TestMethod] 13 | public void AllRulesHaveErrorCode() 14 | { 15 | foreach (var rule in Rules.Rules.All.Values) 16 | Assert.AreNotEqual(EvaluationCode.NotSet, rule.ErrorCode); 17 | } 18 | } // class 19 | } // namespace 20 | -------------------------------------------------------------------------------- /src/RulesTest/Conditions/AndConditionTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Rules; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | 7 | namespace Axe.Windows.RulesTests.Conditions 8 | { 9 | [TestClass] 10 | public class AndConditionTests 11 | { 12 | [TestMethod] 13 | public void TestTrueTrue() 14 | { 15 | var test = new AndCondition(Condition.True, Condition.True); 16 | Assert.IsTrue(test.Matches(null)); 17 | } 18 | 19 | [TestMethod] 20 | public void TestTrueFalse() 21 | { 22 | var test = new AndCondition(Condition.True, Condition.False); 23 | Assert.IsFalse(test.Matches(null)); 24 | } 25 | 26 | [TestMethod] 27 | public void TestFalseTrue() 28 | { 29 | var test = new AndCondition(Condition.False, Condition.True); 30 | Assert.IsFalse(test.Matches(null)); 31 | } 32 | 33 | [TestMethod] 34 | public void TestFalseFalse() 35 | { 36 | var test = new AndCondition(Condition.False, Condition.False); 37 | Assert.IsFalse(test.Matches(null)); 38 | } 39 | } // class 40 | } // namespace 41 | -------------------------------------------------------------------------------- /src/RulesTest/Conditions/ControlTypeConditionTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Rules; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | 7 | namespace Axe.Windows.RulesTests.Conditions 8 | { 9 | [TestClass] 10 | public class ControlTypeConditionTests 11 | { 12 | [TestMethod] 13 | public void TestMatchingControlTypes() 14 | { 15 | using (var e = new MockA11yElement()) 16 | { 17 | e.ControlTypeId = ControlType.Button; 18 | var test = new ControlTypeCondition(ControlType.Button); 19 | Assert.IsTrue(test.Matches(e)); 20 | } // using 21 | } 22 | 23 | [TestMethod] 24 | public void TestNonMatchingControlTypes() 25 | { 26 | using (var e = new MockA11yElement()) 27 | { 28 | e.ControlTypeId = ControlType.CheckBox; 29 | var test = new ControlTypeCondition(ControlType.Button); 30 | Assert.IsFalse(test.Matches(e)); 31 | } // using 32 | } 33 | } // class 34 | } // namespace 35 | -------------------------------------------------------------------------------- /src/RulesTest/Conditions/NotConditionTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Rules; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | 7 | namespace Axe.Windows.RulesTests.Conditions 8 | { 9 | [TestClass] 10 | public class NotConditionTests 11 | { 12 | [TestMethod] 13 | public void TestNotTrue() 14 | { 15 | var test = new NotCondition(Condition.True); 16 | Assert.IsFalse(test.Matches(null)); 17 | } 18 | 19 | [TestMethod] 20 | public void TestNotFalse() 21 | { 22 | var test = new NotCondition(Condition.False); 23 | Assert.IsTrue(test.Matches(null)); 24 | } 25 | } // class 26 | } // namespace 27 | -------------------------------------------------------------------------------- /src/RulesTest/Conditions/OrConditionTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Rules; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | 7 | namespace Axe.Windows.RulesTests.Conditions 8 | { 9 | [TestClass] 10 | public class OrConditionTests 11 | { 12 | [TestMethod] 13 | public void TestTrueTrue() 14 | { 15 | var test = new OrCondition(Condition.True, Condition.True); 16 | Assert.IsTrue(test.Matches(null)); 17 | } 18 | 19 | [TestMethod] 20 | public void TestTrueFalse() 21 | { 22 | var test = new OrCondition(Condition.True, Condition.False); 23 | Assert.IsTrue(test.Matches(null)); 24 | } 25 | 26 | [TestMethod] 27 | public void TestFalseTrue() 28 | { 29 | var test = new OrCondition(Condition.False, Condition.True); 30 | Assert.IsTrue(test.Matches(null)); 31 | } 32 | 33 | [TestMethod] 34 | public void TestFalseFalse() 35 | { 36 | var test = new OrCondition(Condition.False, Condition.False); 37 | Assert.IsFalse(test.Matches(null)); 38 | } 39 | } // class 40 | } // namespace 41 | -------------------------------------------------------------------------------- /src/RulesTest/Library/BoundingRectangleNotValidButOffScreenTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Microsoft.VisualStudio.TestTools.UnitTesting; 5 | 6 | namespace Axe.Windows.RulesTests.Library 7 | { 8 | [TestClass] 9 | public class BoundingRectangleNotValidButOffScreenTests 10 | { 11 | private static readonly Axe.Windows.Rules.IRule Rule = new Axe.Windows.Rules.Library.BoundingRectangleNotValidButOffScreen(); 12 | 13 | [TestMethod] 14 | public void TestBoundingRectangleNotValidButOffScreenInformation() 15 | { 16 | Assert.IsFalse(Rule.PassesTest(null)); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/RulesTest/Library/SelectionPatternSelectionRequiredTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Bases; 5 | using Axe.Windows.Core.Enums; 6 | using Axe.Windows.Core.Types; 7 | using Microsoft.VisualStudio.TestTools.UnitTesting; 8 | 9 | namespace Axe.Windows.RulesTests.Library 10 | { 11 | [TestClass] 12 | public class SelectionPatternSelectionRequiredTests 13 | { 14 | private static readonly Axe.Windows.Rules.IRule Rule = new Axe.Windows.Rules.Library.SelectionPatternSelectionRequired(); 15 | 16 | [TestMethod] 17 | public void TabControlWithSelectionPatternButNotEdgeFramework_Applicable() 18 | { 19 | var e = new MockA11yElement(); 20 | e.ControlTypeId = Axe.Windows.Core.Types.ControlType.UIA_TabControlTypeId; 21 | e.Patterns.Add(new A11yPattern(e, PatternType.UIA_SelectionPatternId)); 22 | e.Framework = FrameworkId.Win32; 23 | 24 | Assert.IsTrue(Rule.Condition.Matches(e)); 25 | } 26 | } // class 27 | } // namespace 28 | -------------------------------------------------------------------------------- /src/RulesTest/Library/Structure/ContentView/SpinnerTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Rules; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | 7 | namespace Axe.Windows.RulesTests.Library.Structure.ContentView 8 | { 9 | [TestClass] 10 | public class SpinnerTests 11 | { 12 | private static readonly IRule Rule = new Axe.Windows.Rules.Library.ContentViewSpinnerStructure(); 13 | 14 | [TestMethod] 15 | public void Spinner_ZeroListItemChildren_Pass() 16 | { 17 | var spinner = new MockA11yElement(); 18 | spinner.ControlTypeId = ControlType.Spinner; 19 | 20 | Assert.IsTrue(Rule.PassesTest(spinner)); 21 | } 22 | 23 | [TestMethod] 24 | public void Spinner_ListItemChildren_Pass() 25 | { 26 | var spinner = new MockA11yElement(); 27 | spinner.ControlTypeId = ControlType.Spinner; 28 | 29 | var listItem = new MockA11yElement(); 30 | listItem.ControlTypeId = ControlType.ListItem; 31 | 32 | spinner.Children.Add(listItem); 33 | 34 | Assert.IsTrue(Rule.PassesTest(spinner)); 35 | } 36 | } // class 37 | } // namespace 38 | -------------------------------------------------------------------------------- /src/RulesTest/PropertyConditions/PlatformPropertiesTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.Core.Bases; 5 | using Axe.Windows.Core.Types; 6 | using Axe.Windows.Rules.PropertyConditions; 7 | using Microsoft.VisualStudio.TestTools.UnitTesting; 8 | 9 | namespace Axe.Windows.RulesTests.PropertyConditions 10 | { 11 | [TestClass] 12 | public class PlatformPropertiesTests 13 | { 14 | [TestMethod] 15 | public void SimpleStyleTrue() 16 | { 17 | using (var e = new MockA11yElement()) 18 | { 19 | var p = new A11yProperty(PlatformPropertyType.Platform_WindowsStylePropertyId, 1u); 20 | e.PlatformProperties.Add(PlatformPropertyType.Platform_WindowsStylePropertyId, p); 21 | 22 | Assert.IsTrue(PlatformProperties.SimpleStyle.Matches(e)); 23 | } // using 24 | } 25 | 26 | [TestMethod] 27 | public void SimpleStyleFalse() 28 | { 29 | using (var e = new MockA11yElement()) 30 | { 31 | Assert.IsFalse(PlatformProperties.SimpleStyle.Matches(e)); 32 | } // using 33 | } 34 | } // class 35 | } // namespace 36 | -------------------------------------------------------------------------------- /src/SystemAbstractions/Abstractions/IMicrosoft.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.SystemAbstractions 5 | { 6 | internal interface IMicrosoft 7 | { 8 | IMicrosoftWin32 Win32 { get; } 9 | } // interface 10 | } // namespace 11 | -------------------------------------------------------------------------------- /src/SystemAbstractions/Abstractions/IMicrosoftFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.SystemAbstractions 5 | { 6 | internal interface IMicrosoftFactory 7 | { 8 | IMicrosoftWin32 CreateMicrosoftWin32(); 9 | IMicrosoftWin32Registry CreateMicrosoftWin32Registry(); 10 | } // interface 11 | } // namespace 12 | -------------------------------------------------------------------------------- /src/SystemAbstractions/Abstractions/IMicrosoftWin32.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.SystemAbstractions 5 | { 6 | internal interface IMicrosoftWin32 7 | { 8 | IMicrosoftWin32Registry Registry { get; } 9 | } // interface 10 | } // namespace 11 | -------------------------------------------------------------------------------- /src/SystemAbstractions/Abstractions/IMicrosoftWin32Registry.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.SystemAbstractions 5 | { 6 | internal interface IMicrosoftWin32Registry 7 | { 8 | object GetValue(string keyName, string valueName, object defaultValue); 9 | } // interface 10 | } // namespace 11 | -------------------------------------------------------------------------------- /src/SystemAbstractions/Abstractions/ISystem.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.SystemAbstractions 5 | { 6 | public interface ISystem 7 | { 8 | ISystemDateTime DateTime { get; } 9 | ISystemEnvironment Environment { get; } 10 | ISystemIO IO { get; } 11 | } // interface 12 | } // namespace 13 | -------------------------------------------------------------------------------- /src/SystemAbstractions/Abstractions/ISystemDateTime.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | 6 | namespace Axe.Windows.SystemAbstractions 7 | { 8 | public interface ISystemDateTime 9 | { 10 | DateTime Now { get; } 11 | } // interface 12 | } // namespace 13 | -------------------------------------------------------------------------------- /src/SystemAbstractions/Abstractions/ISystemEnvironment.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.SystemAbstractions 5 | { 6 | public interface ISystemEnvironment 7 | { 8 | string CurrentDirectory { get; } 9 | } // interface 10 | } // namespace 11 | -------------------------------------------------------------------------------- /src/SystemAbstractions/Abstractions/ISystemFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.SystemAbstractions 5 | { 6 | internal interface ISystemFactory 7 | { 8 | ISystemDateTime CreateSystemDateTime(); 9 | ISystemEnvironment CreateSystemEnvironment(); 10 | ISystemIO CreateSystemIO(); 11 | ISystemIODirectory CreateSystemIODirectory(); 12 | } // interface 13 | } // namespace 14 | -------------------------------------------------------------------------------- /src/SystemAbstractions/Abstractions/ISystemIO.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.SystemAbstractions 5 | { 6 | public interface ISystemIO 7 | { 8 | ISystemIODirectory Directory { get; } 9 | } // interface 10 | } // namespace 11 | -------------------------------------------------------------------------------- /src/SystemAbstractions/Abstractions/ISystemIODirectory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System.IO; 5 | 6 | namespace Axe.Windows.SystemAbstractions 7 | { 8 | public interface ISystemIODirectory 9 | { 10 | DirectoryInfo CreateDirectory(string path); 11 | bool Exists(string path); 12 | } // interface 13 | } // namespace 14 | -------------------------------------------------------------------------------- /src/SystemAbstractions/Concretions/Microsoft.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | 6 | namespace Axe.Windows.SystemAbstractions 7 | { 8 | internal class Microsoft : IMicrosoft 9 | { 10 | private readonly Lazy _win32; 11 | 12 | public Microsoft(IMicrosoftFactory factory) 13 | { 14 | if (factory == null) throw new ArgumentNullException(nameof(factory)); 15 | 16 | _win32 = new Lazy(factory.CreateMicrosoftWin32); 17 | } 18 | 19 | public IMicrosoftWin32 Win32 => _win32.Value; 20 | } // class 21 | } // namespace 22 | -------------------------------------------------------------------------------- /src/SystemAbstractions/Concretions/MicrosoftFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.SystemAbstractions 5 | { 6 | internal class MicrosoftFactory : IMicrosoftFactory 7 | { 8 | private static readonly IMicrosoftFactory MicrosoftFactoryInstance = new MicrosoftFactory(); 9 | 10 | private MicrosoftFactory() 11 | { } 12 | 13 | public static IMicrosoft CreateMicrosoft() 14 | { 15 | return new Microsoft(MicrosoftFactoryInstance); 16 | } 17 | 18 | public IMicrosoftWin32 CreateMicrosoftWin32() 19 | { 20 | return new MicrosoftWin32(MicrosoftFactoryInstance); 21 | } 22 | 23 | public IMicrosoftWin32Registry CreateMicrosoftWin32Registry() 24 | { 25 | return new MicrosoftWin32Registry(); 26 | } 27 | } // class 28 | } // namespace 29 | -------------------------------------------------------------------------------- /src/SystemAbstractions/Concretions/MicrosoftWin32.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | 6 | namespace Axe.Windows.SystemAbstractions 7 | { 8 | internal class MicrosoftWin32 : IMicrosoftWin32 9 | { 10 | private readonly Lazy _win32Registry; 11 | 12 | public MicrosoftWin32(IMicrosoftFactory factory) 13 | { 14 | if (factory == null) throw new ArgumentNullException(nameof(factory)); 15 | 16 | _win32Registry = new Lazy(factory.CreateMicrosoftWin32Registry); 17 | } 18 | 19 | public IMicrosoftWin32Registry Registry => _win32Registry.Value; 20 | } // class 21 | } // namespace 22 | -------------------------------------------------------------------------------- /src/SystemAbstractions/Concretions/MicrosoftWin32Registry.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Microsoft.Win32; 5 | 6 | namespace Axe.Windows.SystemAbstractions 7 | { 8 | internal class MicrosoftWin32Registry : IMicrosoftWin32Registry 9 | { 10 | public object GetValue(string keyName, string valueName, object defaultValue) 11 | { 12 | return Registry.GetValue(keyName, valueName, defaultValue); 13 | } 14 | } // class 15 | } // namespace 16 | -------------------------------------------------------------------------------- /src/SystemAbstractions/Concretions/System.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | 6 | namespace Axe.Windows.SystemAbstractions 7 | { 8 | internal class System : ISystem 9 | { 10 | private readonly Lazy _dateTime; 11 | private readonly Lazy _environment; 12 | private readonly Lazy _io; 13 | 14 | public System(ISystemFactory factory) 15 | { 16 | if (factory == null) throw new ArgumentNullException(nameof(factory)); 17 | 18 | _dateTime = new Lazy(factory.CreateSystemDateTime); 19 | _environment = new Lazy(factory.CreateSystemEnvironment); 20 | _io = new Lazy(factory.CreateSystemIO); 21 | } 22 | 23 | public ISystemDateTime DateTime => _dateTime.Value; 24 | 25 | public ISystemEnvironment Environment => _environment.Value; 26 | 27 | public ISystemIO IO => _io.Value; 28 | } // class 29 | } // namespace 30 | -------------------------------------------------------------------------------- /src/SystemAbstractions/Concretions/SystemDateTime.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | 6 | namespace Axe.Windows.SystemAbstractions 7 | { 8 | internal class SystemDateTime : ISystemDateTime 9 | { 10 | public DateTime Now => DateTime.Now; 11 | } // class 12 | } // namespace 13 | -------------------------------------------------------------------------------- /src/SystemAbstractions/Concretions/SystemEnvironment.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | 6 | namespace Axe.Windows.SystemAbstractions 7 | { 8 | internal class SystemEnvironment : ISystemEnvironment 9 | { 10 | public string CurrentDirectory => Environment.CurrentDirectory; 11 | } // class 12 | } // namespace 13 | -------------------------------------------------------------------------------- /src/SystemAbstractions/Concretions/SystemFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.SystemAbstractions 5 | { 6 | public class SystemFactory : ISystemFactory 7 | { 8 | private static readonly ISystemFactory SystemFactoryInstance = new SystemFactory(); 9 | 10 | private SystemFactory() 11 | { } 12 | 13 | public static ISystem CreateSystem() 14 | { 15 | return new System(SystemFactoryInstance); 16 | } 17 | 18 | public ISystemDateTime CreateSystemDateTime() 19 | { 20 | return new SystemDateTime(); 21 | } 22 | 23 | public ISystemEnvironment CreateSystemEnvironment() 24 | { 25 | return new SystemEnvironment(); 26 | } 27 | 28 | public ISystemIO CreateSystemIO() 29 | { 30 | return new SystemIO(this); 31 | } 32 | 33 | public ISystemIODirectory CreateSystemIODirectory() 34 | { 35 | return new SystemIODirectory(); 36 | } 37 | } // class 38 | } // namespace 39 | -------------------------------------------------------------------------------- /src/SystemAbstractions/Concretions/SystemIO.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | 6 | namespace Axe.Windows.SystemAbstractions 7 | { 8 | internal class SystemIO : ISystemIO 9 | { 10 | private readonly Lazy _directory; 11 | 12 | public SystemIO(ISystemFactory factory) 13 | { 14 | if (factory == null) throw new ArgumentNullException(nameof(factory)); 15 | 16 | _directory = new Lazy(factory.CreateSystemIODirectory); 17 | } 18 | 19 | public ISystemIODirectory Directory => _directory.Value; 20 | } // class 21 | } // namespace 22 | -------------------------------------------------------------------------------- /src/SystemAbstractions/Concretions/SystemIODirectory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System.IO; 5 | 6 | namespace Axe.Windows.SystemAbstractions 7 | { 8 | internal class SystemIODirectory : ISystemIODirectory 9 | { 10 | public DirectoryInfo CreateDirectory(string path) 11 | { 12 | return Directory.CreateDirectory(path); 13 | } 14 | 15 | public bool Exists(string path) 16 | { 17 | return Directory.Exists(path); 18 | } 19 | } // class 20 | } // namespace 21 | -------------------------------------------------------------------------------- /src/SystemAbstractionsTests/MicrosoftUnitTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using Axe.Windows.SystemAbstractions; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | using Microsoft.Win32; 7 | 8 | namespace Axe.Windows.SystemAbstractionsTests 9 | { 10 | [TestClass] 11 | public class MicrosoftUnitTests 12 | { 13 | private readonly IMicrosoft _microsoft = MicrosoftFactory.CreateMicrosoft(); 14 | 15 | [TestMethod] 16 | [Timeout(1000)] 17 | public void RegistryGetValue_Matches() 18 | { 19 | const string WindowsVersionRegKey = @"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion"; 20 | const string currentVersion = "CurrentVersion"; 21 | 22 | var expectedValue = Registry.GetValue(WindowsVersionRegKey, currentVersion, string.Empty); 23 | var actualValue = _microsoft.Win32.Registry.GetValue(WindowsVersionRegKey, currentVersion, string.Empty); 24 | 25 | Assert.AreEqual(expectedValue, actualValue); 26 | } 27 | } // class 28 | } // namespace 29 | -------------------------------------------------------------------------------- /src/Telemetry/ExcludedException.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | 6 | namespace Axe.Windows.Telemetry 7 | { 8 | #pragma warning disable CA2237 // Mark ISerializable types with serializable 9 | #pragma warning disable CA1032 // Implement standard exception constructors 10 | /// 11 | /// Class to wrap Exceptions that should be excluded from the Telemetry pipeline. 12 | /// These Exceptions are still Exceptions for control flow. 13 | /// 14 | public class ExcludedException : Exception 15 | #pragma warning restore CA1032 // Implement standard exception constructors 16 | #pragma warning restore CA2237 // Mark ISerializable types with serializable 17 | { 18 | /// 19 | /// The type of the Exception that was excluded 20 | /// 21 | public Type ExcludedType => InnerException.GetType(); 22 | 23 | public ExcludedException(Exception innerException) 24 | : base(innerException?.Message, innerException) 25 | { 26 | if (innerException == null) throw new ArgumentNullException(nameof(innerException)); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Telemetry/IAxeWindowsTelemetry.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | 7 | namespace Axe.Windows.Telemetry 8 | { 9 | public interface IAxeWindowsTelemetry 10 | { 11 | /// 12 | /// Publish a single event to the telemetry stream. 13 | /// 14 | /// The name of the event. Will be ignored if trivial 15 | /// The properties to include with the event. Will be ignored if trivial 16 | void PublishEvent(string eventName, IReadOnlyDictionary properties); 17 | 18 | /// 19 | /// Report an Exception into the pipeline 20 | /// 21 | /// The Exception to report 22 | void ReportException(Exception e); 23 | 24 | /// 25 | /// Whether or not telemetry is enabled. Exposed to allow callers who do lots of 26 | /// work to short-circuit their processing when telemetry is disabled 27 | /// 28 | bool IsEnabled { get; } 29 | } // interface 30 | } // namespace 31 | -------------------------------------------------------------------------------- /src/Telemetry/TelemetryAction.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | // 4 | namespace Axe.Windows.Telemetry 5 | { 6 | /// 7 | /// Telemetry Actions, following the pattern of Scope_Verb_Result 8 | /// 9 | internal enum TelemetryAction 10 | { 11 | #pragma warning disable CA1707 // Identifiers should not contain underscores 12 | Scan_Statistics, 13 | SingleRule_Tested_Results, 14 | #pragma warning restore CA1707 // Identifiers should not contain underscores 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Telemetry/TelemetryProperty.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | // 4 | namespace Axe.Windows.Telemetry 5 | { 6 | /// 7 | /// Enums for Telemetry Properties 8 | /// 9 | internal enum TelemetryProperty 10 | { 11 | ControlType, 12 | ElementsInScan, 13 | ScanDurationInMilliseconds, 14 | Results, 15 | RuleId, 16 | TestResults, // parent container, has rule id and results 17 | UIFramework, 18 | UpperBoundExceeded, 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/TelemetryTests/TelemetryTests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | Axe.Windows.TelemetryTests 6 | 7 | 8 | 9 | 10 | 11 | all 12 | runtime; build; native; contentfiles; analyzers; buildtransitive 13 | 14 | 15 | 16 | all 17 | runtime; build; native; contentfiles; analyzers; buildtransitive 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/UIAAssemblies/Win10.17713/Interop.UIAutomationClient.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/src/UIAAssemblies/Win10.17713/Interop.UIAutomationClient.dll -------------------------------------------------------------------------------- /src/UIAAssemblies/readme.md: -------------------------------------------------------------------------------- 1 | The UIA interop files will periodically need to be updated to take advantage of new UIA features. When this happens, do the following: 2 | 3 | 1. Obtain the updated version of UIAutomationCore.dll. This file lives in the windows\system32 folder of your windows installation. 4 | 2. From an administrative command prompt, execute the following command: 5 | 6 | tlbimp UIAutomationCore.dll /namespace:UIAutomationClient /out:Interop.UIAutomationClient.dll 7 | 8 | 3. Create a new folder for the new Windows version 9 | 4. Copy Interop.UIAutomationClient.dll to the new folder 10 | 5. Do a global search & replace to update `UIAAssemblies\Win10.XXXXX\` to `UIAAssemblies\Win10.YYYYY\` in the csproj files. As of this writing, this will touch the following projects: 11 | 12 | * Actions.csproj 13 | * Desktop.csproj 14 | * Rules.csproj 15 | * RulesTests.csproj 16 | 17 | 6. Delete the folder containing the old interop file (potentially in a separate PR, if you wish) 18 | 19 | -------------------------------------------------------------------------------- /src/UnitTestSharedLibrary/TestCategory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Axe.Windows.UnitTestSharedLibrary 5 | { 6 | public static class TestCategory 7 | { 8 | public const string Integration = "Integration"; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Win32/HighContrast.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System.Runtime.InteropServices; 5 | 6 | namespace Axe.Windows.Win32 7 | { 8 | internal class HighContrast 9 | { 10 | private const uint SPI_GetHighContrast = 0x0042; 11 | private const uint HighContrastOnFlag = 0x1; 12 | 13 | private HighContrastData _data; 14 | 15 | public bool IsOn => (_data.Flags & HighContrastOnFlag) == HighContrastOnFlag; 16 | 17 | private HighContrast(HighContrastData data) 18 | { 19 | _data = data; 20 | } 21 | 22 | public static HighContrast Create() 23 | { 24 | var data = new HighContrastData(); 25 | data.Size = (uint)Marshal.SizeOf(data); 26 | 27 | NativeMethods.SystemParametersInfoHighContrast(SPI_GetHighContrast, data.Size, ref data, 0); 28 | 29 | return new HighContrast(data); 30 | } 31 | } // struct 32 | } // namespace 33 | -------------------------------------------------------------------------------- /src/Win32/HighContrastData.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | using System.Runtime.InteropServices; 6 | 7 | namespace Axe.Windows.Win32 8 | { 9 | [StructLayout(LayoutKind.Sequential)] 10 | internal struct HighContrastData 11 | { 12 | public uint Size; 13 | public int Flags; 14 | 15 | // changing the following type to string will cause .NET Core to crash during the unit tests 16 | public IntPtr DefaultScheme; 17 | } // struct 18 | } // namespace 19 | -------------------------------------------------------------------------------- /src/Win32/Win32Constants.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | namespace Axe.Windows.Win32 4 | { 5 | /// 6 | /// Win32-related constants. Some of these definitions originated from https://pinvoke.net/ 7 | /// 8 | internal static class Win32Constants 9 | { 10 | public const int GWL_STYLE = -16; 11 | public const int GWL_EXSTYLE = -20; 12 | 13 | #pragma warning disable IDE1006 // Naming Styles 14 | public const int S_OK = 0; 15 | #pragma warning restore IDE1006 // Naming Styles 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Win32Tests/Win32Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | Axe.Windows.Win32Tests 6 | 7 | 8 | 9 | 10 | 11 | all 12 | runtime; build; native; contentfiles; analyzers; buildtransitive 13 | 14 | 15 | 16 | all 17 | runtime; build; native; contentfiles; analyzers; buildtransitive 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/props/version.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2.4.3 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tools/LocTestingSampleApp/LocTestingSampleApp.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net6.0 6 | AxeWinLocTesting 7 | enable 8 | enable 9 | AnyCPU;x86 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /tools/WebViewSample/WebViewSample.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/tools/WebViewSample/WebViewSample.exe -------------------------------------------------------------------------------- /tools/WebViewSample/src/App.xaml: -------------------------------------------------------------------------------- 1 |  3 | 4 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tools/WebViewSample/src/App.xaml.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Configuration; 7 | using System.Data; 8 | using System.Linq; 9 | using System.Threading.Tasks; 10 | using System.Windows; 11 | 12 | namespace WebViewSample 13 | { 14 | /// 15 | /// Interaction logic for App.xaml 16 | /// 17 | public partial class App : Application 18 | { 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tools/WebViewSample/src/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System.Windows; 5 | 6 | [assembly:ThemeInfo( 7 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 8 | //(used if a resource is not found in the page, 9 | // or application resource dictionaries) 10 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 11 | //(used if a resource is not found in the page, 12 | // app, or any theme specific resource dictionaries) 13 | )] 14 | -------------------------------------------------------------------------------- /tools/WebViewSample/src/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  3 | 4 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /tools/WebViewSample/src/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows; 10 | using System.Windows.Controls; 11 | using System.Windows.Data; 12 | using System.Windows.Documents; 13 | using System.Windows.Input; 14 | using System.Windows.Media; 15 | using System.Windows.Media.Imaging; 16 | using System.Windows.Navigation; 17 | using System.Windows.Shapes; 18 | 19 | namespace WebViewSample 20 | { 21 | /// 22 | /// Interaction logic for MainWindow.xaml 23 | /// 24 | public partial class MainWindow : Window 25 | { 26 | public MainWindow() 27 | { 28 | InitializeComponent(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tools/WebViewSample/src/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | ## Overview 4 | This project provides a test app that opens a web page in the [Microsoft.Web.WebView2](https://www.nuget.org/packages/Microsoft.Web.WebView2) control. It is used as a test bed for running Accessibility Insights for Windows on a web application. Thsi is generally _not_ recommneded, since it is difficult to know how to address any issues that are raised. The recommended option is to scan the HTML using a web-based engine such as Accessibility Insights for Web. 5 | 6 | ## Updating the project 7 | You can build and run the project from within Visual Studio. If you need to update the binary that we use for tests, you will need to run the following command: 8 | 9 | ``` 10 | dotnet publish -r win-x64 -c release 11 | ``` 12 | 13 | Then copy `bin\release\net6.0-windows\win-x64\publish\WebViewSample.exe` over the binary that is stored in the repo. 14 | 15 | -------------------------------------------------------------------------------- /tools/WebViewSample/src/WebViewSample.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | WinExe 5 | net6.0-windows 6 | true 7 | false 8 | true 9 | win-x64 10 | enable 11 | true 12 | true 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tools/WildlifeManager/WildlifeManager.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/tools/WildlifeManager/WildlifeManager.exe -------------------------------------------------------------------------------- /tools/WildlifeManager/WildlifeManager.exe.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tools/WildlifeManager/src/WildlifeManager/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tools/WildlifeManager/src/WildlifeManager/App.xaml: -------------------------------------------------------------------------------- 1 |  3 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tools/WildlifeManager/src/WildlifeManager/App.xaml.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | using System.Windows; 4 | 5 | namespace WildlifeManager 6 | { 7 | /// 8 | /// Interaction logic for App.xaml 9 | /// 10 | public partial class App : Application 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tools/WildlifeManager/src/WildlifeManager/CustomControl.xaml: -------------------------------------------------------------------------------- 1 |  3 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tools/WildlifeManager/src/WildlifeManager/CustomControl.xaml.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | using System.Windows.Controls; 4 | 5 | namespace WildlifeManager 6 | { 7 | /// 8 | /// Interaction logic for CustomControl.xaml 9 | /// 10 | public partial class CustomControl : UserControl 11 | { 12 | public CustomControl() 13 | { 14 | InitializeComponent(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tools/WildlifeManager/src/WildlifeManager/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | using System.Windows; 4 | using System.Windows.Documents; 5 | using System.Windows.Input; 6 | using System.Windows.Navigation; 7 | 8 | namespace WildlifeManager 9 | { 10 | /// 11 | /// Interaction logic for MainWindow.xaml 12 | /// 13 | public partial class MainWindow : Window 14 | { 15 | public MainWindow() 16 | { 17 | InitializeComponent(); 18 | } 19 | 20 | private void UserControl_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) 21 | { 22 | } 23 | 24 | private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e) 25 | { 26 | System.Diagnostics.Process.Start((sender as Hyperlink).NavigateUri.ToString()); 27 | } 28 | 29 | private void UserControl_Loaded(object sender, RoutedEventArgs e) 30 | { 31 | 32 | } 33 | 34 | private void InvokeToggleButton_Click(object sender, RoutedEventArgs e) 35 | { 36 | this.Close(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tools/WildlifeManager/src/WildlifeManager/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WildlifeManager.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.2.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tools/WildlifeManager/src/WildlifeManager/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tools/Win32ControlSampler/Win32ControlSampler.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/tools/Win32ControlSampler/Win32ControlSampler.exe -------------------------------------------------------------------------------- /tools/Win32ControlSampler/src/Win32ControlSampler/Win32ControlSampler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "resource.h" 4 | 5 | // This is needed to load the appropriate version of comctl32.dll 6 | #pragma comment(linker,"\"/manifestdependency:type='win32' \ 7 | name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \ 8 | processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") -------------------------------------------------------------------------------- /tools/Win32ControlSampler/src/Win32ControlSampler/Win32ControlSampler.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/tools/Win32ControlSampler/src/Win32ControlSampler/Win32ControlSampler.ico -------------------------------------------------------------------------------- /tools/Win32ControlSampler/src/Win32ControlSampler/framework.h: -------------------------------------------------------------------------------- 1 | // header.h : include file for standard system include files, 2 | // or project specific include files 3 | // 4 | 5 | #pragma once 6 | 7 | #include "targetver.h" 8 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 9 | // Windows Header Files 10 | #include 11 | // C RunTime Header Files 12 | #include 13 | #include 14 | #include 15 | #include 16 | -------------------------------------------------------------------------------- /tools/Win32ControlSampler/src/Win32ControlSampler/small.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/tools/Win32ControlSampler/src/Win32ControlSampler/small.ico -------------------------------------------------------------------------------- /tools/Win32ControlSampler/src/Win32ControlSampler/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // // Including SDKDDKVer.h defines the highest available Windows platform. 4 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 5 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 6 | #include 7 | -------------------------------------------------------------------------------- /tools/WindowsFormsControlSampler/WindowsFormsControlSampler.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/tools/WindowsFormsControlSampler/WindowsFormsControlSampler.exe -------------------------------------------------------------------------------- /tools/WindowsFormsControlSampler/WindowsFormsControlSampler.exe.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tools/WindowsFormsControlSampler/src/WindowsFormsControlSampler/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tools/WindowsFormsControlSampler/src/WindowsFormsControlSampler/Form1.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel; 6 | using System.Data; 7 | using System.Drawing; 8 | using System.Linq; 9 | using System.Text; 10 | using System.Threading.Tasks; 11 | using System.Windows.Forms; 12 | 13 | namespace WindowsFormsControlSampler 14 | { 15 | public partial class Form1 : Form 16 | { 17 | public Form1() 18 | { 19 | InitializeComponent(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tools/WindowsFormsControlSampler/src/WindowsFormsControlSampler/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows.Forms; 8 | 9 | namespace WindowsFormsControlSampler 10 | { 11 | static class Program 12 | { 13 | /// 14 | /// The main entry point for the application. 15 | /// 16 | [STAThread] 17 | static void Main() 18 | { 19 | Application.EnableVisualStyles(); 20 | Application.SetCompatibleTextRenderingDefault(false); 21 | Application.Run(new Form1()); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /tools/WindowsFormsControlSampler/src/WindowsFormsControlSampler/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WindowsFormsControlSampler.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.2.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tools/WindowsFormsControlSampler/src/WindowsFormsControlSampler/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tools/WindowsFormsMultiWindowSample/WindowsFormsMultiWindowSample.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/tools/WindowsFormsMultiWindowSample/WindowsFormsMultiWindowSample.exe -------------------------------------------------------------------------------- /tools/WindowsFormsMultiWindowSample/WindowsFormsMultiWindowSample.exe.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tools/WindowsFormsMultiWindowSample/src/WindowsFormsMultiWindowSample/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tools/WindowsFormsMultiWindowSample/src/WindowsFormsMultiWindowSample/Form1.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel; 6 | using System.Data; 7 | using System.Drawing; 8 | using System.Linq; 9 | using System.Text; 10 | using System.Threading.Tasks; 11 | using System.Windows.Forms; 12 | 13 | namespace WindowsFormsMultiWindowSample 14 | { 15 | public partial class Form1 : Form 16 | { 17 | public Form1() 18 | { 19 | InitializeComponent(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tools/WindowsFormsMultiWindowSample/src/WindowsFormsMultiWindowSample/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows.Forms; 8 | 9 | namespace WindowsFormsMultiWindowSample 10 | { 11 | static class Program 12 | { 13 | /// 14 | /// The main entry point for the application. 15 | /// 16 | [STAThread] 17 | static void Main() 18 | { 19 | Application.EnableVisualStyles(); 20 | Application.SetCompatibleTextRenderingDefault(false); 21 | var secondForm = new Form1(); 22 | secondForm.Show(); 23 | Application.Run(new Form1()); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tools/WindowsFormsMultiWindowSample/src/WindowsFormsMultiWindowSample/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WindowsFormsMultiWindowSample.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.2.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tools/WindowsFormsMultiWindowSample/src/WindowsFormsMultiWindowSample/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tools/WpfControlSampler/WpfControlSampler.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/axe-windows/054bd02c6bddecc5903badf0d64e5e31924060a1/tools/WpfControlSampler/WpfControlSampler.exe -------------------------------------------------------------------------------- /tools/WpfControlSampler/WpfControlSampler.exe.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tools/WpfControlSampler/src/WpfControlSampler/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tools/WpfControlSampler/src/WpfControlSampler/App.xaml: -------------------------------------------------------------------------------- 1 |  3 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tools/WpfControlSampler/src/WpfControlSampler/App.xaml.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Configuration; 6 | using System.Data; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | using System.Windows; 10 | 11 | namespace WpfControlSampler 12 | { 13 | /// 14 | /// Interaction logic for App.xaml 15 | /// 16 | public partial class App : Application 17 | { 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tools/WpfControlSampler/src/WpfControlSampler/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using System.Windows; 9 | using System.Windows.Controls; 10 | using System.Windows.Data; 11 | using System.Windows.Documents; 12 | using System.Windows.Input; 13 | using System.Windows.Media; 14 | using System.Windows.Media.Imaging; 15 | using System.Windows.Navigation; 16 | using System.Windows.Shapes; 17 | 18 | namespace WpfControlSampler 19 | { 20 | /// 21 | /// Interaction logic for MainWindow.xaml 22 | /// 23 | public partial class MainWindow : Window 24 | { 25 | public MainWindow() 26 | { 27 | InitializeComponent(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /tools/WpfControlSampler/src/WpfControlSampler/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WpfControlSampler.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.2.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tools/WpfControlSampler/src/WpfControlSampler/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tools/scripts/pipeline/build/clearly-defined/clearly-defined-exclusions.json: -------------------------------------------------------------------------------- 1 | [ 2 | "-/coverlet.msbuild", 3 | "-/Microsoft.CodeAnalysis.NetAnalyzers", 4 | "-/Microsoft.NET.Test.Sdk", 5 | "-/Microsoft.SourceLink.GitHub", 6 | "-/Moq", 7 | "-/MSTest.TestAdapter", 8 | "-/MSTest.TestFramework", 9 | "-/System.Drawing.Common" 10 | ] 11 | -------------------------------------------------------------------------------- /tools/scripts/verification.scripts/LicenseHeader.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) Microsoft. All rights reserved. 2 | Licensed under the MIT license. See LICENSE file in the project root for full license information. --------------------------------------------------------------------------------