static SayingManager() { mConfig = ToolsConfig.GetInstance().Saying; mConfigValuable = Validate(mConfig); if (mConfigValuable) { string connectionString = mConfig.CacheDB.ConnectionString; if (!string.IsNullOrEmpty(connectionString)) { try { if (DataReader.EnsureDBSchemaAsync(connectionString).Result) { mGlobalIndex = DataReader.QuerySayingsIndexFromDB(connectionString); mSayingsCount = DataReader.QuerySayingsCountFromDB(connectionString); mConnectionString = connectionString; mDBValuable = true; } } catch (Exception ex) { mLogger.Error($"Error while validating DB schema:{connectionString}, due to:{ex}"); } } } }
public void Initialize() { RegionManager.RegisterViewWithRegion(PrismRegionNameConstant.ContentRegion, typeof(RibbonUI)); var views = ToolsConfig.GetInstance().Views; IRegion region = RegionManager.Regions[PrismRegionNameConstant.CenterRegion]; RibbonButtonUtility.AddToRegion(UnityContainer, region, views); }
public RibbonViewsMenu() { InitializeComponent(); var views = ToolsConfig.GetInstance().Views; var command = new ContentPanelCommand(ContentPanelModule.RegionManager, PrismRegionNameConstant.CenterRegion); ViewsContainer.ItemsSource = RibbonButtonUtility.GenerateRibbonButtons(command, views); }
public RibbonAddInsMenu() { InitializeComponent(); var modules = ToolsConfig.GetInstance().Modules; var command = new AddInCommand(); AddInsContainer.ItemsSource = RibbonButtonUtility.GenerateRibbonButtons(command, modules); }
public RibbonAddInsMenu() { InitializeComponent(); if (!DesignerProperties.GetIsInDesignMode(this)) { var modules = ToolsConfig.GetInstance().Modules; var command = new AddInCommand(); AddInsContainer.ItemsSource = RibbonButtonUtility.GenerateRibbonButtons(command, modules); } }