KeyValuePairProxy.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //using System.Collections.Generic;
  2. //namespace ProtoBuf
  3. //{
  4. // /// <summary>
  5. // /// Mutable version of the common key/value pair struct; used during serialization. This type is intended for internal use only and should not
  6. // /// be used by calling code; it is required to be public for implementation reasons.
  7. // /// </summary>
  8. // [ProtoContract]
  9. // public struct KeyValuePairSurrogate<TKey,TValue>
  10. // {
  11. // private TKey key;
  12. // private TValue value;
  13. // /// <summary>
  14. // /// The key of the pair.
  15. // /// </summary>
  16. // [ProtoMember(1, IsRequired = true)]
  17. // public TKey Key { get { return key; } set { key = value; } }
  18. // /// <summary>
  19. // /// The value of the pair.
  20. // /// </summary>
  21. // [ProtoMember(2)]
  22. // public TValue Value{ get { return value; } set { this.value = value; } }
  23. // private KeyValuePairSurrogate(TKey key, TValue value)
  24. // {
  25. // this.key = key;
  26. // this.value = value;
  27. // }
  28. // /// <summary>
  29. // /// Convert a surrogate instance to a standard pair instance.
  30. // /// </summary>
  31. // public static implicit operator KeyValuePair<TKey, TValue> (KeyValuePairSurrogate<TKey, TValue> value)
  32. // {
  33. // return new KeyValuePair<TKey,TValue>(value.key, value.value);
  34. // }
  35. // /// <summary>
  36. // /// Convert a standard pair instance to a surrogate instance.
  37. // /// </summary>
  38. // public static implicit operator KeyValuePairSurrogate<TKey, TValue>(KeyValuePair<TKey, TValue> value)
  39. // {
  40. // return new KeyValuePairSurrogate<TKey, TValue>(value.Key, value.Value);
  41. // }
  42. // }
  43. //}