QuoteProxyHelper.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. //----------------------------------------------------------------
  6. //Module Name: $safeprojectname$
  7. //Purpose:
  8. //CopyRight: Muchinfo
  9. //History:
  10. //----------------------------------------------------------------
  11. //DateTime 2016/10/24 16:28:09
  12. //Author
  13. //Description Create
  14. //----------------------------------------------------------------
  15. using Muchinfo.MTPClient.Data.Enums;
  16. using Muchinfo.MTPClient.Infrastructure.LinkProxy;
  17. namespace Muchinfo.MTPClient.Infrastructure.Utilities
  18. {
  19. public class QuoteProxyHelper
  20. {
  21. /// <summary>
  22. /// 行情订阅
  23. /// </summary>
  24. /// <param name="quoteScr"></param>
  25. public static void QuoteSubscribe(GoodsFromScr quoteScr)
  26. {
  27. switch (quoteScr)
  28. {
  29. case GoodsFromScr.All:
  30. if (LinkManager.Instance.GuestQuoteTcpLinkProxy != null)
  31. {
  32. LinkManager.Instance.GuestQuoteTcpLinkProxy.Subscribe();
  33. }
  34. if (LinkManager.Instance.QuoteTcpLinkProxy != null)
  35. {
  36. LinkManager.Instance.QuoteTcpLinkProxy.Subscribe();
  37. }
  38. break;
  39. case GoodsFromScr.Trade:
  40. if (LinkManager.Instance.QuoteTcpLinkProxy != null)
  41. {
  42. LinkManager.Instance.QuoteTcpLinkProxy.Subscribe();
  43. }
  44. break;
  45. case GoodsFromScr.Brown:
  46. if (LinkManager.Instance.GuestQuoteTcpLinkProxy != null)
  47. {
  48. LinkManager.Instance.GuestQuoteTcpLinkProxy.Subscribe();
  49. }
  50. break;
  51. default:
  52. break;
  53. }
  54. }
  55. /// <summary>
  56. /// 行情清盘
  57. /// </summary>
  58. public static void QuoteClear(GoodsFromScr quoteScr)
  59. {
  60. switch (quoteScr)
  61. {
  62. case GoodsFromScr.All:
  63. if (LinkManager.Instance.GuestQuoteTcpLinkProxy != null)
  64. {
  65. LinkManager.Instance.GuestQuoteTcpLinkProxy.ClearQuote();
  66. }
  67. if (LinkManager.Instance.QuoteTcpLinkProxy != null)
  68. {
  69. LinkManager.Instance.QuoteTcpLinkProxy.ClearQuote();
  70. }
  71. break;
  72. case GoodsFromScr.Trade:
  73. if (LinkManager.Instance.QuoteTcpLinkProxy != null)
  74. {
  75. LinkManager.Instance.QuoteTcpLinkProxy.ClearQuote();
  76. }
  77. break;
  78. case GoodsFromScr.Brown:
  79. if (LinkManager.Instance.GuestQuoteTcpLinkProxy != null)
  80. {
  81. LinkManager.Instance.GuestQuoteTcpLinkProxy.ClearQuote();
  82. }
  83. break;
  84. default:
  85. break;
  86. }
  87. }
  88. /// <summary>
  89. /// 取商品盘面
  90. /// </summary>
  91. /// <param name="quoteScr"></param>
  92. public static void QueryDayQuote(GoodsFromScr quoteScr)
  93. {
  94. switch (quoteScr)
  95. {
  96. case GoodsFromScr.All:
  97. if (LinkManager.Instance.GuestQuoteTcpLinkProxy != null)
  98. {
  99. LinkManager.Instance.GuestQuoteTcpLinkProxy.QueryDayQuote();
  100. }
  101. if (LinkManager.Instance.QuoteTcpLinkProxy != null)
  102. {
  103. LinkManager.Instance.QuoteTcpLinkProxy.QueryDayQuote();
  104. }
  105. break;
  106. case GoodsFromScr.Trade:
  107. if (LinkManager.Instance.QuoteTcpLinkProxy != null)
  108. {
  109. LinkManager.Instance.QuoteTcpLinkProxy.QueryDayQuote();
  110. }
  111. break;
  112. case GoodsFromScr.Brown:
  113. if (LinkManager.Instance.GuestQuoteTcpLinkProxy != null)
  114. {
  115. LinkManager.Instance.GuestQuoteTcpLinkProxy.QueryDayQuote();
  116. }
  117. break;
  118. default:
  119. break;
  120. }
  121. }
  122. }
  123. }