BinaryServerFormatterSinkProvider.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. //
  2. // System.Runtime.Remoting.Channels.BinaryServerFormatterSinkProvider.cs
  3. //
  4. // Author: Rodrigo Moya ([email protected])
  5. // Lluis Sanchez Gual ([email protected])
  6. //
  7. // 2002 (C) Copyright, Ximian, Inc.
  8. //
  9. using System.Collections;
  10. namespace System.Runtime.Remoting.Channels
  11. {
  12. public class BinaryServerFormatterSinkProvider :
  13. IServerFormatterSinkProvider, IServerChannelSinkProvider
  14. {
  15. IServerChannelSinkProvider next = null;
  16. BinaryCore _binaryCore;
  17. #if NET_1_0
  18. static string[] allowedProperties = new string [] { "includeVersions", "strictBinding" };
  19. #endif
  20. #if NET_1_1
  21. static string[] allowedProperties = new string [] { "includeVersions", "strictBinding", "typeFilterLevel" };
  22. #endif
  23. public BinaryServerFormatterSinkProvider ()
  24. {
  25. _binaryCore = BinaryCore.DefaultInstance;
  26. }
  27. public BinaryServerFormatterSinkProvider (IDictionary properties,
  28. ICollection providerData)
  29. {
  30. _binaryCore = new BinaryCore (this, properties, allowedProperties);
  31. }
  32. public IServerChannelSinkProvider Next
  33. {
  34. get {
  35. return next;
  36. }
  37. set {
  38. next = value;
  39. }
  40. }
  41. public IServerChannelSink CreateSink (IChannelReceiver channel)
  42. {
  43. IServerChannelSink next_sink = null;
  44. BinaryServerFormatterSink result;
  45. if (next != null)
  46. next_sink = next.CreateSink (channel);
  47. result = new BinaryServerFormatterSink (BinaryServerFormatterSink.Protocol.Other,
  48. next_sink, channel);
  49. result.BinaryCore = _binaryCore;
  50. return result;
  51. }
  52. public void GetChannelData (IChannelDataStore channelData)
  53. {
  54. // Nothing to add here
  55. }
  56. }
  57. }