/// <summary> /// 创建一个枚举Operator,命名空间默认是程序集命 /// </summary> /// <param name="name">枚举名</param> /// <returns></returns> public OopOperator CreateEnum(string name = default) { var @operator = new OopOperator().OopName(name).Namespace(Options.Name).ChangeToEnum(); _builderCache.Add(@operator); return(@operator); }
public Type GetType(string code, string typeName = default) { OopOperator oopOperator = OopOperator.Create(Complier, OptionAction); string result = oopOperator .GetUsingBuilder() .Append(code).ToString(); oopOperator.Complier.SyntaxInfos.Add(result, oopOperator.Usings); var text = result; if (typeName == default) { typeName = ScriptHelper.GetClassName(text); if (typeName == default) { typeName = ScriptHelper.GetInterfaceName(text); if (typeName == default) { typeName = ScriptHelper.GetStructName(text); if (typeName == default) { typeName = ScriptHelper.GetEnumName(text); } } } } return(oopOperator.Complier.GetType(typeName)); }
/// <summary> /// 创建一个结构体Operator,命名空间默认是程序集命 /// </summary> /// <param name="name">结构体名</param> /// <returns></returns> public OopOperator CreateStruct(string name = default) { var @operator = new OopOperator().OopName(name).Namespace(Options.AssemblyName).ChangeToStruct(); _builderCache.Add(@operator); return(@operator); }
public static (CompilationException Exception, Type Type) Create(Action <OopOperator> action, int classIndex = 1, int namespaceIndex = 1) { OopOperator builder = new OopOperator(); builder.Public.ChangeToStruct(); action(builder); var result = builder.GetType(classIndex, namespaceIndex); return(builder.Complier.ComplieException, result); }
public DomainOperator() { _operator = new OopOperator(); }
public DomainOperator() { _operator = new OopOperator(); Complier = new AssemblyComplier(); }