public UserAdapter CreateUserAdapter(IUserPlugin plugin = null)
        {
            if (plugin == null)
            {
                plugin = this.CreateUserPlugin();
            }

            return(new UserAdapter(plugin));
        }
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            UserServiceFactory userServiceFactory = new UserServiceFactory();
            IUserPlugin        userPlugin         = userServiceFactory.CreateUserPlugin("mysql");
            UserAdapter        userAdapter        = userServiceFactory.CreateUserAdapter(userPlugin);
            UserService        userService        = userServiceFactory.CreateUserService(userAdapter);

            services.AddSingleton <IUserService>(s => userService);
            services.AddRazorPages();
        }
Example #3
0
        ///// Constructor /////

        public ConfigManager(IUserPlugin plugin)
        {
            _plugin     = plugin;
            _configPath = Path.Combine(plugin.Descriptor.Directory, "Data", "Config.ini");

            if (!File.Exists(_configPath))
            {
                _config = new Configuration();
            }
            else
            {
                _config = Configuration.LoadFromFile(_configPath);
            }
        }
Example #4
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            UserServiceFactory userServiceFactory = new UserServiceFactory();
            IUserPlugin        userPlugin         = userServiceFactory.CreateUserPlugin("mysql");
            UserAdapter        userAdapter        = userServiceFactory.CreateUserAdapter(userPlugin);
            UserService        userService        = userServiceFactory.CreateUserService(userAdapter);

            BlabServiceFactory blabServiceFactory = new BlabServiceFactory();
            IBlabPlugin        blabPlugin         = blabServiceFactory.CreateBlabPlugin("MYSQL");
            BlabAdapter        blabAdapter        = blabServiceFactory.CreateBlabAdapter(blabPlugin);
            BlabService        blabService        = blabServiceFactory.CreateBlabService(blabAdapter);

            services.AddSingleton <IUserService>(s => userService);
            services.AddSingleton <IBlabService>(s => blabService);
            services.AddRazorPages();
        }
Example #5
0
 public UserAdapter(IUserPlugin plugin)
 {
     _plugin = plugin;
 }
Example #6
0
 protected abstract void _UnloadPlugin(IUserPlugin plugin);
Example #7
0
 protected override void _UnloadPlugin(IUserPlugin plugin)
 {
     plugin.Unload();
 }
Example #8
0
 public UserAdapter(IUserPlugin plugin)
 {
     this.plugin = plugin;
 }