AccountManagerView.xaml.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using Muchinfo.MTPClient.Account.ViewModels;
  2. using Muchinfo.MTPClient.Data.Enums;
  3. using Muchinfo.MTPClient.Data.Model;
  4. using Muchinfo.MTPClient.Infrastructure.Comparers;
  5. using Muchinfo.MTPClient.Infrastructure.Utilities;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Input;
  11. namespace Muchinfo.MTPClient.Account.Views
  12. {
  13. /// <summary>
  14. /// AccountManagerView.xaml 的交互逻辑
  15. /// </summary>
  16. public partial class AccountManagerView : UserControl
  17. {
  18. public AccountManagerView()
  19. {
  20. InitializeComponent();
  21. }
  22. /// <summary>
  23. /// Currents the goods.
  24. /// </summary>
  25. /// <returns>QuoteGoods.</returns>
  26. public List<QuoteGoods> CurrentGoods()
  27. {
  28. var quoteGoodsList = new List<QuoteGoods>();
  29. if (UserManager.CurrentTradeAccount != null &&
  30. UserManager.CurrentTradeAccount.AccountType != eUserType.USERTYPE_INVESTOR)
  31. {
  32. var position = UserManager.CacheOpenOrders(UserManager.CurrentTradeAccount);
  33. if (position == null || !position.Any()) return quoteGoodsList;
  34. var quote = position.Select((summary) => summary.QuoteGoods).Distinct(new QuoteGoodsComparer());
  35. quoteGoodsList = new List<QuoteGoods>(quote);
  36. }
  37. return quoteGoodsList;
  38. }
  39. private void Password_OnKeyUp(object sender, KeyEventArgs e)
  40. {
  41. //使用KeyUp,阻止键盘精灵弹出
  42. e.Handled = true;
  43. }
  44. }
  45. }