net472_PropertyGridHelpers.Attributes_DynamicPathSourceAttribute - dparvin/PropertyGridHelpers GitHub Wiki

DynamicPathSourceAttribute class

Specifies that another property dynamically provides the path to the resources used to display this property in the PropertyGrid.

[AttributeUsage(AttributeTargets.Property)]
public class DynamicPathSourceAttribute : Attribute

Public Members

name description
DynamicPathSourceAttribute(…) Initializes a new instance of the DynamicPathSourceAttribute class.
static Get(…) Gets the specified context.
PathPropertyName { get; } Gets the name of the path property.

Remarks

Typically used for properties of an Enum type in a PropertyGrid, where the enum values are shown in a dropdown and mapped to resources that provide user-friendly display text. The referenced property contains the path to these resources, allowing the user of the property to specify which resource set to use for what is displayed.

Examples

[DynamicPathSource(nameof(ResourcePath))]
public MyEnum DisplayProperty { get; set; }

public string ResourcePath { get; set; } = "MyNamespace.Resources";

See Also

⚠️ **GitHub.com Fallback** ⚠️