public AccountPage() : base() { InitializeComponent(); if (!int.TryParse(ConfigurationManager.AppSettings.Get("walletUpdateTimeMiliseconds"), out updateTimeMiliseconds)) { MessageBox.Show("O parametro do App.Config walletUpdateTimeMiliseconds está setado com valor inválido, foi aplicado o valor padrão (" + updateTimeMiliseconds + ")!"); } PoloniexClient = PoloniexClient.Instance(ApiKeys.PublicKey, ApiKeys.PrivateKey); }
private async void btnBuy_Click(object sender, RoutedEventArgs e) { double amount = 0; double price = 0; if (double.TryParse(txtAmount.Text, out amount)) { if (double.TryParse(txtPrice.Text, out price)) { await PoloniexClient.Instance(ApiKeys.PublicKey, ApiKeys.PrivateKey).Trading.PostOrderAsync(_currencyPair, OrderType.Buy, price, amount); } } }
public TradeHistory(CurrencyPair currencyPair, int _selectedIndex = 0) { InitializeComponent(); // Set icon from the assembly this.Icon = System.Drawing.Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location).ToImageSource(); PoloniexClient = PoloniexClient.Instance(ApiKeys.PublicKey, ApiKeys.PrivateKey); CurrencyPair = currencyPair; Title = string.Concat("Trade History", "(", CurrencyPair.ToString(), ")"); tabControl.SelectedIndex = _selectedIndex; }
public ChartLendingWindow(string currency) { InitializeComponent(); // Set icon from the assembly Icon = System.Drawing.Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location).ToImageSource(); PoloniexClient = PoloniexClient.Instance(ApiKeys.PublicKey, ApiKeys.PrivateKey); Currency = currency; Title = string.Concat("Lending Candlestick ", "(", currency, ")"); LoadChart(); }
public ChartWindow(CurrencyPair currencyPair) { InitializeComponent(); // Set icon from the assembly Icon = System.Drawing.Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location).ToImageSource(); PoloniexClient = PoloniexClient.Instance(ApiKeys.PublicKey, ApiKeys.PrivateKey); CurrencyPair = currencyPair; Title = string.Concat("History ", "(", CurrencyPair.ToString(), ")"); LoadChart(); }
private void Grid_Loaded(object sender, RoutedEventArgs e) { if (!int.TryParse(ConfigurationManager.AppSettings.Get("exchangeUpdateTimeMiliseconds"), out updateTimeMiliseconds)) { MessageBox.Show("O parametro do App.Config exchangeUpdateTimeMiliseconds está setado com valor inválido, foi aplicado o valor padrão (" + updateTimeMiliseconds + ")!"); } switch (currentExchangeCoin) { case "XMR": selectedCurrency = "XMR_LTC"; exchangeBTCVolumeMinimun = 0; break; case "USDT": selectedCurrency = "USDT_BTC"; exchangeBTCVolumeMinimun = 0; break; case "ETH": selectedCurrency = "ETH_LSK"; exchangeBTCVolumeMinimun = 0; break; default: selectedCurrency = "BTC_ETH"; if (!double.TryParse(ConfigurationManager.AppSettings.Get("exchangeBTCVolumeMinimun"), out exchangeBTCVolumeMinimun)) { MessageBox.Show("O parametro do App.Config exchangeBTCVolumeMinimun está setado com valor inválido, foi aplicado o valor padrão (3.1)!"); exchangeBTCVolumeMinimun = 3.1; } break; } PoloniexClient = PoloniexClient.Instance(ApiKeys.PublicKey, ApiKeys.PrivateKey); semaphoreSlim = new SemaphoreSlim(1); updateTimer = new Timer(UpdateGrid, null, 0, updateTimeMiliseconds); if (currencyItems == null) { currencyItems = new List <string>(); } disposedValue = false; }
public MainWindow() { InitializeComponent(); BuildTabs(); txtTrollbox.Document.Background = Brushes.Black; txtTrollbox.BorderThickness = new Thickness(0); txtTrollbox.Margin = new Thickness(2); // Set icon from the assembly this.Icon = System.Drawing.Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location).ToImageSource(); if (!int.TryParse(ConfigurationManager.AppSettings.Get("headerUpdateTimeMiliseconds"), out updateTimeMiliseconds)) { MessageBox.Show("O parametro do App.Config lendingUpdateTimeMiliseconds está setado com valor inválido, foi aplicado o valor padrão (" + updateTimeMiliseconds + ")!"); } PoloniexClient = PoloniexClient.Instance(ApiKeys.PublicKey, ApiKeys.PrivateKey); PoloniexClient.Live.OnTrollboxMessage += Live_OnTrollboxMessage; FachadaWSSGS = Singleton <FachadaWSSGS.FachadaWSSGSClient> .Instance; LiveStart(); semaphoreSlim = new SemaphoreSlim(1); updateTimer = new Timer(UpdateView, null, 0, updateTimeMiliseconds); disposedValue = false; myNotifyIcon.Icon = System.Drawing.Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location); myNotifyIcon.ToolTipText = this.Title; myNotifyIcon.MenuActivation = Hardcodet.Wpf.TaskbarNotification.PopupActivationMode.LeftClick; myNotifyIcon.PopupActivation = Hardcodet.Wpf.TaskbarNotification.PopupActivationMode.DoubleClick; txtTitleNotify.Text = this.Title; var contextMenu = new ContextMenu(); myNotifyIcon.ContextMenu = contextMenu; myNotifyIcon.ShowBalloonTip(this.Title, "DallEX is started!", BalloonIcon.Info); }
private async void btnSell_Click(object sender, RoutedEventArgs e) { double amount = 0; double price = 0; if (double.TryParse(txtAmount.Text, out amount)) { if (double.TryParse(txtPrice.Text, out price)) { var t = await PoloniexClient.Instance(ApiKeys.PublicKey, ApiKeys.PrivateKey).Trading.PostOrderAsync(_currencyPair, OrderType.Sell, price, amount); if (t > 0) { MessageBox.Show("Confirmed!"); } else { MessageBox.Show("Error!"); } } } }
private void Grid_Loaded(object sender, RoutedEventArgs e) { if (!int.TryParse(ConfigurationManager.AppSettings.Get("lendingUpdateTimeMiliseconds"), out updateTimeMiliseconds)) { MessageBox.Show("O parametro do App.Config lendingUpdateTimeMiliseconds está setado com valor inválido, foi aplicado o valor padrão (" + updateTimeMiliseconds + ")!"); } if (!int.TryParse(ConfigurationManager.AppSettings.Get("lendingPeriodMinute"), out lendingPeriodMinute)) { MessageBox.Show("O parametro do App.Config lendingUpdateTimeMiliseconds está setado com valor inválido, foi aplicado o valor padrão (" + lendingPeriodMinute + ")!"); } PoloniexClient = PoloniexClient.Instance(ApiKeys.PublicKey, ApiKeys.PrivateKey); semaphoreSlim = new SemaphoreSlim(1); updateTimer = new Timer(UpdateLoans, null, 0, updateTimeMiliseconds); txtMinutos.Text = lendingPeriodMinute.ToString(); disposedValue = false; MainWindow.SendBaloonMessage("Lending", Hardcodet.Wpf.TaskbarNotification.BalloonIcon.None); }