Esempio n. 1
0
        public void Configure(IBlazorApplicationBuilder app, WebsitesContext context)
        {
            //Populate initial data
            context.SeedData().GetAwaiter().GetResult();

            app.AddComponent <App>("app");
        }
Esempio n. 2
0
 public void Configure(IBlazorApplicationBuilder app)
 {
     JSRuntime.Current.InvokeAsync <string[]>("navigatorLanguages")
     .ContinueWith(t => CultureInfo.DefaultThreadCurrentCulture = t.Result.Select(c => CultureInfo.GetCultureInfo(c)).FirstOrDefault())
     ;
     app.AddComponent <App>("app");
 }
Esempio n. 3
0
        public async void Configure(IBlazorApplicationBuilder app)
        {
            app.AddComponent <App>("app");

            log4net.Repository.Hierarchy.Hierarchy hierarchy =
                (Hierarchy)log4net.LogManager.GetRepository(Assembly.GetAssembly(typeof(Startup)));

            PatternLayout patternLayout = new PatternLayout();

            patternLayout.ConversionPattern = "%date [%thread] %-5level %logger - %message%newline";
            patternLayout.ActivateOptions();

            var cca = new ConsoleAppender();

            cca.Layout = patternLayout;
            cca.ActivateOptions();
            hierarchy.Root.AddAppender(cca);

            hierarchy.Root.Level = Level.Debug;
            hierarchy.Configured = true;

            log.Info("test");

            log.Info("Configure Done");
        }
Esempio n. 4
0
        public void Configure(IBlazorApplicationBuilder app, IServiceProvider services)
        {
            try
            {
                var method = GetConfigureMethod();
                Debug.Assert(method != null);

                var parameters = method.GetParameters();
                var arguments  = new object[parameters.Length];
                for (var i = 0; i < parameters.Length; i++)
                {
                    var parameter = parameters[i];
                    arguments[i] = parameter.ParameterType == typeof(IBlazorApplicationBuilder)
                        ? app
                        : services.GetRequiredService(parameter.ParameterType);
                }

                method.Invoke(Instance, arguments);
            }
            catch (Exception ex)
            {
                if (ex is TargetInvocationException)
                {
                    ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
                }

                throw;
            }
        }
Esempio n. 5
0
        public void Configure(IBlazorApplicationBuilder app, BlazorDbContext db)
        {
            app.AddComponent <App>("app");

            // ensure db is created and up to date
            db.Database.Migrate();
        }
Esempio n. 6
0
        public void Configure(IBlazorApplicationBuilder app)
        {
            // Technically you should be able to change "app" with something else
            // renaming the <app> injection point in index.html as well. But as of now (0.5.0)
            // it compiles but won't actually work as expected.

            app.AddComponent <MyApp>("app");
        }
Esempio n. 7
0
 public void Configure(IBlazorApplicationBuilder app)
 {
     JSRuntime.Current.InvokeAsync <object>("ZoraGen.doneLoading");
     app.Services.GetService <IZoraGenDetails>().InitAsync(
         app.Services.GetService <ILocalStorage>()
         );
     app.AddComponent <App>("app");
 }
Esempio n. 8
0
 public static IBlazorApplicationBuilder UseBingMaps(
     this IBlazorApplicationBuilder applicationBuilder,
     string apiKey,
     string mapLanguage = null)
 {
     JSRuntime.Current.InvokeAsync <object>("rpedrettiBlazorComponents.bingMaps.initScript", apiKey, mapLanguage);
     return(applicationBuilder);
 }
Esempio n. 9
0
        public void Configure(IBlazorApplicationBuilder app)
        {
            var cultureInfo = new CultureInfo("en-US");

            CultureInfo.DefaultThreadCurrentCulture   = cultureInfo;
            CultureInfo.DefaultThreadCurrentUICulture = cultureInfo;

            app.AddComponent <App>("app");
        }
Esempio n. 10
0
        public void Configure(IBlazorApplicationBuilder app)
        {
            // Possible to add a component of your choice here.
            // Note that a full htmlless component is still difficult to support
            // given the fact that the Router needs a cshtml injectable property
            // to set the assembly to search when routing requests.......
            // app.AddComponent<App>("app");

            app.AddComponent <Main>("app");
        }
Esempio n. 11
0
        public void Configure(IBlazorApplicationBuilder app)
        {
            app.AddComponent <App>("app");

            // Sets Blazor's message handler into Flurl, this fixes a Blazor linker problem
            // https://stackoverflow.com/questions/52522004/blazor-0-6-0-wipes-flurl-compatibility
            FlurlHttp.Configure(settings =>
            {
                settings.HttpClientFactory = new HttpClientFactoryForBlazor();
            });
        }
