Skip to content

Commit

Permalink
fix list of provider at first run
Browse files Browse the repository at this point in the history
  • Loading branch information
LiorBanai committed Feb 13, 2021
1 parent 0678337 commit 8bb6c8c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Analogy/Forms/FirstTimeRunForm.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using DevExpress.XtraEditors;
using Analogy.DataTypes;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Analogy.DataTypes;
using DevExpress.XtraEditors.Controls;

namespace Analogy.Forms
{
Expand All @@ -22,23 +22,25 @@ public FirstTimeRunForm()
// This line of code is generated by Data Source Configuration Wizard
}

private void FirstTimeRunForm_Load(object sender, EventArgs e)
private async void FirstTimeRunForm_Load(object sender, EventArgs e)
{
if (DesignMode)
{
return;
}

Icon = UserSettingsManager.UserSettings.GetIcon();
await FactoriesManager.Instance.InitializeBuiltInFactories();
await FactoriesManager.Instance.AddExternalDataSources();
chkLstDataProviderStatus.CustomizeItem += (s, e) =>
{
FactoryCheckItem bind = (FactoryCheckItem)e.Value;
e.TemplatedItem.Elements[0].ImageOptions.Image = bind.Image;
e.TemplatedItem.Elements[1].Text = $"{bind.Name} (id:{bind.ID})";
e.TemplatedItem.Elements[2].Text = bind.Description;
};
chkLstDataProviderStatus.ItemCheck+=(s,e) => SaveSettings();
chkLstDataProviderStatus.ItemCheck += (s, e) => SaveSettings();

foreach (var setting in Settings.FactoriesOrder)
{
FactorySettings factory = Settings.GetFactorySetting(setting);
Expand Down

0 comments on commit 8bb6c8c

Please sign in to comment.