Guest User

Untitled

a guest
Jan 21st, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. public virtual BaseMessage ShallowCopy()
  2. {
  3. return (BaseMessage) this.MemberwiseClone();
  4. }
  5.  
  6. public MarketCommission CommissionRate { get; set; }
  7. public TradingStatistic TradingStatistic { get; set; } = new TradingStatistic();
  8. public RiskInfo RiskInfo { get; set; } = new RiskInfo();
  9.  
  10.  
  11. public override BaseMessage ShallowCopy()
  12. {
  13. RiskInfo riskInfo = this.RiskInfo?.ShallowCopy() as RiskInfo;
  14. TradingStatistic tradingStatistic = this.TradingStatistic?.ShallowCopy() as TradingStatistic;
  15. MarketCommission marketCommission = this.CommissionRate.ShallowCopy();
  16. AccountInfo accountInfo = (AccountInfo) base.ShallowCopy();
  17. accountInfo.RiskInfo = riskInfo;
  18. accountInfo.TradingStatistic = tradingStatistic;
  19. accountInfo.CommissionRate = marketCommission;
  20. return (BaseMessage) accountInfo;
Add Comment
Please, Sign In to add comment