GetBindingSource() public method

public GetBindingSource ( ) : System.Windows.Forms.BindingSource
return System.Windows.Forms.BindingSource
Exemplo n.º 1
0
        private void LogWindow_Load(object sender, System.EventArgs e)
        {
            TaskInProgressIcon = new Icon(typeof(Icons.IconTypePlaceholder), "view-calendar-tasks-combined.ico");
            NoTaskActiveIcon   = new Icon(typeof(Icons.IconTypePlaceholder), "edit-clear-history-2-combined.ico");

            TaskHotKey                = new Hotkey();
            TaskHotKey.WindowsKey     = true;
            TaskHotKey.Ctrl           = true;
            TaskHotKey.KeyCode        = System.Windows.Forms.Keys.T;
            TaskHotKey.HotkeyPressed += new EventHandler(TaskHotKey_HotkeyPressed);
            try
            {
                TaskHotKey.Enabled = true;
            }
            catch (ManagedWinapi.HotkeyAlreadyInUseException)
            {
                //TODO: Make this an option, and simply disable if fail on start/load.
                // -> any error to be displayed should be displayed in real-time on options screen, in a special popup.
                // -> use ManagedWinapi.ShortcutBox
            }

            if (!Properties.Settings.Default.UpgradeCompleted)
            {
                Properties.Settings.Default.Upgrade();
                Properties.Settings.Default.UpgradeCompleted = true;
                Properties.Settings.Default.Save();
                //TODO: Add data migration too.
                //TODO: ADD Confirmation window asking about deleting previous settings, if there was really an upgrade
            }

            _databaseManager = new DatabaseManager();
            _databaseManager.LoadDatabase();
            _databaseManager.ReadAutoCompletionDataFromDB();
            TaskDialog.AutoCompletionCache      = _databaseManager.AutoCompletionCache;
            dataSet1BindingSource               = _databaseManager.GetBindingSource();
            dataGridView_TaskLogList.DataSource = dataSet1BindingSource;

            dateNavigator_LogFilter.DateValue = DateTime.Today;

            UpdateControlDisplayConsistency(); //set initial display filter, etc (will be called again in updatestate)
            UpdateStateFromData(true);
        }
Exemplo n.º 2
0
        private void LogWindow_Load(object sender, System.EventArgs e)
        {
            TaskInProgressIcon = new Icon(typeof(Icons.IconTypePlaceholder), "view-calendar-tasks-combined.ico");
            NoTaskActiveIcon = new Icon(typeof(Icons.IconTypePlaceholder), "edit-clear-history-2-combined.ico");

            TaskHotKey = new Hotkey();
            TaskHotKey.WindowsKey = true;
            TaskHotKey.Ctrl = true;
            TaskHotKey.KeyCode = System.Windows.Forms.Keys.T;
            TaskHotKey.HotkeyPressed += new EventHandler(TaskHotKey_HotkeyPressed);
            try
            {
                TaskHotKey.Enabled = true;
            }
            catch (ManagedWinapi.HotkeyAlreadyInUseException)
            {
                //TODO: Make this an option, and simply disable if fail on start/load.
                // -> any error to be displayed should be displayed in real-time on options screen, in a special popup.
                // -> use ManagedWinapi.ShortcutBox
            }

            if (!Properties.Settings.Default.UpgradeCompleted)
            {
                Properties.Settings.Default.Upgrade();
                Properties.Settings.Default.UpgradeCompleted = true;
                Properties.Settings.Default.Save();
                //TODO: Add data migration too.
                //TODO: ADD Confirmation window asking about deleting previous settings, if there was really an upgrade
            }

            _databaseManager = new DatabaseManager();
            _databaseManager.LoadDatabase();
            _databaseManager.ReadAutoCompletionDataFromDB();
            TaskDialog.AutoCompletionCache = _databaseManager.AutoCompletionCache;
            dataSet1BindingSource = _databaseManager.GetBindingSource();
            dataGridView_TaskLogList.DataSource = dataSet1BindingSource;

            dateNavigator_LogFilter.DateValue = DateTime.Today;

            UpdateControlDisplayConsistency(); //set initial display filter, etc (will be called again in updatestate)
            UpdateStateFromData(true);
        }