Skip to content

Redundant code #12

@tonyhallett

Description

@tonyhallett

protected async Task ExecuteAsync(OleMenuCmdEventArgs e)

        protected async Task ExecuteAsync(OleMenuCmdEventArgs e)
        {
            using var scope = this._serviceProvider.CreateScope();
            BaseDICommand instance = (BaseDICommand)scope.ServiceProvider.GetRequiredService(typeof(T));
            Task executeAsyncTask = (Task)_executeAsyncMethod.Invoke(instance, new object[] { e });
            await executeAsyncTask;
        }

The OleMenuCommand will Invoke the CommandWapper Execute method. This will invoke the BaseCommand Execute which will invoke the BaseCommand ExecuteAsync if not overridden.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions