/// <summary> /// 字段 /// <para>eg. public Dictionary<string,string> TestDic = new Dictionary<string,string>();</para> /// </summary> /// <param name="inLeft">字段类型</param> /// <param name="inFieldName"></param> /// <param name="inRight"></param> public FieldItem(string inLeft, string inFieldName, string inRight = "", MemberAttributes inAtt = MemberAttributes.Private) { inLeft = Assist.GetFieldType(inLeft); if (inLeft.Contains("SMGame.")) { inLeft = inLeft.Replace("SMGame.", ""); } field = new CodeMemberField(inLeft, inFieldName); if (inRight != "") { CodeVariableReferenceExpression right = new CodeVariableReferenceExpression(inRight); field.InitExpression = right; } field.Attributes = inAtt; }
private Type GetType(string s, ref bool isSelfDefine) { Type t = Type.GetType("System.String"); string ts = Assist.GetFieldType(s); if (ts.Contains("SMGame"))// 自定义类型 { isSelfDefine = true; //t = Type.GetType("SMGame."+s); t = AutoCSharp.Do.Creator.TypeMapper.GetProtoTypeByName(s); } else { isSelfDefine = false; t = Type.GetType(ts); } return(t); }