-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add '[GeneratedAppServiceHost]' attribute type
- Loading branch information
1 parent
f68b369
commit 70c49d1
Showing
2 changed files
with
76 additions
and
4 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
28 changes: 28 additions & 0 deletions
28
components/AppServices/src/GeneratedAppServiceHostAttribute.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,28 @@ | ||
// 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. | ||
|
||
using System; | ||
|
||
namespace CommunityToolkit.AppServices; | ||
|
||
/// <summary> | ||
/// An attribute that can be used to request the generator to emit a host implementation of a given app service. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false, Inherited = false)] | ||
public sealed class GeneratedAppServiceHostAttribute : Attribute | ||
{ | ||
/// <summary> | ||
/// Creates a new <see cref="GeneratedAppServiceHostAttribute"/> instance with the specified parameters. | ||
/// </summary> | ||
/// <param name="appServiceType">The type of the app service.</param> | ||
public GeneratedAppServiceHostAttribute(Type appServiceType) | ||
{ | ||
AppServiceType = appServiceType; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the type of the app service. | ||
/// </summary> | ||
public Type AppServiceType { get; } | ||
} |