public ProcessBaseCore() { //Console.WriteLine(this + " : " + parent); Impl = ProcessBaseImplFactory(); State = State.Started; Impl.Init(() => { Action method = Main; restart: try { State = State.Running; method(); State = State.Ended; Yield(); } catch (ChangeExecutionMethodException ChangeExecutionMethodException) { method = ChangeExecutionMethodException.method; goto restart; } }); }
public ProcessBase() { //Console.WriteLine(this + " : " + parent); Impl = (IProcessBaseImpl)Activator.CreateInstance(ProcessBaseImplType); State = State.Started; Impl.Init(() => { State = State.Running; main(); State = State.Ended; Yield(); }); }