protected override void InitInternal() { IServiceMgr serviceMgr = ServiceMgr.Current; _regionMgr = serviceMgr.GetInstance <IRegionMgr>(); IDbAccessor dbSccessor = new DbAccessor(); _mainController = new MainController(dbSccessor); serviceMgr.AddInstance <IRequestService>(_mainController); _plugginMenuCommand = new RequestPlugginMenuCommand(); _requestListCommand = new RequestListCommand(_mainController); _requestCreateCommand = new RequestCreateCommand(_mainController); _requestPeriodReportCommand = new RequestPeriodReportCommand(_mainController); _plugginMenuCommandKey = _regionMgr.GetCommandRegion(RegionName.PlugginMenuItem).AddCommand(_plugginMenuCommand); _plugginMenuRequestListCommandKey = _regionMgr.GetCommandRegion(RegionName.PlugginMenuItem).AddCommand(_requestListCommand, _plugginMenuCommand.Name); _mainToolBarRequestListCommandKey = _regionMgr.GetCommandRegion(RegionName.MainToolBar).AddCommand(_requestListCommand); _plugginMenuRequestCreateCommandKey = _regionMgr.GetCommandRegion(RegionName.PlugginMenuItem).AddCommand(_requestCreateCommand, _plugginMenuCommand.Name); _mainToolBarRequestCreateCommandKey = _regionMgr.GetCommandRegion(RegionName.MainToolBar).AddCommand(_requestCreateCommand); _plugginMenuPeriodReportCommandKey = _regionMgr.GetCommandRegion(RegionName.PlugginMenuItem).AddCommand(_requestPeriodReportCommand, _plugginMenuCommand.Name); _mainToolBarPeriodReportCommandKey = _regionMgr.GetCommandRegion(RegionName.MainToolBar).AddCommand(_requestPeriodReportCommand); _eventMgr = serviceMgr.GetInstance <IEventMgr>(); Subscribe(); }
static void Main() { Bootstrapper boot = new Bootstrapper(); boot.Run(); IServiceMgr serviceMgr = ServiceMgr.Current; IPlugginMgr plugMgr = serviceMgr.GetInstance <IPlugginMgr>(); ILogMgr logMgr = serviceMgr.GetInstance <ILogMgr>(); ILogger logger = logMgr.GetLogger("Main"); serviceMgr.AddInstance <ILogger>(logger); foreach (IPluggin plug in plugMgr.Pluggins) { logger.Info(plug.Name); } serviceMgr.Trace(); ILogger l = serviceMgr.GetInstance <ILogger>(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); }
internal TaskCreateCommand() { IServiceMgr serviceMgr = ServiceMgr.Current; _logMgr = serviceMgr.GetInstance <ILogMgr>(); _logger = _logMgr.GetLogger("TaskCreateCommand"); _commonDbService = serviceMgr.GetInstance <ICommonService>(); _logger.Debug("Create."); _logger.Debug("Interfaces: ICommonDbService = {0};", _commonDbService.ToStateString()); }
internal RequestListCommand(IMainController mainController) { _mainController = mainController; IServiceMgr serviceMgr = ServiceMgr.Current; _logMgr = serviceMgr.GetInstance <ILogMgr>(); _logger = _logMgr.GetLogger("RequestListCommand"); _commonDbService = serviceMgr.GetInstance <ICommonService>(); _logger.Debug("Create."); _logger.Debug("Interfaces: ICommonDbService = {0}; Request.IMainController = {1}", _commonDbService.ToStateString(), _mainController.ToStateString()); }
internal RequestPlugginMenuCommand() { IServiceMgr serviceMgr = ServiceMgr.Current; _logMgr = serviceMgr.GetInstance <ILogMgr>(); _logger = _logMgr.GetLogger("RequestPlugginMenuCommand"); _logger.Debug("Create."); }
protected override void InitInternal() { IServiceMgr serviceMgr = ServiceMgr.Current; _regionMgr = serviceMgr.GetInstance <IRegionMgr>(); _plugginMenuCommand = new TaskPlugginMenuCommand(); _bugListCommand = new TaskListCommand(); _bugCreateCommand = new TaskCreateCommand(); _plugginMenuCommandKey = _regionMgr.GetCommandRegion(RegionName.PlugginMenuItem).AddCommand(_plugginMenuCommand); _plugginMenuTaskListCommandKey = _regionMgr.GetCommandRegion(RegionName.PlugginMenuItem).AddCommand(_bugListCommand, _plugginMenuCommand.Name); _mainToolBarTaskListCommandKey = _regionMgr.GetCommandRegion(RegionName.MainToolBar).AddCommand(_bugListCommand); _plugginMenuTaskCreateCommandKey = _regionMgr.GetCommandRegion(RegionName.PlugginMenuItem).AddCommand(_bugCreateCommand, _plugginMenuCommand.Name); _mainToolBarTaskCreateCommandKey = _regionMgr.GetCommandRegion(RegionName.MainToolBar).AddCommand(_bugCreateCommand); _eventMgr = serviceMgr.GetInstance <IEventMgr>(); Subscribe(); }
public MainController() { IServiceMgr serviceMgr = ServiceMgr.Current; _logMgr = serviceMgr.GetInstance <ILogMgr>(); _connection = serviceMgr.GetInstance <IDbConnection>(); _messageBoxMgr = serviceMgr.GetInstance <IMessageBoxMgr>(); _viewFormMgr = serviceMgr.GetInstance <IViewFormMgr>(); _commonDbAccessor = serviceMgr.GetInstance <ICommonDbAccessor>(); _nsiController = serviceMgr.GetInstance <INsiController>(); _eventMgr = serviceMgr.GetInstance <IEventMgr>(); _logger = _logMgr.GetLogger("MainController"); _logger.Debug("Create."); _isFirstConnect = true; _currentUser = UserEntity.Create(); }
public MainController(IDbAccessor dbAccessor) { _dbAccessor = dbAccessor; IServiceMgr serviceMgr = ServiceMgr.Current; _logMgr = serviceMgr.GetInstance <ILogMgr>(); _logger = _logMgr.GetLogger("Request.MainController"); _dialogMgr = serviceMgr.GetInstance <IViewFormMgr>(); _regionMgr = serviceMgr.GetInstance <IRegionMgr>(); _commonService = serviceMgr.GetInstance <ICommonService>(); _dbMgr = serviceMgr.GetInstance <IDbMgr>(); _eventMgr = serviceMgr.GetInstance <IEventMgr>(); _logger.Debug("Create."); _logger.Debug("Interfaces: IDBMgr = {0}; ICommonDbService = {1}; _dialogMgr = {2}; IRegionMgr = {3}; IEventMgr = {4}.", _dbMgr.ToStateString(), _commonService.ToStateString(), _dialogMgr.ToStateString(), _regionMgr.ToStateString(), _eventMgr.ToStateString()); Init(); }