Esempio n. 12
0
        public void Configure(IBlazorApplicationBuilder app)
        {
            if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("WEBASSEMBLY")))
            {
                // Needed because the test server runs on a different port than the client app,
                // and we want to test sending/receiving cookies underling this config
                WebAssemblyHttpMessageHandler.DefaultCredentials = FetchCredentialsOption.Include;
            }

            app.AddComponent <Index>("root");
        }
Esempio n. 13
0
        public static IBlazorApplicationBuilder UseDefaultStyles(this IBlazorApplicationBuilder builder)
        {
            var fontEngine = builder.Services.GetService <IFontEngine>();

            if (fontEngine is null)
            {
                throw new InvalidOperationException(AddSerficesErrorMessage);
            }
            var fabricConfig = builder.Services.GetService <IFabricConfig>();

            if (fabricConfig is null)
            {
                throw new InvalidOperationException(AddSerficesErrorMessage);
            }
            var baseUrl = fabricConfig?.FontBaseUrl != null ? fabricConfig.FontBaseUrl : FontEngine.DefaultBaseUrl;

            fontEngine.RegisterDefaultFontFaces(baseUrl);
            return(builder);
        }
 public void Configure(IBlazorApplicationBuilder app)
 {
     app.AddComponent <App>("app");
     // app.UseCors(builder => builder.WithOrigins("http://www.jkanawall.net", "http://localhost"));
 }
 public void Configure(IBlazorApplicationBuilder app)
 {
     app.AddComponent <App>("app");
     //app.UseStaticFiles();
 }
Esempio n. 16
0
 public void Configure(IBlazorApplicationBuilder app) => app.AddComponent <App>(nameof(app));
Esempio n. 17
0
 public void Configure(IBlazorApplicationBuilder app, IServiceProvider services)
 {
     ConfigureCalled = true;
 }
Esempio n. 18
0
        public void Configure(IBlazorApplicationBuilder app)
        {
            BrowserHttpMessageHandler.DefaultCredentials = FetchCredentialsOption.Omit;

            app.AddComponent <App>("app");
        }
Esempio n. 19
0
 public void Configure(IBlazorApplicationBuilder app)
 {
     app.AddComponent <Main>("body");
 }
Esempio n. 20
0
 public void Configure(IBlazorApplicationBuilder app)
 {
     app.AddComponent <EmptyStarterTemplate.App.App>("app");
 }
Esempio n. 21
0
 public void Configure(IBlazorApplicationBuilder blazorApplicationBuilder)
 {
     blazorApplicationBuilder.AddComponent <MyApp>("myApp");
 }
Esempio n. 22
0
 /// <summary>
 /// Associates the component type with the application,
 /// causing it to be displayed in the specified DOM element.
 /// </summary>
 /// <param name="app">The <see cref="IBlazorApplicationBuilder"/>.</param>
 /// <typeparam name="TComponent">The type of the component.</typeparam>
 /// <param name="domElementSelector">A CSS selector that uniquely identifies a DOM element.</param>
 public static void AddComponent <TComponent>(this IBlazorApplicationBuilder app, string domElementSelector)
     where TComponent : IComponent
 {
     app.AddComponent(typeof(TComponent), domElementSelector);
 }
Esempio n. 23
0
 public void Configure(IBlazorApplicationBuilder app)
 {
     app.AddComponent <App>("app");
     ((IJSInProcessRuntime)JSRuntime.Current).Invoke <bool>("_blazorXstartup.dnSetReady");
 }
Esempio n. 24
0
 public void Configure(IBlazorApplicationBuilder _) => _.AddComponent(typeof(Home), "app");
Esempio n. 25
0
 public void Configure(IBlazorApplicationBuilder app)
 {
     app.AddComponent <Pages.IssueMover>("app");
 }
Esempio n. 26
0
 public void Configure(IBlazorApplicationBuilder app)
 {
     app.UseNObservable();
     app.AddComponent <App>("app");
 }
Esempio n. 27
0
 public void Configure(IBlazorApplicationBuilder app, string foo)
 {
     Arguments.Add(app);
     Arguments.Add(foo);
 }
Esempio n. 28
0
 public void Configure(IBlazorApplicationBuilder app)
 {
     app.AddComponent <App>("app");
     app.UseBingMaps("AkUyQ5km3V0tUHk_BL1gRFWunbT1x6dlbH_0mUHDREAHPgsJ1LlpS0ma2-0SIvV7");
 }
Esempio n. 29
0
 public void Configure(IBlazorApplicationBuilder app)
 {
     app.AddComponent <App>("app");
 }
Esempio n. 30
0
 public void Configure(IBlazorApplicationBuilder app)
 {
     app.AddComponent <App>("app");
     app.InitAmbientLightSensor();
 }