KeyValuePairDecorator.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. 
  2. namespace ProtoBuf.Serializers
  3. {
  4. /*
  5. sealed class KeyValuePairDecorator : IProtoSerializer
  6. {
  7. private readonly Type pairType;
  8. private readonly IProtoSerializer keyTail, valueTail;
  9. public KeyValuePairDecorator(Type pairType, IProtoSerializer keyTail, IProtoSerializer valueTail) {
  10. Helpers.DebugAssert(pairType != null);
  11. Helpers.DebugAssert(keyTail != null);
  12. Helpers.DebugAssert(valueTail != null);
  13. Helpers.DebugAssert(pairType == typeof(System.Collections.Generic.KeyValuePair<,>).MakeGenericType(keyTail.ExpectedType,valueTail.ExpectedType), "Key/value type mismatch");
  14. this.pairType = pairType;
  15. this.keyTail = keyTail;
  16. this.valueTail = valueTail;
  17. }
  18. public Type ExpectedType { get { return pairType;}}
  19. public bool ReturnsValue { get { return true; } }
  20. public bool RequiresOldValue { get { return true; } }
  21. public abstract void Write(object value, ProtoWriter dest)
  22. {
  23. }
  24. public abstract object Read(object value, ProtoReader source)
  25. {
  26. }
  27. #if FEAT_COMPILER
  28. void IProtoSerializer.EmitWrite(Compiler.CompilerContext ctx, Compiler.Local valueFrom)
  29. {
  30. throw new NotImplementedException();
  31. }
  32. void IProtoSerializer.EmitRead(Compiler.CompilerContext ctx, Compiler.Local valueFrom) {
  33. throw new NotImplementedException();
  34. }
  35. #endif
  36. }*/
  37. }