Defines a naming convention for the CommandAttribute aspect, specifying how to derive the command property name
and CanExecute member from the target method name.
Namespace: Metalama.Patterns.Wpf.Configuration
Assembly: Metalama.Patterns.Wpf.dll
Syntax
[CompileTime]
public sealed record CommandNamingConvention : ICompileTimeSerializable, IEquatable<CommandNamingConvention>Remarks
Use AddNamingConvention(CommandNamingConvention, int?) to register custom naming conventions.
Patterns can use the {CommandName} placeholder which is replaced with the command name extracted from the target method.
Constructors
| Name | Description |
|---|---|
| CommandNamingConvention(string) | Initializes a new instance of the CommandNamingConvention class with the specified name. |
Properties
| Name | Description |
|---|---|
| CanExecutePatterns | Gets or sets a list of regular expression patterns that will be evaluated against method and/or property names to identify candidate can-execute members.
In this pattern, all occurrences of the substring |
| CommandNamePattern | Gets or sets a regular expression pattern that will be evaluated against the name of the target method of the CommandAttribute aspect.
The expression should yield a match group named |
| CommandPropertyName | Gets or sets the name of the command property to be introduced. The substring |
| ConsiderCanExecuteMethod | Gets or sets a value indicating whether the aspect should look for a |
| ConsiderCanExecuteProperty | Gets or sets a value indicating whether the aspect should look for a |
| IsCanExecuteRequired | Gets or sets a value indicating whether a matching valid unambiguous can-execute method or property must be found for a match to be considered successful. The default value is true when CanExecutePatterns is specified, otherwise false. |
| Name | Gets or sets the name of the naming convention. |
Methods
| Name | Description |
|---|---|
| Equals(CommandNamingConvention?) | |
| Equals(object?) | |
| GetHashCode() | |
| ToString() |
Operators
| Name | Description |
|---|---|
| operator ==(CommandNamingConvention?, CommandNamingConvention?) | |
| operator !=(CommandNamingConvention?, CommandNamingConvention?) |