Exemplo n.º 1
0
 private void tb_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.F1)
     {
         formTbMenu.Show();
         ParentForm.Focus();
     }
 }
Exemplo n.º 2
0
 private void textBoxMenuToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (textBoxMenuToolStripMenuItem.Checked)
     {
         formTbMenu.Show();
         ParentForm.Focus();
         tb_Update();
     }
     else
     {
         formTbMenu.Hide();
     }
 }
        private void toolStripButton_addSymbol_Click(object sender, EventArgs e)
        {
            //LogManager.AddLogMessage(Name, "toolStripButton_add_Click", sender.ToString(), LogManager.LogMessageType.DEBUG);
            try
            {
                //TradingViewSymbolOverview listItem = PreferenceManager.TradingViewPreferences.SymbolOverviewParameters.symbols.FirstOrDefault(item => item.tabName == toolStripTextBox_tabName.Text);
                if (listView_lists.SelectedObject != null)
                {
                    ArbitrageWatchList symbolList = listView_lists.SelectedObject as ArbitrageWatchList;

                    ExchangeTicker listItem = symbolList.Items.FirstOrDefault(item => item.symbol == toolStripTextBox_symbol.Text.ToUpper() && item.market == toolStripTextBox_market.Text.ToUpper());

                    if (listItem != null)
                    {
                        MessageBox.Show("Already an Item with this name.", "Duplicate");
                    }
                    else
                    {
                        ExchangeTicker item = new ExchangeTicker()
                        {
                            symbol = toolStripTextBox_symbol.Text.ToUpper(),
                            market = toolStripTextBox_market.Text.ToUpper(),
                            //exchange = (TradingViewCryptoExchange)Enum.Parse(typeof(TradingViewCryptoExchange), toolStripDropDownButton_exchange.Text, true),
                            //interval = (TradingViewSymbolOverviewInterval)Enum.Parse(typeof(TradingViewSymbolOverviewInterval), toolStripDropDownButton_timespan.Text, true),
                            //tabName = toolStripTextBox_tabName.Text
                        };
                        //LogManager.AddLogMessage(Name, "toolStripButton_add_Click", item.symbol + " | " + item.market + " | " + item.exchange + " | " + item.interval + " | " + item.tabName);
                        //PreferenceManager.TradingViewPreferences.SymbolOverviewParameters.symbols.Add(item);
                        symbolList.Items.Add(item);

                        updateOverviews();
                        listView_symbols.SetObjects(symbolList.Items);
                        //UpdateUI();
                        UpdatePreferenceFile(PreferenceType.Arbitrage);
                        ParentForm.Focus();
                        //Focus();
                    }
                }
            }
            catch (Exception ex)
            {
                LogManager.AddLogMessage(Name, "toolStripButton_add_Click", ex.Message, LogManager.LogMessageType.EXCEPTION);
            }
        }
Exemplo n.º 4
0
        internal void RemoveFloatWindow(FloatWindow floatWindow)
        {
            if (!FloatWindows.Contains(floatWindow))
            {
                return;
            }

            FloatWindows.Remove(floatWindow);

            if (FloatWindows.Count != 0)
            {
                return;
            }
            if (ParentForm == null)
            {
                return;
            }
            ParentForm.Focus();
        }
Exemplo n.º 5
0
 private void ErrorsChanged(List <Error> errors)
 {
     formTbMenu.SetText("");
     if (errors.Count < 1)
     {
         formTbMenu.Hide();
         return;
     }
     foreach (Error err in errors)
     {
         formTbMenu.SetText(formTbMenu.GetText() + Environment.NewLine + (err.Line == -1 ? "--" : err.Line + ".") + $" [{err.Sender}] {err.Message}");
     }
     try
     {
         formTbMenu.Show();
         textBoxMenuToolStripMenuItem.Text = "Hiba lista (F1)";
     }
     catch
     {
         textBoxMenuToolStripMenuItem.Text = "Hiba lista (F1) ...";
     }
     ParentForm.Focus();
 }