public static void Validate(ProgramService service) { var type = service.GetType(); var bindingFlags = BindingFlags.Instance | BindingFlags.NonPublic; var onStart = type.GetMethod("OnStart", bindingFlags, null, new[] { typeof(string[]) }, null); EnsureNotOverriden(onStart); var onStop = type.GetMethod("OnStop", bindingFlags); EnsureNotOverriden(onStop); }