Esempio n. 1
0
        public override async Task <IWebHost> Start(Application app, StartServerOptions options)
        {
            var connections = app.GetPublished().Connections;

            connections.StaleCollectionInterval = DefaultTimerInterval;
            connections.StaleExpirationInterval = DefaultExpireInterval;
            var host = await base.Start(app, options);

            LaraUI.LaunchBrowser(host);
            return(host);
        }
Esempio n. 2
0
        internal static bool VerifyType(string tagName, Type componentType, out string error)
        {
            if (!LaraUI.TryGetComponent(tagName, out var type))
            {
                error = $"The tag '{tagName}' is not registered as web component. To register a webcomponent, either (1) decorate it with [LaraWebComponent] and run LaraUI.PublishAssemblies(), or (2) use LaraUI.Publish().";
                return(false);
            }

            if (type != componentType)
            {
                error = $"The tag '{tagName}' is registered with the type '{type.FullName}' and not '{componentType.FullName}'.";
                return(false);
            }
            error = string.Empty;
            return(true);
        }
Esempio n. 3
0
 private static bool FindTagName(string tagName, [NotNullWhen(true)] out Type?type)
 {
     return(_Map.TryGetValue(tagName, out type) ||
            LaraUI.TryGetComponent(tagName, out type));
 }