Ejemplo n.º 1
0
        public void Initialize(InitializationEngine context)
        {
            ConfigurationContext.Setup(_ =>
            {
                _.DiagnosticsEnabled = true;
                _.ModelMetadataProviders.EnableLegacyMode = () => true;
                _.CustomAttributes = new[]
                {
                    new CustomAttributeDescriptor(typeof(HelpTextAttribute), false)
                };

                _.ForeignResources.Add(typeof(VersionStatus));
                _.EnableInvariantCultureFallback = true;
                _.DefaultResourceCulture         = CultureInfo.InvariantCulture;
                _.CacheManager.OnRemove         += CacheManagerOnOnRemove;
                _.PopulateCacheOnStartup         = false;
            });

            UiConfigurationContext.Setup(_ =>
            {
                //_.DefaultView = ResourceListView.Tree;
                _.TreeViewExpandedByDefault = true;
                _.ShowInvariantCulture      = true;

                //_.AuthorizedAdminRoles.Clear();
                _.AuthorizedAdminRoles.Add("SomeFancyAdminRole");

                //_.AuthorizedEditorRoles.Clear();
                _.AuthorizedEditorRoles.Add("SomeFancyEditorRole");

                //_.DisableView(ResourceListView.Table);
            });
        }
 public AdminUIViewModel(
     ConfigurationContext configurationContext,
     UiConfigurationContext uiContext,
     IQueryExecutor queryExecutor,
     ICommandExecutor commandExecutor)
     : base(configurationContext, uiContext, queryExecutor, commandExecutor)
 {
 }
Ejemplo n.º 3
0
        public void Initialize(InitializationEngine context)
        {
            ConfigurationContext.Setup(cfg =>
            {
                cfg.DiagnosticsEnabled = true;
                cfg.ModelMetadataProviders.EnableLegacyMode = () => true;
                cfg.CustomAttributes = new[]
                {
                    new CustomAttributeDescriptor(typeof(HelpTextAttribute), false)
                };

                cfg.ForeignResources.Add(typeof(VersionStatus));

                cfg.CacheManager.OnRemove += CacheManagerOnOnRemove;
            });

            UiConfigurationContext.Setup(cfg =>
            {
                cfg.DefaultView = ResourceListView.Tree;
                cfg.TreeViewExpandedByDefault = true;
            });
        }
        public void Initialize(InitializationEngine context)
        {
            ConfigurationContext.Setup(_ =>
            {
                _.DiagnosticsEnabled = true;
                _.EnableLegacyMode   = () => true;
                _.CustomAttributes   = new[] { new CustomAttributeDescriptor(typeof(HelpTextAttribute), false) };

                _.ForeignResources.Add(typeof(VersionStatus));
                _.EnableInvariantCultureFallback = true;
                _.DefaultResourceCulture         = CultureInfo.InvariantCulture;
                _.CacheManager.OnRemove         += CacheManagerOnOnRemove;
                _.PopulateCacheOnStartup         = false;

                _.FallbackCultures.When(new CultureInfo("en-ZA"))
                .Try(new CultureInfo("no"));

                // manually register some resources
                _.ManualResourceProvider = new SomeManualResources();
            });

            UiConfigurationContext.Setup(_ =>
            {
                //_.DefaultView = ResourceListView.Tree;
                _.TreeViewExpandedByDefault = true;
                _.ShowInvariantCulture      = true;
                //_.AuthorizedAdminRoles.Clear();
                _.AuthorizedAdminRoles.Add("SomeFancyAdminRole");
                //_.AuthorizedEditorRoles.Clear();
                _.AuthorizedEditorRoles.Add("SomeFancyEditorRole");
                //_.DisableView(ResourceListView.Table);
                _.DisableRemoveTranslationButton = false;
                _.Events.OnNewResourceCreated   += OnNewResourceCreated;
                _.HideDeleteButton = false;
            });
        }