Exemplo n.º 1
0
 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}");
             }
         }
     }
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        public RibbonViewsMenu()
        {
            InitializeComponent();

            var views   = ToolsConfig.GetInstance().Views;
            var command = new ContentPanelCommand(ContentPanelModule.RegionManager, PrismRegionNameConstant.CenterRegion);

            ViewsContainer.ItemsSource = RibbonButtonUtility.GenerateRibbonButtons(command, views);
        }
Exemplo n.º 4
0
        public RibbonAddInsMenu()
        {
            InitializeComponent();

            var modules = ToolsConfig.GetInstance().Modules;
            var command = new AddInCommand();

            AddInsContainer.ItemsSource = RibbonButtonUtility.GenerateRibbonButtons(command, modules);
        }
Exemplo n.º 5
0
        public RibbonAddInsMenu()
        {
            InitializeComponent();

            if (!DesignerProperties.GetIsInDesignMode(this))
            {
                var modules = ToolsConfig.GetInstance().Modules;
                var command = new AddInCommand();
                AddInsContainer.ItemsSource = RibbonButtonUtility.GenerateRibbonButtons(command, modules);
            }
        }