コード例 #1
0
 public static SerializableType CreateDescribedListType(
     AmqpSerializer serializer,
     Type type,
     SerializableType baseType,
     string descriptorName,
     ulong? descriptorCode,
     SerialiableMember[] members,
     Dictionary<Type, SerializableType> knownTypes,
     MethodAccessor[] serializationCallbacks)
 {
     return new DescribedListType(serializer, type, baseType, descriptorName,
         descriptorCode, members, knownTypes, serializationCallbacks);
 }
コード例 #2
0
            protected override int ReadMemberValue(ByteBuffer buffer, SerialiableMember serialiableMember, object container)
            {
                string key = Encoder.ReadString(buffer, Encoder.ReadFormatCode(buffer));
                SerialiableMember member = null;
                if (!this.membersMap.TryGetValue(key, out member))
                {
                    throw new SerializationException("Unknown key name " + key);
                }

                object value = member.Type.ReadObject(buffer);
                member.Accessor.Set(container, value);
                return 2;
            }
コード例 #3
0
 public DescribedSimpleMapType(
     AmqpSerializer serializer,
     Type type,
     SerializableType baseType,
     SerialiableMember[] members,
     MethodAccessor[] serializationCallbacks)
     : base(serializer, type, baseType, null, null, members, null, serializationCallbacks)
 {
     this.membersMap = new Dictionary<string, SerialiableMember>();
     foreach (SerialiableMember member in members)
     {
         this.membersMap.Add(member.Name, member);
     }
 }
コード例 #4
0
 protected override int ReadMemberValue(ByteBuffer buffer, SerialiableMember serialiableMember, object container)
 {
     object value = serialiableMember.Type.ReadObject(buffer);
     serialiableMember.Accessor.Set(container, value);
     return 1;
 }
コード例 #5
0
 public DescribedMapType(
     AmqpSerializer serializer,
     Type type,
     SerializableType baseType,
     string descriptorName,
     ulong? descriptorCode,
     SerialiableMember[] members,
     Dictionary<Type, SerializableType> knownTypes,
     MethodAccessor[] serializationCallbacks)
     : base(serializer, type, baseType, descriptorName, descriptorCode, members, knownTypes, serializationCallbacks)
 {
     this.membersMap = new Dictionary<string, SerialiableMember>();
     foreach(SerialiableMember member in members)
     {
         this.membersMap.Add(member.Name, member);
     }
 }
コード例 #6
0
 protected abstract int ReadMemberValue(ByteBuffer buffer, SerialiableMember serialiableMember, object container);
コード例 #7
0
 protected DescribedCompoundType(
     AmqpSerializer serializer,
     Type type,
     SerializableType baseType,
     string descriptorName,
     ulong? descriptorCode,
     SerialiableMember[] members,
     Dictionary<Type, SerializableType> knownTypes,
     MethodAccessor[] serializationCallbacks)
     : base(serializer, type)
 {
     this.baseType = (DescribedCompoundType)baseType;
     this.descriptorName = descriptorName;
     this.descriptorCode = descriptorCode;
     this.members = members;
     this.serializationCallbacks = serializationCallbacks;
     this.knownTypes = GetKnownTypes(knownTypes);
 }
コード例 #8
0
 public static SerializableType CreateDescribedSimpleMapType(
     AmqpSerializer serializer,
     Type type,
     SerializableType baseType,
     SerialiableMember[] members,
     MethodAccessor[] serializationCallbacks)
 {
     return new DescribedSimpleMapType(serializer, type, baseType, members, serializationCallbacks);
 }
コード例 #9
0
 public DescribedListType(
     AmqpSerializer serializer,
     Type type,
     SerializableType baseType,
     string descriptorName,
     ulong? descriptorCode,
     SerialiableMember[] members,
     Dictionary<Type, SerializableType> knownTypes,
     MethodAccessor onDesrialized)
     : base(serializer, type, baseType, descriptorName, descriptorCode, members, knownTypes, onDesrialized)
 {
 }
コード例 #10
0
ファイル: SerializableType.cs プロジェクト: Eclo/amqpnetlite
 public DescribedSimpleListType(
     AmqpSerializer serializer,
     Type type,
     SerializableType baseType,
     SerialiableMember[] members,
     MethodAccessor[] serializationCallbacks)
     : base(serializer, type, baseType, null, null, members, null, serializationCallbacks)
 {
 }