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"))));
        }
Example #2
0
 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"))));
 }
Example #3
0
 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();
 }
Example #4
0
 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"))));
 }