Beispiel #1
0
        internal void SymbolsListsUpdate()
        {
            Action action = new Action(
                () =>
            {
                SymbolsListTBox.Clear();

                for (int i = 0; i < symbolsList.Count; i++)
                {
                    if (!string.IsNullOrWhiteSpace(symbolsList[i]))
                    {
                        SymbolsListTBox.Text += symbolsList[i] + "\n";
                        SymbolsListTBox.Select(SymbolsListTBox.Text.Length, SymbolsListTBox.Text.Length);
                    }
                }
            });

            try
            {
                if (Program.MainForm.IsHandleCreated)
                {
                    Invoke(action);
                }
            }
            catch (ObjectDisposedException)
            {
                // User closed the form
            }
        }
Beispiel #2
0
 private void ClearSymbolsListBtn_Click(object sender, EventArgs e)
 {
     symbolsList = new List <string>();
     SymbolsListTBox.Clear();
 }