private static string GetFieldName(Action <NamingConventions <MemberContext> > config) { var convention = MemberNamingConventions.Create(); config(convention); return(convention.GetName(new MemberContext(Field, new Context(Options, Mode.Deserialize, "xml")))); }
public string GetName <T>(string field, Options options = null) { return(MemberNamingConventions.Create() .GetName(new MemberContext(new CachedMember(typeof(T).GetField(field, BindingFlags.NonPublic | BindingFlags.Instance)), new Context(options ?? Options.Create(), Mode.Deserialize, "xml")))); }
public Options() { Serialization = new SerializationOptions(this); Deserialization = new DeserializationOptions(this); EnumValueNameConventions = EnumValueNamingConventions.Create(); PropertyNameConventions = MemberNamingConventions.Create(); FieldNameConventions = MemberNamingConventions.Create(); ArrayItemNameConventions = ArrayItemNamingConventions.Create(); TypeNameConventions = TypeNamingConvention.Create(); }
public string GetName <T>(string property, Options options = null) { return(MemberNamingConventions.Create() .GetName(new MemberContext(new CachedMember(typeof(T).GetProperty(property)), new Context(options ?? Options.Create(), Mode.Deserialize, "xml")))); }