public override void Execute()
    {
        var initializeMethodFinder = new HandleMethodFinder
        {
            ModuleDefinition = ModuleDefinition,
            AssemblyResolver = AssemblyResolver
        };

        initializeMethodFinder.Execute();

        var stateMachineFinder = new StateMachineTypesFinder
        {
            ModuleDefinition = ModuleDefinition,
        };

        stateMachineFinder.Execute();

        var methodProcessor = new MethodProcessor
        {
            HandleMethodFinder = initializeMethodFinder,
        };

        foreach (var stateMachine in stateMachineFinder.AllTypes)
        {
            try
            {
                var moveNext = stateMachine.Methods.First(x => x.Name == "MoveNext");
                methodProcessor.Process(moveNext);
            }
            catch (Exception exception)
            {
                throw new Exception($"Failed to process '{stateMachine.FullName}'.", exception);
            }
        }
    }
    public void Execute()
    {
        var initializeMethodFinder = new HandleMethodFinder
        {
            ModuleDefinition = ModuleDefinition,
            AssemblyResolver = AssemblyResolver
        };

        initializeMethodFinder.Execute();

        var stateMachineFinder = new StateMachineTypesFinder
        {
            ModuleDefinition = ModuleDefinition,
        };

        stateMachineFinder.Execute();

        var methodProcessor = new MethodProcessor
        {
            HandleMethodFinder = initializeMethodFinder,
        };

        foreach (var stateMachine in stateMachineFinder.AllTypes)
        {
            var moveNext = stateMachine.Methods.First(x => x.Name == "MoveNext");
            methodProcessor.Process(moveNext);
        }
    }
    public void Execute()
    {
        var initializeMethodFinder = new HandleMethodFinder
            {
                ModuleDefinition = ModuleDefinition,
            };
        initializeMethodFinder.Execute();

        var stateMachineFinder = new StateMachineTypesFinder
            {
                ModuleDefinition = ModuleDefinition,
            };
        stateMachineFinder.Execute();

        var methodProcessor = new MethodProcessor
            {
                HandleMethodFinder = initializeMethodFinder,
            };

        foreach (var stateMachine in stateMachineFinder.AllTypes)
        {
            var moveNext = stateMachine.Methods.First(x => x.Name == "MoveNext");
            methodProcessor.Process(moveNext);
        }

    }
Esempio n. 4
0
    public void Execute()
    {
        var initializeMethodFinder = new HandleMethodFinder
            {
                ModuleDefinition = ModuleDefinition,
                AssemblyResolver = AssemblyResolver
            };
        initializeMethodFinder.Execute();

        var stateMachineFinder = new StateMachineTypesFinder
            {
                ModuleDefinition = ModuleDefinition,
            };
        stateMachineFinder.Execute();

        var methodProcessor = new MethodProcessor
            {
                HandleMethodFinder = initializeMethodFinder,
            };

        foreach (var stateMachine in stateMachineFinder.AllTypes)
        {
            try
            {
                var moveNext = stateMachine.Methods.First(x => x.Name == "MoveNext");
                methodProcessor.Process(moveNext);
            }
            catch (Exception exception)
            {
                throw new Exception($"Failed to process '{stateMachine.FullName}'.", exception);
            }
        }
    }