GuOrg / Gu.Wpf.UiAutomation

MIT License
96 stars 17 forks source link

Missing wrappers #50

Closed JohanLarsson closed 6 years ago

JohanLarsson commented 6 years ago
[Test]
public void DumpMissingTypes()
{
    var wrappers = typeof(UiElement).Assembly
                                    .GetTypes()
                                    .Where(x => typeof(UiElement).IsAssignableFrom(x))
                                    .Select(x => x.Name.TrimEnd("`1"))
                                    .ToArray();
    var missing = typeof(System.Windows.Controls.Control)
                    .Assembly.GetTypes()
                    .Where(x => typeof(System.Windows.Controls.Control).IsAssignableFrom(x))
                    .Select(x => x.Name)
                    .Where(x => !x.EndsWith("Base") && !x.Contains("Item"))
                    .Except(wrappers)
                    .OrderBy(x => x)
                    .ToArray();

    foreach (var type in missing)
    {
        Console.WriteLine(type);
    }
}

Prints:

CalendarButton
DataGridCellsPresenter
DataGridColumnDropSeparator
DataGridColumnFloatingHeader
DatePickerTextBox
DocumentViewer
EditorContextMenu
FlowDocumentPageViewer
FlowDocumentReader
FlowDocumentScrollViewer
Frame
NavigationWindow
ReaderPageViewer
ReaderScrollViewer
ReaderTwoPageViewer
ResizeGrip
RootBrowserWindow
StickyNoteControl
TextBlockComboBox
ViewerContextMenu