private async void timer1_Tick(object sender, EventArgs e)
        {
            using (var mgr = new DesignAlternativesOptionsManager(new DesignAlternativesContext()))
            {
                var allCategories = await mgr.GetAllCategories();

                if (_resetData || allCategories.Count < 1)
                {
                    try
                    {
                        await mgr.ResetData();

                        _resetData = false;
                        return;
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message, "AD-DSS", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        DialogResult = DialogResult.Abort;
                    }
                }
                else
                {
                    DialogResult = DialogResult.OK;
                }
            }
        }
Beispiel #2
0
 private async void frmSettings_Load(object sender, EventArgs e)
 {
     categoryBindingSource.DataSource = await dbMgr.GetAllCategories();
 }