コード例 #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
ファイル: HandlerConvention.cs プロジェクト: moacap/fubumvc
        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
ファイル: ConfigGraph.cs プロジェクト: xeno3/fubumvc
        // 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
ファイル: ConfigGraph.cs プロジェクト: kingreatwill/fubumvc
        // 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;
        }
コード例 #6
0
        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>();
            });
        }
コード例 #7
0
        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);
        }
コード例 #9
0
 public override void Describe(Description description)
 {
     description.Title = "FubuRegistry:  " + _registry.GetType().Name;
     description.Children["Registry"] = Description.For(_registry);
 }