Propagate the 'InvalidationType' parameter
このコミットが含まれているのは:
1 親
44959ce417
コミット
3f4d59e981
5ファイル変更
+38
-3
検索条件に一致するファイルはありません
+18
-1
@@ -41,6 +41,23 @@ partial class CanvasEffectPropertyGenerator
|
||||
return node.Parent?.IsTypeDeclarationWithOrPotentiallyWithBaseTypes<ClassDeclarationSyntax>() == true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the invalidation type to use for the generated effect property.
|
||||
/// </summary>
|
||||
/// <param name="attributeData">The <see cref="AttributeData"/> instance for the processed attribute.</param>
|
||||
/// <returns>The resulting <see cref="CanvasEffectInvalidationType"/> to use for the generated property.</returns>
|
||||
public static CanvasEffectInvalidationType GetCanvasEffectInvalidationType(AttributeData attributeData)
|
||||
{
|
||||
if (attributeData.ConstructorArguments is [{ Kind: TypedConstantKind.Enum, Value: byte enumValue }])
|
||||
{
|
||||
return (CanvasEffectInvalidationType)enumValue;
|
||||
}
|
||||
|
||||
// No constructor parameter, or an invalid one. In this case we either just use the default
|
||||
// invalidation mode, or let the analyzer emit a diagnostic to let the user know.
|
||||
return CanvasEffectInvalidationType.Update;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether the generated code has to directly reference the old property value.
|
||||
/// </summary>
|
||||
@@ -101,7 +118,7 @@ partial class CanvasEffectPropertyGenerator
|
||||
On{{propertyInfo.PropertyName}}Changed(value);
|
||||
On{{propertyInfo.PropertyName}}Changed(oldValue, value);
|
||||
|
||||
InvalidateEffectGraph(default);
|
||||
InvalidateEffectGraph(global::ComputeSharp.D2D1.WinUI.CanvasEffectInvalidationType.{{propertyInfo.InvalidationType}});
|
||||
}
|
||||
}
|
||||
""", isMultiline: true);
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする