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); }
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 }
public override void DeserializeRefList(GenericReader reader) { RefList.AddRange(reader.ReadStrongGuildList()); }