コード例 #1
0
        public void Configure(IAppHost appHost)
        {
            var mqServer = appHost.Resolve <IMessageService>();

            mqServer.RegisterHandler <TestMq>(appHost.ExecuteMessage);
            appHost.AssertPlugin <SharpPagesFeature>().ScriptMethods.Add(new MqScripts(mqServer));
        }
コード例 #2
0
        public void BeforePluginsLoaded(IAppHost appHost)
        {
            if (ScriptContext == null)
            {
                ScriptContext = appHost.AssertPlugin <SharpPagesFeature>();
            }

            if (!ScriptContext.ScriptLanguages.Contains(ScriptLisp.Language))
            {
                ScriptContext.ScriptLanguages.Add(ScriptLisp.Language);
            }

            if (AllowScriptingOfAllTypes != null)
            {
                ScriptContext.AllowScriptingOfAllTypes = AllowScriptingOfAllTypes.Value;
            }
            if (ScriptAssemblies != null)
            {
                ScriptContext.ScriptAssemblies.AddRange(ScriptAssemblies);
            }
            if (ScriptTypes != null)
            {
                ScriptContext.ScriptTypes.AddRange(ScriptTypes);
            }
            if (ScriptNamespaces != null)
            {
                ScriptContext.ScriptNamespaces.AddRange(ScriptNamespaces);
            }
        }
コード例 #3
0
        public void Register(IAppHost appHost)
        {
            appHost.AssertPlugin <ApplicationsFeature>();
            appHost.AssertPlugin <LanguagesFeature>();

            var container  = appHost.GetContainer();
            var connection = container.Resolve <IDbConnectionFactory>();
            var db         = connection.CreateDbConnection();

            db.Open();
            db.CreateTableIfNotExists <Translation>();
            Permissions.All.AddRange(TranslationPermissions.All);

            StackXAppHostBase.ExcludedAutoCrudTypes.Remove(typeof(UpdateTranslation));
            StackXAppHostBase.ExcludedAutoCrudTypes.Remove(typeof(DeleteTranslation));
            StackXAppHostBase.ExcludedAutoQueryTypes.Remove(typeof(QueryTranslations));
            StackXAppHostBase.ExcludedAutoCrudTypes.Remove(typeof(CreateTranslation));
            StackXAppHostBase.ExcludedAutoCrudTypes.Remove(typeof(CreateMissingTranslation));
            appHost.ServiceController.RegisterService(typeof(TranslationService));
        }
コード例 #4
0
        public void Configure(IAppHost appHost)
        {
            //Register required plugins if not registered already
            appHost.Plugins.AddIfNotExists(new ValidationFeature());
            appHost.Plugins.AddIfNotExists(new SharpPagesFeature());
            appHost.AssertPlugin <SharpPagesFeature>().ScriptMethods.Add(new ContactScripts());

            // Register Custom Auto Mapping for converting Contact Data Model to Contact DTO
            AutoMapping.RegisterConverter((Data.Contact from) =>
                                          from.ConvertTo <ServiceModel.Types.Contact>(skipConverters: true));
        }
コード例 #5
0
        public void Register(IAppHost appHost)
        {
            appHost.AssertPlugin <ApplicationsFeature>();

            var container  = appHost.GetContainer();
            var connection = container.Resolve <IDbConnectionFactory>();
            var db         = connection.CreateDbConnection();

            db.Open();
            db.CreateTableIfNotExists <Taxonomy>();

            if (!db.ColumnExists <Taxonomy>(t => t.Meta))
            {
                db.AddColumn <Taxonomy>(t => t.Meta);
            }

            Permissions.All.AddRange(TaxonomyPermissions.All);
            StackXAppHostBase.ExcludedAutoCrudTypes.Remove(typeof(UpdateTaxonomy));
            StackXAppHostBase.ExcludedAutoCrudTypes.Remove(typeof(DeleteTaxonomy));
            StackXAppHostBase.ExcludedAutoQueryTypes.Remove(typeof(QueryTaxonomies));
            StackXAppHostBase.ExcludedAutoCrudTypes.Remove(typeof(CreateTaxonomy));
        }
コード例 #6
0
 public void BeforePluginsLoaded(IAppHost appHost)
 {
     appHost.AssertPlugin <AuthFeature>().AuthEvents.Add(new AppUserAuthEvents());
 }
コード例 #7
0
 public void Configure(IAppHost appHost)
 {
     appHost.AssertPlugin <SharpPagesFeature>().ScriptMethods.Add(new UserAuthScripts());
 }