using CefSharp.DevTools.CSS; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using TradeIdeas.MiscSupport; using TradeIdeas.TIProData.Configuration; using TradeIdeas.TIProGUI; using TradeIdeas.XML; namespace TradeIdeas.TIProGUI { public partial class MissingSymbolCheckFormChooser : Form { private const float DEFAULT_FONT_SIZE = 8.25F; private FontManager _fontManager; private SymbolLookupB _symbolLookup; public MissingSymbolCheckFormChooser(Form form) { InitializeComponent(); _fontManager = new FontManager(this, DEFAULT_FONT_SIZE); _fontManager.selectTheFont(); Font = GuiEnvironment.FontSettings; GuiEnvironment.DefaultIcon.SetIcon(this, false); StartPosition = FormStartPosition.CenterParent; SetDatetimePickersDisplayFormat(GuiEnvironment.DateTimePickerFormat); string apiURL = GuiEnvironment.AppConfig.Node("SYMBOL_LOOKUP").Property("API_URL", ""); int symbolLimit = GuiEnvironment.AppConfig.Node("SYMBOL_LOOKUP").Property("SYMBOL_LIMIT", -1); int keystrokePause = GuiEnvironment.AppConfig.Node("SYMBOL_LOOKUP").Property("KEYSTROKE_PAUSE", -1); _symbolLookup = new SymbolLookupTextBox() { ApiUrl = apiURL, SymbolLimit = symbolLimit, KeyStrokePause = keystrokePause, FontSize = this.Font.SizeInPoints, TextBoxFont = Font, }; this.Controls.Add(_symbolLookup); _symbolLookup.Top = SymbolLabel.Top - 2; _symbolLookup.Left = SymbolLabel.Right; _symbolLookup.Size = new Size(60, 20); _symbolLookup.Margin = new Padding(3, 3, 3, 3); _symbolLookup.AutoSetHeight(); _symbolLookup.symbolSelected += SetSymbol; SetSymbol("SPY"); checkedListBox1.Items.Clear(); checkBoxFiltersToColumns.Hide(); checkBoxRunHistory.Hide(); // Set end time to the pre market start time using user's time zone. dateTimePickerEndTime.Value = GuiEnvironment.GetPreMarketStartLocalTime(ServerFormats.Now); checkBoxRunHistory.Checked = true; if (!form.IsDisposed) { AlertForm alertForm = form as AlertForm; if (null != alertForm) { checkedListBox1.Items.Add(alertForm.GetWindowName()); _allForms.Add(form); checkedListBox1.SetItemChecked(0, true); _setAlertControls(); } MultiStrategy multiStrategyForm = form as MultiStrategy; if (null != multiStrategyForm) { foreach (var strategy in multiStrategyForm.MultiStrategyConfiguration.Strategies) { if (strategy.Config != null) { var index = checkedListBox1.Items.Add(strategy.Name); StrategyConfig strategyConfig; strategyConfig.Config = strategy.Config; strategyConfig.ConfigurationType = ConfigurationType.Alerts; _strategyConfigs.Add(strategyConfig); } } _allForms.Add(form); checkBoxFiltersToColumns.Top = dateTimePickerEndTime.Top; } } } private void _setAlertControls() { this.Height = this.Height - checkedListBox1.Height; _symbolLookup.Top = SymbolLabel.Top - 2; checkedListBox1.Hide(); } private void SetSymbol(string symbol) { if (symbol != null) { _symbolLookup.SetSymbol(symbol); } } public MissingSymbolCheckFormChooser() { InitializeComponent(); LoadOpenForms(); checkedListBox1.CheckOnClick = true; } public void SetDatetimePickersDisplayFormat(string format) { dateTimePickerStartTime.CustomFormat = format; dateTimePickerEndTime.CustomFormat = format; } private List