| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using Muchinfo.MTPClient.Account.ViewModels;
- using Muchinfo.MTPClient.Data.Enums;
- using Muchinfo.MTPClient.Data.Model;
- using Muchinfo.MTPClient.Infrastructure.Comparers;
- using Muchinfo.MTPClient.Infrastructure.Utilities;
- using System.Collections.Generic;
- using System.Linq;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Input;
- namespace Muchinfo.MTPClient.Account.Views
- {
- /// <summary>
- /// AccountManagerView.xaml 的交互逻辑
- /// </summary>
- public partial class AccountManagerView : UserControl
- {
- public AccountManagerView()
- {
- InitializeComponent();
-
- }
- /// <summary>
- /// Currents the goods.
- /// </summary>
- /// <returns>QuoteGoods.</returns>
- public List<QuoteGoods> CurrentGoods()
- {
- var quoteGoodsList = new List<QuoteGoods>();
- if (UserManager.CurrentTradeAccount != null &&
- UserManager.CurrentTradeAccount.AccountType != eUserType.USERTYPE_INVESTOR)
- {
- var position = UserManager.CacheOpenOrders(UserManager.CurrentTradeAccount);
- if (position == null || !position.Any()) return quoteGoodsList;
- var quote = position.Select((summary) => summary.QuoteGoods).Distinct(new QuoteGoodsComparer());
- quoteGoodsList = new List<QuoteGoods>(quote);
- }
- return quoteGoodsList;
- }
-
- private void Password_OnKeyUp(object sender, KeyEventArgs e)
- {
- //使用KeyUp,阻止键盘精灵弹出
- e.Handled = true;
- }
- }
- }
|