예제 #1
0
        private void AfterPluginsLoaded(string specifiedContentType)
        {
            if (!IsNullOrEmpty(specifiedContentType))
            {
                config.DefaultContentType = specifiedContentType;
            }
            else if (IsNullOrEmpty(config.DefaultContentType))
            {
                config.DefaultContentType = MimeTypes.Json;
            }

            Config.PreferredContentTypes.Remove(Config.DefaultContentType);
            Config.PreferredContentTypes.Insert(0, Config.DefaultContentType);

            Config.PreferredContentTypesArray = Config.PreferredContentTypes.ToArray();

            foreach (var plugin in Plugins)
            {
                var preInitPlugin = plugin as IPostInitPlugin;
                if (preInitPlugin != null)
                {
                    try
                    {
                        preInitPlugin.AfterPluginsLoaded(this);
                    }
                    catch (Exception ex)
                    {
                        OnStartupException(ex);
                    }
                }
            }

            ServiceController.AfterInit();
        }
예제 #2
0
        public virtual ServiceStackHost Init()
        {
            Instance = this;

            ServiceController.Init();
            Configure();

            ServiceController.AfterInit();

            return(this);
        }
예제 #3
0
        private void AfterPluginsLoaded(string specifiedContentType)
        {
            if (!String.IsNullOrEmpty(specifiedContentType))
            {
                config.DefaultContentType = specifiedContentType;
            }
            else if (String.IsNullOrEmpty(config.DefaultContentType))
            {
                config.DefaultContentType = MimeTypes.Json;
            }

            ServiceController.AfterInit();
        }
예제 #4
0
        private void AfterPluginsLoaded(string specifiedContentType)
        {
            if (!String.IsNullOrEmpty(specifiedContentType))
            {
                config.DefaultContentType = specifiedContentType;
            }
            else if (String.IsNullOrEmpty(config.DefaultContentType))
            {
                config.DefaultContentType = MimeTypes.Json;
            }

            Config.PreferredContentTypes.Remove(Config.DefaultContentType);
            Config.PreferredContentTypes.Insert(0, Config.DefaultContentType);

            Config.PreferredContentTypesArray = Config.PreferredContentTypes.ToArray();

            ServiceController.AfterInit();
        }