PreciousMetalQuoteItem.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. namespace Muchinfo.MTPClient.Data.Model.QuoteItem
  2. {
  3. /// <summary>
  4. /// PreciousMetalQuoteItem类
  5. /// </summary>
  6. public class PreciousMetalQuoteItem : QuoteItemBase2
  7. {
  8. #region Fields
  9. /// <summary>
  10. /// 日增仓
  11. /// </summary>
  12. private int _dayAddPositions;
  13. /// <summary>
  14. /// 昨结算
  15. /// </summary>
  16. private decimal _lastSettlement;
  17. /// <summary>
  18. /// 每手单位
  19. /// </summary>
  20. private string _lotUnit;
  21. /// <summary>
  22. /// 持仓
  23. /// </summary>
  24. private long _positions;
  25. /// <summary>
  26. /// 报价单位
  27. /// </summary>
  28. private string _quoteUnit;
  29. #endregion Fields
  30. #region Properties
  31. #region Public Properties
  32. /// <summary>
  33. /// 日增仓
  34. /// </summary>
  35. public int DayAddPositions
  36. {
  37. get
  38. {
  39. return _dayAddPositions;
  40. }
  41. set
  42. {
  43. Set(() => DayAddPositions, ref _dayAddPositions, value);
  44. }
  45. }
  46. /// <summary>
  47. /// 昨结算
  48. /// </summary>
  49. public decimal LastSettlement
  50. {
  51. get
  52. {
  53. return _lastSettlement;
  54. }
  55. set
  56. {
  57. Set(() => LastSettlement, ref _lastSettlement, value);
  58. }
  59. }
  60. /// <summary>
  61. /// 每手单位
  62. /// </summary>
  63. public string LotUnit
  64. {
  65. get
  66. {
  67. return _lotUnit;
  68. }
  69. set
  70. {
  71. Set(() => LotUnit, ref _lotUnit, value);
  72. }
  73. }
  74. /// <summary>
  75. /// 持仓
  76. /// </summary>
  77. public long Positions
  78. {
  79. get
  80. {
  81. return _positions;
  82. }
  83. set
  84. {
  85. Set(() => Positions, ref _positions, value);
  86. }
  87. }
  88. /// <summary>
  89. /// 报价单位
  90. /// </summary>
  91. public string QuoteUnit
  92. {
  93. get
  94. {
  95. return _quoteUnit;
  96. }
  97. set
  98. {
  99. Set(() => QuoteUnit, ref _quoteUnit, value);
  100. }
  101. }
  102. #endregion Public Properties
  103. #endregion Properties
  104. #region Methods
  105. #region Public Methods
  106. /// <summary>
  107. /// 更新对象属性值(只更新需要字段)
  108. /// </summary>
  109. /// <param name="item">The item.</param>
  110. public override void UpdateFrom(QuoteItemBase item)
  111. {
  112. base.UpdateFrom(item);
  113. var pmItem = item as PreciousMetalQuoteItem;
  114. if (pmItem == null)
  115. {
  116. return;
  117. }
  118. this.DayAddPositions = pmItem.DayAddPositions;
  119. this.Positions = pmItem.Positions;
  120. }
  121. #endregion Public Methods
  122. #endregion Methods
  123. }
  124. }