Пример #1
0
        public void StartUp()
        {
            try
            {
                _server = _registry.ToRuntime();

                GlobalMessageTracking.SendMessage(new ApplicationStarted
                {
                    ApplicationName = _registry.GetType().Name,
                    HomeAddress     = _server.BaseAddress,
                    Timestamp       = DateTime.Now,
                    Watcher         = _server.Get <AssetSettings>().CreateFileWatcherManifest(_server.Files)
                });
            }
            catch (HostingFailedException e)
            {
                GlobalMessageTracking.SendMessage(new InvalidApplication
                {
                    ExceptionText = e.Message,
                    Message       = "Access denied."
                });
            }
            catch (Exception e)
            {
                GlobalMessageTracking.SendMessage(new InvalidApplication
                {
                    ExceptionText = e.ToString(),
                    Message       = "Bootstrapping {0} Failed!".ToFormat(_registry.GetType().Name)
                });
            }
        }
Пример #2
0
        public void Configure(FubuRegistry registry)
        {
            registry.Services(x =>
            {
                x.Scan(y =>
                {
                    y.Applies.ToAllPackageAssemblies();
                    y.Applies.ToThisAssembly();
                    y.Applies.ToAssemblyContainingType(registry.GetType());
                    y.Applies.ToAssemblyContainingType <ICmsEndpoint>();

                    y.AddAllTypesOf <ICmsComponent>();
                    y.AddAllTypesOf <ICmsEndpoint>();
                    y.AddAllTypesOf <ITheme>();
                    y.AddAllTypesOf <ICmsViewEngine>();
                    y.AddAllTypesOf <ITextParser>();
                    y.AddAllTypesOf <IParseModelExpression>();

                    y.ConnectImplementationsToTypesClosing(typeof(ICmsRenderer <>));
                });

                x.SetServiceIfNone <ICmsRenderer, DefaultCmsRenderer>();
                x.SetServiceIfNone <IFindParameterValueFromModel, DefaultParameterValueFinder>();
                x.SetServiceIfNone <ITemplateStorage, DefaultTemplateStorage>();
            });

            registry.Policies.Add <ConfigureWidgetBehaviorChain>();
        }
Пример #3
0
        void IFubuRegistryExtension.Configure(FubuRegistry registry)
        {
            IEnumerable <Type> markers = _markerTypes.Any()
                                            ? _markerTypes
                                            : new Type[] { registry.GetType() };

            markers.Each(t => registry.Applies.ToAssembly(t.Assembly));

            var source = new HandlerActionSource(markers);

            registry.Routes.UrlPolicy(PolicyBuilder(markers.ToArray()));

            registry.Actions.FindWith(source);
        }
Пример #4
0
        // Tested through the FubuRegistry.BuildLocal()
        public bool HasImported(FubuRegistry registry)
        {
            if (_imports.Any(x => x.Registry.GetType() == registry.GetType()))
            {
                return(true);
            }

            if (_imports.Any(x => x.Registry.Config.HasImported(registry)))
            {
                return(true);
            }

            return(false);
        }
Пример #5
0
        // Tested through the FubuRegistry.BuildLocal()
        public bool HasImported(FubuRegistry registry)
        {
            if (_imports.Any(x => x.Registry.GetType() == registry.GetType()))
            {
                return true;
            }

            if (_imports.Any(x => x.Registry.Config.HasImported(registry)))
            {
                return true;
            }

            return false;
        }
        public void Configure(FubuRegistry registry)
        {
            registry.Services(x =>
            {
                x.Scan(y =>
                {
                    y.Applies.ToAllPackageAssemblies();
                    y.Applies.ToThisAssembly();
                    y.Applies.ToAssemblyContainingType(registry.GetType());

                    y.AddAllTypesOf <IBuildMenuTree>();
                });

                x.SetServiceIfNone <IBuildMenu, DefaultMenuBuilder>();
            });
        }
        public void Configure(FubuRegistry registry)
        {
            registry.Services(x =>
            {
                x.SetServiceIfNone <ILocalizeText, DefaultTextLocalizer>();
                x.SetServiceIfNone <IFindCurrentLocalizationNamespace, DefaultLocalizationNamespaceFinder>();

                x.Scan(y =>
                {
                    y.Applies.ToAllPackageAssemblies();
                    y.Applies.ToThisAssembly();
                    y.Applies.ToAssemblyContainingType(registry.GetType());
                    y.Applies.ToAssemblyContainingType <ILocalizationVisitor>();

                    y.AddAllTypesOf <ILocalizationVisitor>();
                });
            });
        }
Пример #8
0
        void IFubuRegistryExtension.Configure(FubuRegistry registry)
        {
            IEnumerable <Type> markers = _markerTypes.Any()
                                                                                        ? _markerTypes
                                                                                        : new Type[] { registry.GetType() };

            var source = new HandlerActionSource(markers);

            registry.AlterSettings <UrlPolicies>(urls =>
            {
                urls.Policies.Insert(0, PolicyBuilder(markers.ToArray()));
            });
            registry.Actions.FindWith(source);
        }
 public override void Describe(Description description)
 {
     description.Title = "FubuRegistry:  " + _registry.GetType().Name;
     description.Children["Registry"] = Description.For(_registry);
 }