-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb7c442
commit b0b3f1a
Showing
11 changed files
with
319 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
CommunityToolkit.Tooling.SampleGen/Attributes/ToolkitSampleEnumOptionAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#region Copyright | ||
|
||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
#endregion | ||
|
||
namespace CommunityToolkit.Tooling.SampleGen.Attributes; | ||
|
||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] | ||
public sealed class ToolkitSampleEnumOptionAttribute<TEnum> : ToolkitSampleOptionBaseAttribute where TEnum : struct, Enum | ||
{ | ||
/// <summary> | ||
/// Creates a new instance of <see cref="ToolkitSampleEnumOptionAttribute{TEnum}"/>. | ||
/// </summary> | ||
/// <param name="bindingName">The name of the generated property, which you can bind to in XAML.</param> | ||
public ToolkitSampleEnumOptionAttribute(string bindingName) | ||
: base(bindingName, null) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// The source generator-friendly type name used for casting. | ||
/// </summary> | ||
internal override string TypeName { get; } = "int"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.