Browse Source

Removed factory command

CPKreuz 3 years ago
parent
commit
fb28a48637

+ 0 - 14
PixiEditor/Models/Commands/Attributes/Evaluators/FactoryAttribute.cs

@@ -1,14 +0,0 @@
-namespace PixiEditor.Models.Commands.Attributes;
-
-public partial class Evaluator
-{
-    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = true)]
-    public class FactoryAttribute : EvaluatorAttribute
-    {
-        public object Parameter { get; set; }
-
-        public FactoryAttribute(string name)
-            : base(name)
-        { }
-    }
-}

+ 0 - 7
PixiEditor/Models/Commands/CommandController.cs

@@ -21,8 +21,6 @@ namespace PixiEditor.Models.Commands
 
         public List<CommandGroup> CommandGroups { get; }
 
-        public Dictionary<string, FactoryEvaluator> FactoryEvaluators { get; }
-
         public Dictionary<string, CanExecuteEvaluator> CanExecuteEvaluators { get; }
 
         public Dictionary<string, IconEvaluator> IconEvaluators { get; }
@@ -40,7 +38,6 @@ namespace PixiEditor.Models.Commands
 
             Commands = new();
             CommandGroups = new();
-            FactoryEvaluators = new();
             CanExecuteEvaluators = new();
             IconEvaluators = new();
         }
@@ -91,10 +88,6 @@ namespace PixiEditor.Models.Commands
                                     Evaluate = y => x.Invoke(y) && required.Invoke(this).All(z => z.EvaluateEvaluator(null, y))
                                 });
                         }
-                        else if (attribute is Evaluator.FactoryAttribute factory)
-                        {
-                            AddEvaluator<Evaluator.FactoryAttribute, FactoryEvaluator, object>(method, instanceType, factory, FactoryEvaluators);
-                        }
                         else if (attribute is Evaluator.IconAttribute icon)
                         {
                             AddEvaluator<Evaluator.IconAttribute, IconEvaluator, ImageSource>(method, instanceType, icon, IconEvaluators);

+ 0 - 6
PixiEditor/Models/Commands/Evaluators/FactoryEvaluator.cs

@@ -1,6 +0,0 @@
-namespace PixiEditor.Models.Commands.Evaluators
-{
-    public class FactoryEvaluator : Evaluator<object>
-    {
-    }
-}

+ 0 - 5
PixiEditor/Models/Services/CommandProvider.cs

@@ -22,11 +22,6 @@ namespace PixiEditor.Models.Services
         public bool CanExecute(string name, Command command, object argument) =>
             _controller.CanExecuteEvaluators[name].EvaluateEvaluator(command, argument);
 
-        public FactoryEvaluator GetFactoryEvaluator(string name) => _controller.FactoryEvaluators[name];
-
-        public object GetFromFactory(string name, Command command, object argument) =>
-            _controller.FactoryEvaluators[name].EvaluateEvaluator(command, argument);
-
         public IconEvaluator GetIconEvaluator(string name) => _controller.IconEvaluators[name];
 
         public ImageSource GetIcon(string name, Command command, object argument) =>