QuoteItemBase2.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. namespace Muchinfo.MTPClient.Data.Model.QuoteItem
  2. {
  3. /// <summary>
  4. /// QuoteItemBase2类
  5. /// </summary>
  6. public class QuoteItemBase2 : QuoteItemBase
  7. {
  8. #region Fields
  9. /// <summary>
  10. /// 买价
  11. /// </summary>
  12. private decimal _buyPrice;
  13. /// <summary>
  14. /// 买量
  15. /// </summary>
  16. private int _buyVolume;
  17. /// <summary>
  18. /// 现量
  19. /// </summary>
  20. private int _currentVolume;
  21. /// <summary>
  22. /// 排序
  23. /// </summary>
  24. private int _order;
  25. /// <summary>
  26. /// 报价货币
  27. /// </summary>
  28. private string _quoteCurrency;
  29. /// <summary>
  30. /// 卖价
  31. /// </summary>
  32. private decimal _sellPrice;
  33. /// <summary>
  34. /// 卖量
  35. /// </summary>
  36. private int _sellVolume;
  37. /// <summary>
  38. /// 总量
  39. /// </summary>
  40. private int _totalVolume;
  41. #endregion Fields
  42. #region Properties
  43. #region Public Properties
  44. /// <summary>
  45. /// 买价
  46. /// </summary>
  47. public decimal BuyPrice
  48. {
  49. get
  50. {
  51. return _buyPrice;
  52. }
  53. set
  54. {
  55. Set(() => BuyPrice, ref _buyPrice, value);
  56. }
  57. }
  58. /// <summary>
  59. /// 买量
  60. /// </summary>
  61. public int BuyVolume
  62. {
  63. get
  64. {
  65. return _buyVolume;
  66. }
  67. set
  68. {
  69. Set(() => BuyVolume, ref _buyVolume, value);
  70. }
  71. }
  72. /// <summary>
  73. /// 现量
  74. /// </summary>
  75. public int CurrentVolume
  76. {
  77. get
  78. {
  79. return _currentVolume;
  80. }
  81. set
  82. {
  83. Set(() => CurrentVolume, ref _currentVolume, value);
  84. }
  85. }
  86. /// <summary>
  87. /// 排序
  88. /// </summary>
  89. public int Order
  90. {
  91. get
  92. {
  93. return _order;
  94. }
  95. set
  96. {
  97. Set(() => Order, ref _order, value);
  98. }
  99. }
  100. /// <summary>
  101. /// 报价货币
  102. /// </summary>
  103. public string QuoteCurrency
  104. {
  105. get
  106. {
  107. return _quoteCurrency;
  108. }
  109. set
  110. {
  111. Set(() => QuoteCurrency, ref _quoteCurrency, value);
  112. }
  113. }
  114. /// <summary>
  115. /// 卖价
  116. /// </summary>
  117. public decimal SellPrice
  118. {
  119. get
  120. {
  121. return _sellPrice;
  122. }
  123. set
  124. {
  125. Set(() => SellPrice, ref _sellPrice, value);
  126. }
  127. }
  128. /// <summary>
  129. /// 卖量
  130. /// </summary>
  131. public int SellVolume
  132. {
  133. get
  134. {
  135. return _sellVolume;
  136. }
  137. set
  138. {
  139. Set(() => SellVolume, ref _sellVolume, value);
  140. }
  141. }
  142. /// <summary>
  143. /// 总量
  144. /// </summary>
  145. public int TotalVolume
  146. {
  147. get
  148. {
  149. return _totalVolume;
  150. }
  151. set
  152. {
  153. Set(() => TotalVolume, ref _totalVolume, value);
  154. }
  155. }
  156. #endregion Public Properties
  157. #endregion Properties
  158. #region Methods
  159. #region Public Methods
  160. /// <summary>
  161. /// 更新对象属性值(只更新需要字段)
  162. /// </summary>
  163. /// <param name="item">The item.</param>
  164. public override void UpdateFrom(QuoteItemBase item)
  165. {
  166. base.UpdateFrom(item);
  167. var item2 = item as QuoteItemBase2;
  168. if (item2 == null)
  169. {
  170. return;
  171. }
  172. this.BuyPrice = item2.BuyPrice;
  173. this.BuyVolume = item2.BuyVolume;
  174. this.CurrentVolume = item2.CurrentVolume;
  175. this.SellPrice = item2.SellPrice;
  176. this.SellVolume = item2.SellVolume;
  177. this.TotalVolume = item2.TotalVolume;
  178. }
  179. #endregion Public Methods
  180. #endregion Methods
  181. }
  182. }