You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CommunityToolkit.Mvvm.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs
+20-4Lines changed: 20 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -191,17 +191,17 @@ internal static class DiagnosticDescriptors
191
191
/// <summary>
192
192
/// Gets a <see cref="DiagnosticDescriptor"/> indicating when <c>RelayCommandAttribute.AllowConcurrentExecutions</c> is being set for a non-asynchronous method.
193
193
/// <para>
194
-
/// Format: <c>"The method {0}.{1} cannot be annotated with the [RelayCommand] attribute specifying a concurrency control setting, as it maps to a non-asynchronous command type"</c>.
194
+
/// Format: <c>"The method {0}.{1} cannot be annotated with the [RelayCommand] attribute specifying a concurrency control option, as it maps to a non-asynchronous command type"</c>.
title:"Invalid concurrency control setting usage",
200
-
messageFormat:"The method {0}.{1} cannot be annotated with the [RelayCommand] attribute specifying a concurrency control setting, as it maps to a non-asynchronous command type",
199
+
title:"Invalid concurrency control option usage",
200
+
messageFormat:"The method {0}.{1} cannot be annotated with the [RelayCommand] attribute specifying a concurrency control option, as it maps to a non-asynchronous command type",
201
201
category:typeof(RelayCommandGenerator).FullName,
202
202
defaultSeverity:DiagnosticSeverity.Error,
203
203
isEnabledByDefault:true,
204
-
description:"Cannot apply the [RelayCommand] attribute specifying a concurrency control setting to methods mapping to non-asynchronous command types.",
204
+
description:"Cannot apply the [RelayCommand] attribute specifying a concurrency control option to methods mapping to non-asynchronous command types.",
205
205
helpLinkUri:"https://aka.ms/mvvmtoolkit");
206
206
207
207
/// <summary>
@@ -491,4 +491,20 @@ internal static class DiagnosticDescriptors
491
491
isEnabledByDefault:true,
492
492
description:"Annotating a field with [NotifyDataErrorInfo] is not necessary if the containing type has or inherits [NotifyDataErrorInfo] at the class-level.",
493
493
helpLinkUri:"https://aka.ms/mvvmtoolkit");
494
+
495
+
/// <summary>
496
+
/// Gets a <see cref="DiagnosticDescriptor"/> indicating when <c>RelayCommandAttribute.FlowExceptionsToTaskScheduler</c> is being set for a non-asynchronous method.
497
+
/// <para>
498
+
/// Format: <c>"The method {0}.{1} cannot be annotated with the [RelayCommand] attribute specifying an exception flow option, as it maps to a non-asynchronous command type"</c>.
messageFormat:"The method {0}.{1} cannot be annotated with the [RelayCommand] attribute specifying a task scheduler exception flow option, as it maps to a non-asynchronous command type",
505
+
category:typeof(RelayCommandGenerator).FullName,
506
+
defaultSeverity:DiagnosticSeverity.Error,
507
+
isEnabledByDefault:true,
508
+
description:"Cannot apply the [RelayCommand] attribute specifying a task scheduler exception flow option to methods mapping to non-asynchronous command types.",
Copy file name to clipboardExpand all lines: CommunityToolkit.Mvvm/Input/Attributes/RelayCommandAttribute.cs
+15Lines changed: 15 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -75,15 +75,30 @@ public sealed class RelayCommandAttribute : Attribute
75
75
76
76
/// <summary>
77
77
/// Gets or sets a value indicating whether or not to allow concurrent executions for an asynchronous command.
78
+
/// <para>
78
79
/// When set for an attribute used on a method that would result in an <see cref="AsyncRelayCommand"/> or an
79
80
/// <see cref="AsyncRelayCommand{T}"/> property to be generated, this will modify the behavior of these commands
80
81
/// when an execution is invoked while a previous one is still running. It is the same as creating an instance of
81
82
/// these command types with a constructor such as <see cref="AsyncRelayCommand(Func{System.Threading.Tasks.Task}, AsyncRelayCommandOptions)"/>
82
83
/// and using the <see cref="AsyncRelayCommandOptions.AllowConcurrentExecutions"/> value.
84
+
/// </para>
83
85
/// </summary>
84
86
/// <remarks>Using this property is not valid if the target command doesn't map to an asynchronous command.</remarks>
85
87
publicboolAllowConcurrentExecutions{get;init;}
86
88
89
+
/// <summary>
90
+
/// Gets or sets a value indicating whether or not to exceptions should be propagated to <see cref="System.Threading.Tasks.TaskScheduler.UnobservedTaskException"/>.
91
+
/// <para>
92
+
/// When set for an attribute used on a method that would result in an <see cref="AsyncRelayCommand"/> or an
93
+
/// <see cref="AsyncRelayCommand{T}"/> property to be generated, this will modify the behavior of these commands
94
+
/// in case an exception is thrown by the underlying operation. It is the same as creating an instance of
95
+
/// these command types with a constructor such as <see cref="AsyncRelayCommand(Func{System.Threading.Tasks.Task}, AsyncRelayCommandOptions)"/>
96
+
/// and using the <see cref="AsyncRelayCommandOptions.FlowExceptionsToTaskScheduler"/> value.
97
+
/// </para>
98
+
/// </summary>
99
+
/// <remarks>Using this property is not valid if the target command doesn't map to an asynchronous command.</remarks>
0 commit comments