Busker.Data.Commands.Extensions.Invoke C# (CSharp) Method

Invoke() public static method

Executes the command using the default invoker.
public static Invoke ( Command aCommand ) : void
aCommand Command
return void
            public static void Invoke(this Command aCommand)
            {
                System.Diagnostics.StackTrace stackTrace = new System.Diagnostics.StackTrace();
                System.Reflection.MethodBase m = stackTrace.GetFrame(1).GetMethod();
                String strMethodName = m.DeclaringType.Name + "." + m.Name;
    
                try
                {
                    Invoker invoker = new Invoker();
                    invoker.SetCommand(aCommand);
                    invoker.ExecuteCommand();
                }
                catch (Exception ex)
                {
                    Loggy.AddError("An error occured in Extensions.Invoke. + " + strMethodName ,ex);
                    throw ex;
                }
                
            }
    }
Extensions