Inheritance: IDisposable
コード例 #1
0
ファイル: NextVm.cs プロジェクト: JohanLarsson/Next
 public NextVm(NextClient client)
 {
     _client = client;
     PublicFeed = new FeedVm(_client.PublicFeed);
     PrivateFeed = new FeedVm(_client.PrivateFeed);
     _client.LoggedInChanged += async (_, e) =>
         {
             OnPropertyChanged("IsLoggedIn");
             if (IsLoggedIn)
             {
                 List<InstrumentList> instrumentLists = await _client.Lists();
                 foreach (var instrumentList in instrumentLists.OrderBy(x => x.Name))
                 {
                     InstrumentLists.Add(new InstrumentListVm(instrumentList, _client));
                 }
                 List<Account> accounts = await _client.Accounts();
                 accounts.ForEach(Accounts.Add);
             }
         };
     Accounts.CollectionChanged += (o, e) =>
         {
             if (Account.Account != null || Accounts.Count > 1)
                 return;
             Account.Account = Accounts.First();
         };
     Account = new AccountVm(_client, null);
     var loginVm = new LoginVm();
     if (loginVm.Username != null && loginVm.Password != null)
     {
         _client.Login(loginVm.Username, loginVm.Password);
     }
 }
コード例 #2
0
ファイル: AccountVm.cs プロジェクト: JohanLarsson/Next
 public AccountVm(NextClient client, Account account)
 {
     _client = client;
     Account = account;
     Ledgers = new ObservableCollection<Ledger>();
     Trades = new ObservableCollection<Trade>();
     Positions = new ObservableCollection<Position>();
     Orders = new ObservableCollection<OrderStatus>();
 }
コード例 #3
0
ファイル: NextClientTests.cs プロジェクト: JohanLarsson/Next
 public void SetUp()
 {
     client = NextClient.TestClient;
 }
コード例 #4
0
ファイル: PublicFeedStub.cs プロジェクト: JohanLarsson/Next
 internal PublicFeedStub(NextClient client, Func<NextClient, FeedInfo> feedInfo)
     : base(client, feedInfo)
 {
 }
コード例 #5
0
ファイル: InstrumentListVm.cs プロジェクト: JohanLarsson/Next
 public InstrumentListVm(InstrumentList instrumentList, NextClient client)
 {
     this._client = client;
     this.InstrumentList = instrumentList;
 }
コード例 #6
0
ファイル: InstrumentVm.cs プロジェクト: JohanLarsson/Next
 public InstrumentVm(InstrumentItem instrument, NextClient client)
 {
     _client = client;
     Instrument = instrument;
 }
コード例 #7
0
ファイル: PrivateFeed.cs プロジェクト: JohanLarsson/Next
 internal PrivateFeed(NextClient client, Func<NextClient, FeedInfo> feedInfo)
     : base(client, feedInfo)
 {
 }