public static void startEnv() { IEnvironment environment = null; try { environment = new MobEnvironment(); ToolMobile.setEnvironment(environment); environment.setFileSystem(new ImplFileSystem()); // environment.setLangSettings(new SettingsFromFileExt(Path.Combine(SettingsFileName.DIRECTORY_CONFIG, SettingsFileName.DIRECTORY_SYS), SettingsFileName.NAME_LANG, environment)); environment.setAppSettings(new SettingsFromFileExt(Path.Combine(SettingsFileName.DIRECTORY_CONFIG, SettingsFileName.DIRECTORY_SYS), SettingsFileName.NAME_APP, environment)); // environment.setLoginSettings(new SettingsFromFileExt(Path.Combine(SettingsFileName.DIRECTORY_CONFIG, SettingsFileName.DIRECTORY_SYS), SettingsFileName.NAME_LOGIN, environment)); // environment.setDsSettings(new SettingsFromFileExt(Path.Combine(SettingsFileName.DIRECTORY_CONFIG, SettingsFileName.DIRECTORY_SYS), SettingsFileName.NAME_DS, environment)); environment.setSettingsStore(new SettingsStoreFromDirectory(Path.Combine(SettingsFileName.DIRECTORY_CONFIG, SettingsFileName.DIRECTORY_UI), environment)); IUserImage list = new ImplUserImage(); environment.setImages(list); ToolMobile.log("environment init starting"); environment.init(); // IPagedSource psSysSet = new PagedSourceFirmParams(environment); ToolMobile.log("set firm parameters"); environment.setSysSettings(new SettingsFromTable(psSysSet.getAll(), TableFIRMPARAMS.CODE, TableFIRMPARAMS.VALUE)); ToolMobile.log("environment started"); } catch (Exception exc) { ToolMobile.log("environment start error: " + exc.Message); ToolMobile.setExceptionInner(exc); // environment.getExceptionHandler().setException(exc, delegate() { Close(); }); ToolMobile.setEnvironment(null); } }
ISettings getSysSettings() { IPagedSource psSysSet = new PagedSourceFirmParams(environment); return(new SettingsFromTable(psSysSet.getAll(), TableFIRMPARAMS.CODE, TableFIRMPARAMS.VALUE)); }