/// <summary> /// 精准获取动态类 /// </summary> /// <param name="classIndex">类索引,1开始</param> /// <param name="namespaceIndex">命名空间索引,1开始</param> /// <returns></returns> public Type GetType(int classIndex = 1, int namespaceIndex = 1) { Complier.Add(this); string name = default; switch (OopTypeEnum) { case OopType.Class: name = ScriptHelper.GetClassName(Script, classIndex, namespaceIndex); break; case OopType.Struct: name = ScriptHelper.GetStructName(Script, classIndex, namespaceIndex); break; case OopType.Interface: name = ScriptHelper.GetInterfaceName(Script, classIndex, namespaceIndex); break; case OopType.Enum: name = ScriptHelper.GetEnumName(Script, classIndex, namespaceIndex); break; } return(Complier.GetType(name)); }
/// <summary> /// 返回强类型委托 /// </summary> /// <typeparam name="S">委托的强类型</typeparam> /// <returns></returns> public virtual S Complie <S>(object binder = null) where S : Delegate { Complier.Add(this); return(Complier.GetDelegate <S>( OopNameScript, MethodNameScript, binder)); }
/// <summary> /// 编译返回委托 /// </summary> /// <returns></returns> public virtual Delegate Complie(object binder = null) { Complier.Add(this); return(Complier.GetDelegate( OopNameScript, MethodNameScript, DelegateType, binder)); }