Пример #1
0
        protected override void OnDoWork(DoWorkEventArgs e)
        {
            UserInputWindow uiw = new UserInputWindow();

            uiw.ShowDialog();

            //uiw.

            e.Result = "";
        }
Пример #2
0
        /// <summary>
        /// Add a column or columnd to the table
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddColumn_Click(object sender, RoutedEventArgs e)
        {
            UserInputWindow Uiw = new UserInputWindow("Enter column names");

            if (Uiw.ShowDialog() == true)
            {
                Log.Timer.Start();

                // get one or more strings from our generic user input dialog
                List <string> NewColumnNames = new List <string>(Uiw.Inputs);

                // call sqlite to alter table add column
                Db.Connect.AddColumns(this.TableName, NewColumnNames);

                // update the field names as displayed
                // the combobox of field names is bound to this list
                Dgv.FieldNamesAsDisplayed.AddRange(NewColumnNames);

                // until we undersand binding a little better....
                this.cmboFunctionField.ItemsSource = null;
                this.cmboFunctionField.ItemsSource = Dgv.FieldNamesAsDisplayed;

                this.cmboFunctionField.SelectedIndex = 0;
                // call sort to refresh the gridview
                this.Dgv.Sort(this.dgData, 0);

                Status("Added column"
                       + (NewColumnNames.Count == 1 ? "s " : " ")
                       + string.Join(", ", NewColumnNames)
                       + " to table "
                       + Dgv.TableName
                       + ". (" + Log.Timer.ElapsedTime().ToString()
                       + ")"
                       );
            }
        }