Esempio n. 1
0
        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"))));
        }
Esempio n. 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"))));
 }
Esempio n. 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();
 }
Esempio n. 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"))));
 }