Перейти к основному содержимому

Class ICustomStyleExtensions

Namespace: Aspid.FastTools.UIElements
Assembly: Aspid.FastTools.dll

Extension methods for ICustomStyle that bridge USS string-typed custom properties to strongly-typed C# values.

public static class ICustomStyleExtensions

Inheritance​

object ← ICustomStyleExtensions

Methods​

TryGetByEnum<T>(ICustomStyle, CustomStyleProperty<string>, out T)​

Resolves a CustomStyleProperty<T> whose USS value is a string and parses it as the enum T. Parsing is case-insensitive.

public static bool TryGetByEnum<T>(this ICustomStyle style, CustomStyleProperty<string> property, out T value) where T : struct, Enum

Parameters​

style ICustomStyle

The resolved custom-style container, typically obtained from customStyle.

property CustomStyleProperty<string>

The custom style property whose string value should be parsed.

value T

When this method returns true, the parsed enum value; otherwise default.

Returns​

bool

true if the property was resolved and successfully parsed as T; otherwise, false.

Type Parameters​

T

The enum type to parse the USS value as.