public LogicMethod CreateEntityEventMethod(LogicMethodType methodType, string methodName) { if (this.EntityClassInfo == null) { Log.Error("LogicEntityClass: CreateEntityEventMethod: class not defined \"{0}\"", this.abe); return(null); } LogicMethod logicMethod = base.GetMethodByName(methodName); if (logicMethod != null) { Log.Fatal("LogicClass: already create method \"{0}\"", methodName); return(null); } logicMethod = (LogicMethod)Entities.Instance.Create(methodType, this); logicMethod.MethodName = methodName; logicMethod.isEntityEventMethod = true; logicMethod.PostCreate(); base.Add(logicMethod); MethodInfo method = logicMethod.EntityEventInfo.EventHandlerType.GetMethod("Invoke"); ParameterInfo[] parameters = method.GetParameters(); for (int i = 1; i < parameters.Length; i++) { ParameterInfo parameterInfo = parameters[i]; logicMethod.CreateParameter(parameterInfo.ParameterType, parameterInfo.Name); } return(logicMethod); }
public LogicMethod CreateMethod(LogicMethodType methodType, string methodName) { this.initMethods(); LogicMethod logicMethod = this.GetMethodByName(methodName); if (logicMethod != null) { Log.Fatal("LogicClass: already create method \"{0}\"", methodName); return(null); } logicMethod = (LogicMethod)Entities.Instance.Create(methodType, this); logicMethod.MethodName = methodName; logicMethod.PostCreate(); this.methods.Add(methodName, logicMethod); return(logicMethod); }