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; }
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(); }
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; }
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(); }
public bool Initialize(Context context) { _context = context; return true; }