private void ParseEvent(Global.IActor actor, Utils.Objects.GameEventArgs args) { string name = "ParseEvent_" + args.GetType().ToString().Split('.').Last().Replace("Args", ""); MethodInfo method = this.GetType().GetMethod(name, BindingFlags.NonPublic | BindingFlags.Instance); if (method != null) { method.Invoke(this, new object[]{ actor, args }); } else throw new Exception("Cannot invoke \"" + name + "\"."); }