public MainWindowViewModel(IRegionManager regionManager, IApplicationCommand applicationCommand, TmsClient nepse, IDialogService dialog, MeroshareClient meroshareClient, IConfiguration config) { _regionManager = regionManager; _client = nepse; _dialog = dialog; _meroshareClient = meroshareClient; _config = config; ApplicationCommand = applicationCommand; applicationCommand.ShowMessage = ShowMessage; _client.PromptCredentials = GetTmsCredentials; _meroshareClient.PromptCredential = GetMeroShareCredentials; }
static void Main(string[] args) { Log.Logger = new LoggerConfiguration() .WriteTo.Console() .MinimumLevel.Verbose() .CreateLogger(); Log.Verbose("Application started"); var baseUrl = args[0]; var username = args[1]; var password = args[2]; if (string.IsNullOrEmpty(baseUrl)) { Log.Information("Base Url is empty. Closing application"); return; } if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password)) { Log.Information("Username/Password is empty. Closing application"); return; } try { Log.Verbose("Creating rest client"); var client = new TmsClient(); var businessDate = client.GetBusinessDate(); Log.Debug("Business Date: {0}", businessDate); client.RestoreSession(); var demo = new TmsDemo(client); demo.Run(username, password); client.SaveSession(); } catch (Exception ex) { Log.Fatal(ex, "Unknown error"); } }
static void Main(string[] args) { Log.Logger = new LoggerConfiguration() .MinimumLevel.Debug() .WriteTo.Console() .CreateLogger(); try { Log.Debug("Starting application"); var client = new TmsClient(new Configuration()) { PromptCredentials = GetCredentials }; //using (var socketHelper = new SocketHelper(client)) //{ // socketHelper.Send("index", true); // while (!socketHelper.Received) // { // socketHelper.SendOpCode(); // System.Threading.Thread.Sleep(10000); // } //} var securities = client.GetSecurities(); ConsoleTable .From(securities.Payload.Data) .Write(); } catch (Exception ex) { Log.Error(ex, "Unknown error"); } Log.Debug("Application ended."); }
public TopGainerPageViewModel(TmsClient client) { Items = client.GetTopGainers(); }
public TmsLiveMarketPageViewModel(IApplicationCommand appCommand, TmsClient client) : base(appCommand) { _client = client; }