Browse Source
* feature: Support Inlines, sync XamlX, use Avalonia 11 * chore: Bump version * chore: Update docspull/10407/head 1.6.1
committed by
GitHub
38 changed files with 147 additions and 136 deletions
@ -1 +1 @@ |
|||
Subproject commit 5420df861ce6f2be5ead9efa078fe7242ce88f18 |
|||
Subproject commit 5e498f8bcca403a34aff5efc825cbb4e12b7fa8e |
|||
@ -1,33 +1,25 @@ |
|||
using System.Linq; |
|||
using XamlX.TypeSystem; |
|||
|
|||
namespace Avalonia.NameGenerator.Generator; |
|||
|
|||
internal static class ResolverExtensions |
|||
{ |
|||
public static bool IsAvaloniaControl(this IXamlType clrType) |
|||
{ |
|||
return clrType.HasControlBaseType() || clrType.HasIControlInterface(); |
|||
} |
|||
|
|||
private static bool HasControlBaseType(this IXamlType clrType) |
|||
{ |
|||
// Check for the base type since IControl interface is removed.
|
|||
// https://github.com/AvaloniaUI/Avalonia/pull/9553
|
|||
if (clrType.FullName == "Avalonia.Controls.Control") |
|||
return true; |
|||
|
|||
if (clrType.BaseType != null) |
|||
return IsAvaloniaControl(clrType.BaseType); |
|||
|
|||
return false; |
|||
} |
|||
|
|||
private static bool HasIControlInterface(this IXamlType clrType) |
|||
{ |
|||
return clrType |
|||
.Interfaces |
|||
.Any(abstraction => abstraction.IsInterface && |
|||
abstraction.FullName == "Avalonia.Controls.IControl"); |
|||
} |
|||
using System.Linq; |
|||
using XamlX.TypeSystem; |
|||
|
|||
namespace Avalonia.NameGenerator.Generator; |
|||
|
|||
internal static class ResolverExtensions |
|||
{ |
|||
public static bool IsAvaloniaStyledElement(this IXamlType clrType) => |
|||
clrType.HasStyledElementBaseType() || |
|||
clrType.HasIStyledElementInterface(); |
|||
|
|||
private static bool HasStyledElementBaseType(this IXamlType clrType) |
|||
{ |
|||
// Check for the base type since IStyledElement interface is removed.
|
|||
// https://github.com/AvaloniaUI/Avalonia/pull/9553
|
|||
if (clrType.FullName == "Avalonia.StyledElement") |
|||
return true; |
|||
return clrType.BaseType != null && IsAvaloniaStyledElement(clrType.BaseType); |
|||
} |
|||
|
|||
private static bool HasIStyledElementInterface(this IXamlType clrType) => |
|||
clrType.Interfaces.Any(abstraction => |
|||
abstraction.IsInterface && |
|||
abstraction.FullName == "Avalonia.IStyledElement"); |
|||
} |
|||
Loading…
Reference in new issue