public void DetermineInstalledPanel() { PanelType = PanelTypes.Unknown; SourceDatabase.Provider = DatabaseProviders.Unknown; foreach (var item in variationList) { var installed = item.Item4.isInstalled(); var dbProvider = item.Item4.GetDatabaseProvider(); if (installed && (item.Item2 == dbProvider)) { PanelType = item.Item1; SourceDatabase.Provider = item.Item2; CurrentPanel = item.Item4; SetSourceDatabaseAutomatically(item.Item4); PanelData = item.Item3; var connectionString = SourceDatabase.ConnectionString(); PanelData.LoadConnectionString(connectionString); break; } } }
public void LoadInstalledPanel(PanelTypes panelType, PanelDatabase sourceDatabase) { var variation = variationList.Where(m => m.Item1 == panelType && m.Item2 == sourceDatabase.Provider).FirstOrDefault(); if (variation != null) { PanelType = variation.Item1; CurrentPanel = variation.Item4; PanelData = variation.Item3; PanelData.LoadConnectionString(sourceDatabase.ConnectionString()); } else { throw new Exception(String.Format("Panel not supported: {0} - {1}", panelType, sourceDatabase.Provider)); } }