Exemplo n.º 1
0
 public Parameters(params Parameter[] parameters)
 {
     if (parameters.Select(x => x.Code).Distinct(StringComparer.OrdinalIgnoreCase).Count() != parameters.Length)
     {
         throw new ArgumentException("Parameter codes are not unique");
     }
     _parameters.AddRange(parameters);
 }
Exemplo n.º 2
0
        internal MemberSet(Type type)
        {
            const BindingFlags PublicInstance = BindingFlags.Public | BindingFlags.Instance;

#if NET20
            RefList <MemberInfo> properties = new RefList <MemberInfo>(type.GetProperties(PublicInstance));
            properties.AddRange(new RefList <MemberInfo>(type.GetFields(PublicInstance)));
            properties.Sort((p1, p2) => p1.Name.CompareTo(p2.Name));
            members = properties.ConvertAll <Member>(mi => new Member(mi)).ToArray();
#else
            members = type.GetProperties(PublicInstance).Cast <MemberInfo>()
                      .Concat(type.GetFields(PublicInstance).Cast <MemberInfo>())
                      .OrderBy(x => Marshal.OffsetOf(type, x.Name).ToInt32())
                      .Select(member => new Member(member)).ToArray();
#endif
        }
Exemplo n.º 3
0
 public override void DeserializeRefList(GenericReader reader)
 {
     RefList.AddRange(reader.ReadStrongGuildList());
 }