Ejemplo n.º 1
0
        public bool Initialize(Context context)
        {
            _context = context;

            // It is the responsibility of the App controller to update context
            // with the self reference.
            _context.Controller = this;

            return true;
        }
Ejemplo n.º 2
0
 public void Initialize(Context context, ScriptingContext scriptContext)
 {
     _context = context;
     _scriptContext = scriptContext;
     _scriptContext.OnTaskReceive = this.AddTask;
     _scriptContext.OnSyncTask = this.ExecuteTask;
     _scriptContext.OnCodeInject = this.GetCodeToInject;
     _api = Activator.CreateInstance(_context.Config.ApiProviderType) as IApiProvider;
     _api.RegisterAvailableModules(_context);
     this.Start();
 }
Ejemplo n.º 3
0
        public bool RegisterAvailableModules(Context context)
        {
            _context = context;
            foreach (Type typ in context.Config.ApiModules)
            {
                IApiModule module = Activator.CreateInstance(typ) as IApiModule;
                module.Initialize(context);
                _dicModules.Add(module.ModuleName, module);
            }

            return true;
        }
Ejemplo n.º 4
0
        public static void Start(string[] args)
        {
            Configuration config = new Configuration();

            // TODO: In the future change make this configurable
            config.AppBase = AppDomain.CurrentDomain.BaseDirectory;

            SetupBinaries( config.AppBase);

            Context context = new Context();
            context.Config = config;

            // Load the configuration
            LoadConfiguration(config);

            IApplicationController controller = Activator.CreateInstance(config.AppControllerType) as IApplicationController;
            controller.Initialize(context);
            controller.Run();
        }
Ejemplo n.º 5
0
 public bool Initialize(Context context)
 {
     _context = context;
     return true;
 }