File: System\Windows\Forms\Design\InheritedPropertyDescriptorTestExtensions.cs
Web Access
Project: src\src\System.Windows.Forms.Design\tests\UnitTests\System.Windows.Forms.Design.Tests.csproj (System.Windows.Forms.Design.Tests)
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
 
using System.ComponentModel.Design;
using System.ComponentModel;
 
namespace System.Windows.Forms.Design.Tests;
 
internal static class InheritedPropertyDescriptorTestExtensions
{
    public static InheritedPropertyDescriptor GetInheritedPropertyDescriptor(this Control control, string property)
    {
        PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(control);
        PropertyDescriptor propertyDescriptor = properties.Find(property, false);
        InheritedPropertyDescriptor inheritedPropertyDescriptor = new(propertyDescriptor, control);
        return inheritedPropertyDescriptor;
    }
}