QuoteService.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. //using Muchinfo.MTPClient.Data.Enums;
  2. //using Muchinfo.MTPClient.Infrastructure.Cache;
  3. //using Muchinfo.MTPClient.Infrastructure.EntityHelpers;
  4. //using Muchinfo.MTPClient.Infrastructure.LinkProxy;
  5. //using Muchinfo.MTPClient.Infrastructure.Utilities;
  6. //using System.Linq;
  7. //namespace Muchinfo.MTPClient.Service
  8. //{
  9. // public class QuoteService
  10. // {
  11. // /// <summary>
  12. // /// The _instance
  13. // /// </summary>
  14. // private static readonly QuoteService _instance = new QuoteService();
  15. // /// <summary>
  16. // /// 单例
  17. // /// </summary>
  18. // /// <value>The intance.</value>
  19. // public static QuoteService Instance
  20. // {
  21. // get { return _instance; }
  22. // }
  23. // #region Constructors
  24. // /// <summary>
  25. // /// Prevents a default instance of the <see cref="QuoteService"/> class from being created.
  26. // /// </summary>
  27. // private QuoteService()
  28. // {
  29. // ApplicationParameter.QuotationMessenger.Register<bool>(this, MessengerTokens.QuoteServerConnectMsg, (state) =>
  30. // {
  31. // if (state)
  32. // {
  33. // QuoteSubscribe();//重连后再发订阅
  34. // }
  35. // });
  36. // }
  37. // #endregion Constructors
  38. // #region Methods
  39. // #region Public Static Methods
  40. // /// <summary>
  41. // /// 订阅行情
  42. // /// </summary>
  43. // public void QuoteSubscribe()
  44. // {
  45. // var client = LinkManager.Instance.QuoteTcpLinkProxy;
  46. // if (client == null) return;
  47. // var goodsList = CacheManager.CacheGoodsBaseInfos;
  48. // if (null != goodsList && goodsList.Any())
  49. // {
  50. // var symbolsArray = goodsList.ToQuoteDatagramString();
  51. // if (symbolsArray.Length > 0)
  52. // {
  53. // client.Subscribe(goodsList);
  54. // }
  55. // }
  56. // //if (dicGoodsSort != null)
  57. // //{
  58. // // foreach (var qouteGoods in CacheManager.CacheGoodsBaseInfos) //设置商品组
  59. // // {
  60. // // if (dicGoodsSort.ContainsKey(qouteGoods.Symbol.ToUpper()))
  61. // // {
  62. // // qouteGoods.Sort = dicGoodsSort[qouteGoods.Symbol];
  63. // // }
  64. // // }
  65. // //}
  66. // }
  67. // #endregion Public Static Methods
  68. // #endregion Methods
  69. // }
  70. //}