AppCentreImport.pas 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. unit AppCentreImport;
  2. interface
  3. uses
  4. InterfaceAppCentre, InterfaceUI;
  5. function GetAppCentre: IAppCentre;
  6. function GetAppCentreConfig: IAppCentreConfig;
  7. function GetAppCentreUIHandler: IUIHandler;
  8. const
  9. APPCENTRE_BEANNAME: string = 'appCentre';
  10. APPCENTRE_CONFIG: string = 'appCentreConfig';
  11. APPCENTRE_UIHANDLER: string = 'appCentreUIHandler';
  12. implementation
  13. uses
  14. mybean.tools.beanFactory, LoggerImport, SysUtils;
  15. function GetAppCentre: IAppCentre;
  16. begin
  17. try
  18. Result := (TMyBeanFactoryTools.getBean(APPCENTRE_BEANNAME) as IAppCentre);
  19. except
  20. on E: Exception do
  21. Error(E.Message, 'GetAppCentre');
  22. end;
  23. end;
  24. function GetAppCentreConfig: IAppCentreConfig;
  25. begin
  26. try
  27. Result := (TMyBeanFactoryTools.getBean(APPCENTRE_CONFIG) as IAppCentreConfig);
  28. except
  29. on E: Exception do
  30. Error(E.Message, 'GetAppCentreConfig');
  31. end;
  32. end;
  33. function GetAppCentreUIHandler: IUIHandler;
  34. begin
  35. try
  36. Result := (TMyBeanFactoryTools.getBean(APPCENTRE_UIHANDLER) as IUIHandler);
  37. except
  38. on E: Exception do
  39. Error(E.Message, 'GetAppCentreUIHandler');
  40. end;
  41. end;
  42. end.