From 589f4f22f0546422b4163224e9d628efe79fb452 Mon Sep 17 00:00:00 2001 From: Thomas Claudius Huber Date: Sun, 26 Nov 2023 10:05:07 +0100 Subject: [PATCH] Revert "Introduce IDelegateCommandFactory for custom command implementation" --- .../Model/ViewModelToGenerateTests.cs | 17 ----- .../CommandAttributeTests.cs | 20 +++--- .../CommandInvalidateAttribute.cs | 19 +++-- .../ViewModelAttributeTests.cs | 70 ------------------- ...iewModelGenerateInterfaceAttributeTests.cs | 7 +- .../CommandInitializeMethodGenerator.cs | 15 +--- .../Generators/CommandPropertyGenerator.cs | 2 +- .../Inspectors/ViewModelAttributeInspector.cs | 16 ----- ...odelGenerateInterfaceAttributeInspector.cs | 2 +- .../Model/ViewModelToGenerate.cs | 4 -- .../MvvmGen.SourceGenerators.csproj | 3 - .../ViewModelGenerator.cs | 7 +- src/MvvmGen/Attributes/ViewModelAttribute.cs | 9 +-- src/MvvmGen/Commands/DelegateCommand.cs | 2 +- .../Commands/DelegateCommandFactory.cs | 18 ----- src/MvvmGen/Commands/IDelegateCommand.cs | 15 ---- .../Commands/IDelegateCommandFactory.cs | 15 ---- 17 files changed, 28 insertions(+), 213 deletions(-) delete mode 100644 src/MvvmGen/Commands/DelegateCommandFactory.cs delete mode 100644 src/MvvmGen/Commands/IDelegateCommand.cs delete mode 100644 src/MvvmGen/Commands/IDelegateCommandFactory.cs diff --git a/src/MvvmGen.SourceGenerators.Tests/Model/ViewModelToGenerateTests.cs b/src/MvvmGen.SourceGenerators.Tests/Model/ViewModelToGenerateTests.cs index 41d5aef..fc3f0a8 100644 --- a/src/MvvmGen.SourceGenerators.Tests/Model/ViewModelToGenerateTests.cs +++ b/src/MvvmGen.SourceGenerators.Tests/Model/ViewModelToGenerateTests.cs @@ -118,22 +118,6 @@ public void ShouldNotBeEqualDifferentWrappedModelPropertyName2() Assert.NotEqual(_viewModelToGenerate1, _viewModelToGenerate2); } - [Fact] - public void ShouldNotBeEqualDifferentCommandFactoryType1() - { - _viewModelToGenerate2.CommandFactoryType = "typeof(MyNewCommandFactory)"; - - Assert.NotEqual(_viewModelToGenerate1, _viewModelToGenerate2); - } - - [Fact] - public void ShouldNotBeEqualDifferentCommandFactoryType2() - { - _viewModelToGenerate2.CommandFactoryType = null; - - Assert.NotEqual(_viewModelToGenerate1, _viewModelToGenerate2); - } - [Fact] public void ShouldNotBeEqualDifferentPropertiesToGenerate1() { @@ -358,7 +342,6 @@ private static void FillAllProperties(ViewModelToGenerate viewModelToGenerate) viewModelToGenerate.IsEventSubscriber = true; viewModelToGenerate.WrappedModelType = "Employee"; viewModelToGenerate.WrappedModelPropertyName = "EmployeeModel"; - viewModelToGenerate.CommandFactoryType = "typeof(MyCommandFactory)"; viewModelToGenerate.PropertiesToGenerate = new List { diff --git a/src/MvvmGen.SourceGenerators.Tests/ViewModelGeneratorTests/CommandAttributeTests.cs b/src/MvvmGen.SourceGenerators.Tests/ViewModelGeneratorTests/CommandAttributeTests.cs index 930a61a..4003a65 100644 --- a/src/MvvmGen.SourceGenerators.Tests/ViewModelGeneratorTests/CommandAttributeTests.cs +++ b/src/MvvmGen.SourceGenerators.Tests/ViewModelGeneratorTests/CommandAttributeTests.cs @@ -40,11 +40,10 @@ public EmployeeViewModel() private void InitializeCommands() {{ - var commandFactory = new DelegateCommandFactory(); - SaveAllCommand = commandFactory.CreateCommand(_ => SaveAll(), null); + SaveAllCommand = new DelegateCommand(_ => SaveAll()); }} - public IDelegateCommand SaveAllCommand {{ get; private set; }} + public DelegateCommand SaveAllCommand {{ get; private set; }} }} }} "); @@ -87,11 +86,10 @@ public EmployeeViewModel() private void InitializeCommands() {{ - var commandFactory = new DelegateCommandFactory(); - SaveAllCommand = commandFactory.CreateCommand(_ => SaveAll(), _ => CanSaveAll()); + SaveAllCommand = new DelegateCommand(_ => SaveAll(), _ => CanSaveAll()); }} - public IDelegateCommand SaveAllCommand {{ get; private set; }} + public DelegateCommand SaveAllCommand {{ get; private set; }} }} }} "); @@ -134,11 +132,10 @@ public EmployeeViewModel() private void InitializeCommands() {{ - var commandFactory = new DelegateCommandFactory(); - SuperCommand = commandFactory.CreateCommand(_ => SaveAll(), _ => CanSaveAll()); + SuperCommand = new DelegateCommand(_ => SaveAll(), _ => CanSaveAll()); }} - public IDelegateCommand SuperCommand {{ get; private set; }} + public DelegateCommand SuperCommand {{ get; private set; }} }} }} "); @@ -185,11 +182,10 @@ public EmployeeViewModel() private void InitializeCommands() {{ - var commandFactory = new DelegateCommandFactory(); - SaveCommand = commandFactory.CreateCommand({expectedConstructorArguments}); + SaveCommand = new DelegateCommand({expectedConstructorArguments}); }} - public IDelegateCommand SaveCommand {{ get; private set; }} + public DelegateCommand SaveCommand {{ get; private set; }} }} }} "); diff --git a/src/MvvmGen.SourceGenerators.Tests/ViewModelGeneratorTests/CommandInvalidateAttribute.cs b/src/MvvmGen.SourceGenerators.Tests/ViewModelGeneratorTests/CommandInvalidateAttribute.cs index 148ec52..f237fe6 100644 --- a/src/MvvmGen.SourceGenerators.Tests/ViewModelGeneratorTests/CommandInvalidateAttribute.cs +++ b/src/MvvmGen.SourceGenerators.Tests/ViewModelGeneratorTests/CommandInvalidateAttribute.cs @@ -95,11 +95,10 @@ public EmployeeViewModel() private void InitializeCommands() {{ - var commandFactory = new DelegateCommandFactory(); - SaveCommand = commandFactory.CreateCommand(_ => Save(), _ => CanSave()); + SaveCommand = new DelegateCommand(_ => Save(), _ => CanSave()); }} - public IDelegateCommand SaveCommand {{ get; private set; }} + public DelegateCommand SaveCommand {{ get; private set; }} public string FirstName {{ @@ -181,14 +180,13 @@ public EmployeeViewModel() private void InitializeCommands() {{ - var commandFactory = new DelegateCommandFactory(); - SaveCommand = commandFactory.CreateCommand(_ => Save(), _ => CanSave()); - DeleteCommand = commandFactory.CreateCommand(_ => Delete(), _ => CanDelete()); + SaveCommand = new DelegateCommand(_ => Save(), _ => CanSave()); + DeleteCommand = new DelegateCommand(_ => Delete(), _ => CanDelete()); }} - public IDelegateCommand SaveCommand {{ get; private set; }} + public DelegateCommand SaveCommand {{ get; private set; }} - public IDelegateCommand DeleteCommand {{ get; private set; }} + public DelegateCommand DeleteCommand {{ get; private set; }} public string FirstName {{ @@ -274,11 +272,10 @@ public EmployeeViewModel() private void InitializeCommands() {{ - var commandFactory = new DelegateCommandFactory(); - SaveCommand = commandFactory.CreateCommand(_ => Save(), _ => CanSave()); + SaveCommand = new DelegateCommand(_ => Save(), _ => CanSave()); }} - public IDelegateCommand SaveCommand {{ get; private set; }} + public DelegateCommand SaveCommand {{ get; private set; }} protected override void InvalidateCommands(string? propertyName) {{ diff --git a/src/MvvmGen.SourceGenerators.Tests/ViewModelGeneratorTests/ViewModelAttributeTests.cs b/src/MvvmGen.SourceGenerators.Tests/ViewModelGeneratorTests/ViewModelAttributeTests.cs index 1db5118..e74be2f 100644 --- a/src/MvvmGen.SourceGenerators.Tests/ViewModelGeneratorTests/ViewModelAttributeTests.cs +++ b/src/MvvmGen.SourceGenerators.Tests/ViewModelGeneratorTests/ViewModelAttributeTests.cs @@ -4,8 +4,6 @@ // Licensed under the MIT license => See LICENSE file in repository root // *********************************************************************** -using System; -using MvvmGen.Commands; using Xunit; namespace MvvmGen.SourceGenerators @@ -310,73 +308,5 @@ public EmployeeViewModel() }} "); } - - [Fact] - public void GenerateCommandPropertyWithCustomCommandType() - { - ShouldGenerateExpectedCode( - @"using MvvmGen; -using MvvmGen.Commands; - -namespace MyCode -{ - public class MyCommand : IDelegateCommand - { - private readonly Action _execute; - private readonly Func? _canExecute; - - public MyCommand(Action execute, Func? canExecute) - { - _execute = execute ?? throw new ArgumentNullException(nameof(execute)); - _canExecute = canExecute; - } - - public event EventHandler? CanExecuteChanged; - public void RaiseCanExecuteChanged() => CanExecuteChanged?.Invoke(this, EventArgs.Empty); - public void Execute(object? parameter) => _execute(parameter); - public bool CanExecute(object? parameter) => _canExecute == null || _canExecute(parameter); - } - - public class MyCommandFactory : IDelegateCommandFactory - { - public IDelegateCommand CreateCommand(Action execute, Func canExecute) - { - return new MyCommand(execute, canExecute); } - } - - [ViewModel(CommandFactoryType=typeof(MyCommandFactory))] - public partial class EmployeeViewModel - { - [Command]public void SaveAll() { } - } -}", - $@"{AutoGeneratedTopContent} - -namespace MyCode -{{ - partial class EmployeeViewModel : global::MvvmGen.ViewModels.ViewModelBase - {{ - public EmployeeViewModel() - {{ - this.InitializeCommands(); - this.OnInitialize(); - }} - - partial void OnInitialize(); - - private void InitializeCommands() - {{ - var commandFactory = new MyCode.MyCommandFactory(); - SaveAllCommand = commandFactory.CreateCommand(_ => SaveAll(), null); - }} - - public IDelegateCommand SaveAllCommand {{ get; private set; }} - }} -}} -"); - } - } } - - diff --git a/src/MvvmGen.SourceGenerators.Tests/ViewModelGeneratorTests/ViewModelGenerateInterfaceAttributeTests.cs b/src/MvvmGen.SourceGenerators.Tests/ViewModelGeneratorTests/ViewModelGenerateInterfaceAttributeTests.cs index 12fc442..549de98 100644 --- a/src/MvvmGen.SourceGenerators.Tests/ViewModelGeneratorTests/ViewModelGenerateInterfaceAttributeTests.cs +++ b/src/MvvmGen.SourceGenerators.Tests/ViewModelGeneratorTests/ViewModelGenerateInterfaceAttributeTests.cs @@ -175,16 +175,15 @@ public EmployeeViewModel() private void InitializeCommands() {{ - var commandFactory = new DelegateCommandFactory(); - SaveCommand = commandFactory.CreateCommand(_ => Save(), null); + SaveCommand = new DelegateCommand(_ => Save()); }} - public IDelegateCommand SaveCommand {{ get; private set; }} + public DelegateCommand SaveCommand {{ get; private set; }} }} public interface IEmployeeViewModel {{ - IDelegateCommand SaveCommand {{ get; }} + DelegateCommand SaveCommand {{ get; }} void Save(); }} }} diff --git a/src/MvvmGen.SourceGenerators/Generators/CommandInitializeMethodGenerator.cs b/src/MvvmGen.SourceGenerators/Generators/CommandInitializeMethodGenerator.cs index 8804aba..567c790 100644 --- a/src/MvvmGen.SourceGenerators/Generators/CommandInitializeMethodGenerator.cs +++ b/src/MvvmGen.SourceGenerators/Generators/CommandInitializeMethodGenerator.cs @@ -12,10 +12,7 @@ namespace MvvmGen.Generators { internal static class CommandInitializeMethodGenerator { - internal static void GenerateCommandInitializeMethod( - this ViewModelBuilder vmBuilder, - IEnumerable? commandsToGenerate, - string? commandFactoryType) + internal static void GenerateCommandInitializeMethod(this ViewModelBuilder vmBuilder, IEnumerable? commandsToGenerate) { if (commandsToGenerate is not null && commandsToGenerate.Any()) { @@ -23,21 +20,13 @@ internal static void GenerateCommandInitializeMethod( vmBuilder.AppendLine("private void InitializeCommands()"); vmBuilder.AppendLine("{"); vmBuilder.IncreaseIndent(); - - commandFactoryType ??= "DelegateCommandFactory"; - vmBuilder.AppendLine($"var commandFactory = new {commandFactoryType}();"); - foreach (var commandToGenerate in commandsToGenerate) { - vmBuilder.Append($"{commandToGenerate.PropertyName} = commandFactory.CreateCommand({GetMethodCall(commandToGenerate.ExecuteMethod)}"); + vmBuilder.Append($"{commandToGenerate.PropertyName} = new DelegateCommand({GetMethodCall(commandToGenerate.ExecuteMethod)}"); if (commandToGenerate.CanExecuteMethod is not null) { vmBuilder.Append($", {GetMethodCall(commandToGenerate.CanExecuteMethod)}"); } - else - { - vmBuilder.Append(", null"); - } vmBuilder.AppendLine(");"); } diff --git a/src/MvvmGen.SourceGenerators/Generators/CommandPropertyGenerator.cs b/src/MvvmGen.SourceGenerators/Generators/CommandPropertyGenerator.cs index 92bb669..511ee8c 100644 --- a/src/MvvmGen.SourceGenerators/Generators/CommandPropertyGenerator.cs +++ b/src/MvvmGen.SourceGenerators/Generators/CommandPropertyGenerator.cs @@ -18,7 +18,7 @@ internal static void GenerateCommandProperties(this ViewModelBuilder vmBuilder, foreach (var commandToGenerate in commandsToGenerate) { vmBuilder.AppendLineBeforeMember(); - vmBuilder.AppendLine($"public IDelegateCommand {commandToGenerate.PropertyName} {{ get; private set; }}"); + vmBuilder.AppendLine($"public DelegateCommand {commandToGenerate.PropertyName} {{ get; private set; }}"); } } } diff --git a/src/MvvmGen.SourceGenerators/Inspectors/ViewModelAttributeInspector.cs b/src/MvvmGen.SourceGenerators/Inspectors/ViewModelAttributeInspector.cs index ef9a87f..5a8450c 100644 --- a/src/MvvmGen.SourceGenerators/Inspectors/ViewModelAttributeInspector.cs +++ b/src/MvvmGen.SourceGenerators/Inspectors/ViewModelAttributeInspector.cs @@ -4,28 +4,12 @@ // Licensed under the MIT license => See LICENSE file in repository root // *********************************************************************** -using System; using Microsoft.CodeAnalysis; namespace MvvmGen.Inspectors { internal static class ViewModelAttributeInspector { - internal static string? InspectCommandFactoryType(AttributeData viewModelAttributeData) - { - string? commandFactoryType = null; - - foreach (var arg in viewModelAttributeData.NamedArguments) - { - if (arg.Key == "CommandFactoryType") - { - commandFactoryType = arg.Value.Value?.ToString(); - } - } - - return commandFactoryType; - } - internal static bool InspectGenerateConstructor(AttributeData viewModelAttributeData) { var generateConstructor = true; diff --git a/src/MvvmGen.SourceGenerators/Inspectors/ViewModelGenerateInterfaceAttributeInspector.cs b/src/MvvmGen.SourceGenerators/Inspectors/ViewModelGenerateInterfaceAttributeInspector.cs index d411f5a..878e663 100644 --- a/src/MvvmGen.SourceGenerators/Inspectors/ViewModelGenerateInterfaceAttributeInspector.cs +++ b/src/MvvmGen.SourceGenerators/Inspectors/ViewModelGenerateInterfaceAttributeInspector.cs @@ -82,7 +82,7 @@ internal static class ViewModelGenerateInterfaceAttributeInspector foreach (var commandToGenerate in commandsToGenerate) { properties ??= new(); - properties.Add(new InterfaceProperty(commandToGenerate.PropertyName, "IDelegateCommand", true)); + properties.Add(new InterfaceProperty(commandToGenerate.PropertyName, "DelegateCommand", true)); } } diff --git a/src/MvvmGen.SourceGenerators/Model/ViewModelToGenerate.cs b/src/MvvmGen.SourceGenerators/Model/ViewModelToGenerate.cs index ac87b80..25eba33 100644 --- a/src/MvvmGen.SourceGenerators/Model/ViewModelToGenerate.cs +++ b/src/MvvmGen.SourceGenerators/Model/ViewModelToGenerate.cs @@ -35,8 +35,6 @@ public ViewModelToGenerate(string className, string namespaceName) public bool GenerateConstructor { get; set; } - public string? CommandFactoryType { get; set; } - public bool InheritFromViewModelBase { get; set; } public IEnumerable? CommandsToGenerate { get; set; } @@ -66,7 +64,6 @@ public bool Equals(ViewModelToGenerate? other) WrappedModelPropertyName == other.WrappedModelPropertyName && IsEventSubscriber == other.IsEventSubscriber && GenerateConstructor == other.GenerateConstructor && - CommandFactoryType == other.CommandFactoryType && InheritFromViewModelBase == other.InheritFromViewModelBase && EqualityComparer.Default.Equals(ViewModelFactoryToGenerate, other.ViewModelFactoryToGenerate) && EqualityComparer.Default.Equals(ViewModelInterfaceToGenerate, other.ViewModelInterfaceToGenerate) && @@ -84,7 +81,6 @@ public override int GetHashCode() hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(NamespaceName); hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(WrappedModelType); hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(WrappedModelPropertyName); - hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(CommandFactoryType); hashCode = hashCode * -1521134295 + IsEventSubscriber.GetHashCode(); hashCode = hashCode * -1521134295 + GenerateConstructor.GetHashCode(); hashCode = hashCode * -1521134295 + InheritFromViewModelBase.GetHashCode(); diff --git a/src/MvvmGen.SourceGenerators/MvvmGen.SourceGenerators.csproj b/src/MvvmGen.SourceGenerators/MvvmGen.SourceGenerators.csproj index c471a4a..d2493b1 100644 --- a/src/MvvmGen.SourceGenerators/MvvmGen.SourceGenerators.csproj +++ b/src/MvvmGen.SourceGenerators/MvvmGen.SourceGenerators.csproj @@ -24,9 +24,6 @@ - - - diff --git a/src/MvvmGen.SourceGenerators/ViewModelGenerator.cs b/src/MvvmGen.SourceGenerators/ViewModelGenerator.cs index 2dfb5b7..f15924d 100644 --- a/src/MvvmGen.SourceGenerators/ViewModelGenerator.cs +++ b/src/MvvmGen.SourceGenerators/ViewModelGenerator.cs @@ -82,7 +82,6 @@ public void Initialize(IncrementalGeneratorInitializationContext context) ClassAccessModifier = accessModifier, InjectionsToGenerate = ViewModelInjectAttributeInspector.Inspect(viewModelClassSymbol), GenerateConstructor = ViewModelAttributeInspector.InspectGenerateConstructor(viewModelAttributeData), - CommandFactoryType = ViewModelAttributeInspector.InspectCommandFactoryType(viewModelAttributeData), ViewModelFactoryToGenerate = ViewModelGenerateFactoryAttributeInspector.Inspect(viewModelClassSymbol), InheritFromViewModelBase = ViewModelBaseClassInspector.Inspect(viewModelClassSymbol, viewModelBaseClassSymbol), CommandsToGenerate = commandsToGenerate, @@ -91,7 +90,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context) }; viewModelToGenerate.WrappedModelPropertyName = ViewModelAttributeInspector.InspectModelPropertyName(viewModelAttributeData); - viewModelToGenerate.WrappedModelType = ModelMemberInspector.Inspect(viewModelAttributeData, viewModelToGenerate.PropertiesToGenerate, viewModelToGenerate.WrappedModelPropertyName); + viewModelToGenerate.WrappedModelType = ModelMemberInspector.Inspect(viewModelAttributeData, viewModelToGenerate.PropertiesToGenerate,viewModelToGenerate.WrappedModelPropertyName); viewModelToGenerate.ViewModelInterfaceToGenerate = ViewModelGenerateInterfaceAttributeInspector.Inspect(viewModelClassSymbol, viewModelToGenerate.PropertiesToGenerate, viewModelToGenerate.CommandsToGenerate); @@ -140,13 +139,13 @@ private static void Execute(SourceProductionContext context, ViewModelToGenerate vmBuilder.GenerateConstructor(viewModelToGenerate); - vmBuilder.GenerateCommandInitializeMethod(viewModelToGenerate.CommandsToGenerate, viewModelToGenerate.CommandFactoryType); + vmBuilder.GenerateCommandInitializeMethod(viewModelToGenerate.CommandsToGenerate); vmBuilder.GenerateCommandProperties(viewModelToGenerate.CommandsToGenerate); vmBuilder.GenerateProperties(viewModelToGenerate.PropertiesToGenerate); - vmBuilder.GenerateModelProperty(viewModelToGenerate.WrappedModelType, viewModelToGenerate.WrappedModelPropertyName); + vmBuilder.GenerateModelProperty(viewModelToGenerate.WrappedModelType,viewModelToGenerate.WrappedModelPropertyName); vmBuilder.GenerateInjectionProperties(viewModelToGenerate.InjectionsToGenerate); diff --git a/src/MvvmGen/Attributes/ViewModelAttribute.cs b/src/MvvmGen/Attributes/ViewModelAttribute.cs index 55a580e..ca8bfb8 100644 --- a/src/MvvmGen/Attributes/ViewModelAttribute.cs +++ b/src/MvvmGen/Attributes/ViewModelAttribute.cs @@ -36,17 +36,10 @@ public ViewModelAttribute(Type modelType) public Type? ModelType { get; set; } /// - /// Gets or sets the name of generated property that contains the wrapped ModelType. If not set, the property has the name Model. + /// Gets or sets the name of generated property that contains the wrapped ModelType. If not set, the property has the name Model /// public string? ModelPropertyName { get; set; } - /// - /// Gets or sets the command factory type that is used in the ViewModel. - /// If not set, MvvmGen's will be used. - /// Note that the specified command factory type must implement the interface. - /// - public Type? CommandFactoryType { get; set; } - /// /// Gets or sets if a constructor is generated. Default value is true. /// diff --git a/src/MvvmGen/Commands/DelegateCommand.cs b/src/MvvmGen/Commands/DelegateCommand.cs index 44d4be7..f9667ba 100644 --- a/src/MvvmGen/Commands/DelegateCommand.cs +++ b/src/MvvmGen/Commands/DelegateCommand.cs @@ -14,7 +14,7 @@ namespace MvvmGen.Commands /// /// An implementation that works with delegates for the execute and can-execute logic /// - public class DelegateCommand : IDelegateCommand + public class DelegateCommand : ICommand { private readonly Action _execute; private readonly Func? _canExecute; diff --git a/src/MvvmGen/Commands/DelegateCommandFactory.cs b/src/MvvmGen/Commands/DelegateCommandFactory.cs deleted file mode 100644 index 33d18de..0000000 --- a/src/MvvmGen/Commands/DelegateCommandFactory.cs +++ /dev/null @@ -1,18 +0,0 @@ -// *********************************************************************** -// ⚡ MvvmGen => https://github.com/thomasclaudiushuber/mvvmgen -// Copyright © by Thomas Claudius Huber -// Licensed under the MIT license => See LICENSE file in repository root -// *********************************************************************** - -using System; - -namespace MvvmGen.Commands -{ - public class DelegateCommandFactory : IDelegateCommandFactory - { - public IDelegateCommand CreateCommand(Action execute, Func? canExecute) - { - return new DelegateCommand(execute, canExecute); - } - } -} diff --git a/src/MvvmGen/Commands/IDelegateCommand.cs b/src/MvvmGen/Commands/IDelegateCommand.cs deleted file mode 100644 index 5546dc2..0000000 --- a/src/MvvmGen/Commands/IDelegateCommand.cs +++ /dev/null @@ -1,15 +0,0 @@ -// *********************************************************************** -// ⚡ MvvmGen => https://github.com/thomasclaudiushuber/mvvmgen -// Copyright © by Thomas Claudius Huber -// Licensed under the MIT license => See LICENSE file in repository root -// *********************************************************************** - -using System.Windows.Input; - -namespace MvvmGen.Commands -{ - public interface IDelegateCommand: ICommand - { - void RaiseCanExecuteChanged(); - } -} diff --git a/src/MvvmGen/Commands/IDelegateCommandFactory.cs b/src/MvvmGen/Commands/IDelegateCommandFactory.cs deleted file mode 100644 index 2d8ea7f..0000000 --- a/src/MvvmGen/Commands/IDelegateCommandFactory.cs +++ /dev/null @@ -1,15 +0,0 @@ -// *********************************************************************** -// ⚡ MvvmGen => https://github.com/thomasclaudiushuber/mvvmgen -// Copyright © by Thomas Claudius Huber -// Licensed under the MIT license => See LICENSE file in repository root -// *********************************************************************** - -using System; - -namespace MvvmGen.Commands -{ - public interface IDelegateCommandFactory - { - IDelegateCommand CreateCommand(Action execute, Func? canExecute); - } -}