Ejemplo n.º 1
0
 public DataMemberContract(MemberInfo member)
 {
     Contract.Requires(member != null);
     this._name           = member.Name;
     this._nilImplication = MsgPack.Serialization.NilImplication.MemberDefault;
     this._id             = -1;
 }
Ejemplo n.º 2
0
 public DataMemberContract(MemberInfo member, DataMemberAttribute attribute)
 {
     Contract.Requires(member != null);
     Contract.Requires(attribute != null);
     this._name           = string.IsNullOrEmpty(attribute.Name) ? member.Name : attribute.Name;
     this._nilImplication = MsgPack.Serialization.NilImplication.MemberDefault;
     this._id             = attribute.Order;
 }
Ejemplo n.º 3
0
 public DataMemberContract(MemberInfo member, MessagePackMemberAttribute attribute)
 {
     Contract.Requires(member != null);
     Contract.Requires(attribute != null);
     if (attribute.Id < 0)
     {
         throw new SerializationException(string.Format(CultureInfo.CurrentCulture, "The member ID cannot be negative. The member is '{0}' in the '{1}' type.", new object[] { member.Name, member.DeclaringType }));
     }
     this._name           = member.Name;
     this._nilImplication = attribute.NilImplication;
     this._id             = attribute.Id;
 }