public FieldInfo(IJsonClassConfig generator, string jsonMemberName, JsonType type, bool usePascalCase, IList <object> Examples) { this.generator = generator; this.JsonMemberName = jsonMemberName; this.MemberName = jsonMemberName; if (usePascalCase) { MemberName = JsonClassGenerator.ToTitleCase(MemberName); } this.Type = type; this.Examples = Examples; }
private JsonClassGenerator Prepare(string jsonText) { var gen = new JsonClassGenerator(); gen.Example = jsonText; gen.InternalVisibility = false; //Internal or public gen.ExplicitDeserialization = false; //明确反序列化 gen.Namespace = "Example"; //命名空间 gen.NoHelperClass = true; //是否生成帮助类 gen.SecondaryNamespace = null; //子命名空间 gen.UseProperties = true; //还原驼峰结构 gen.MainClass = "SampleClass"; //类名 gen.UsePascalCase = true; gen.UseNestedClasses = false; gen.ApplyObfuscationAttributes = false; gen.SingleFile = true; gen.ExamplesInDocumentation = false; return gen; }