Skip to content

Question: How can I write a generic injection that accepts any number of parameters #10

@asdf23

Description

@asdf23

I am trying to write an injector to accept any number of parameters. By "injector" I mean the method which would be injected into another existing method. That method would look like

public static class MethodDefinitionInjector
{
    public static DumpParameter(params object[] args)
    {
        foreach(object o in args) ...
    }
}

I can only get it to work when the parameters perfectly match. I'm injecting in the following manner:

methodDefinitionToInject.InjectWith(methodDefinitionInjector, 0, null, InjectFlags.PassParametersVal, InjectDirection.Before, null, null);

Is this possible? How should I rewrite the injection?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions