mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-13 18:58:09 +00:00
Issue #262: function GetQuotes load data from MT instead of using cached quotes
This commit is contained in:
@@ -162,6 +162,7 @@ namespace MtApi5TestClient
|
||||
public DelegateCommand UnlockTicksCommand { get; private set; }
|
||||
|
||||
public DelegateCommand GetSymbolsCommand { get; private set; }
|
||||
public DelegateCommand RefreshQuotesCommand { get; private set; }
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
@@ -492,6 +493,7 @@ namespace MtApi5TestClient
|
||||
UnlockTicksCommand = new DelegateCommand(ExecuteUnlockTicks);
|
||||
|
||||
GetSymbolsCommand = new DelegateCommand(ExecuteGetSymbols);
|
||||
RefreshQuotesCommand = new DelegateCommand(ExecuteRefreshQuotes);
|
||||
}
|
||||
|
||||
private bool CanExecuteConnect(object o)
|
||||
@@ -1756,6 +1758,20 @@ namespace MtApi5TestClient
|
||||
Symbols = result;
|
||||
});
|
||||
}
|
||||
private async void ExecuteRefreshQuotes(object o)
|
||||
{
|
||||
_quotesMap.Clear();
|
||||
Quotes.Clear();
|
||||
|
||||
var quotes = await Execute(() => _mtApiClient.GetQuotes());
|
||||
if (quotes != null)
|
||||
{
|
||||
foreach (var quote in quotes)
|
||||
{
|
||||
AddQuote(quote);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void RunOnUiThread(Action action)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user