コード例 #1
0
        public App(string dbpath, string storagepath)
        {
            // Initialize Live Reload.
            #if DEBUG
            //LiveReload.Init();
            #endif

            AppSetting = new AppSettingRepository(dbpath, storagepath);
            InitializeComponent();

            // Replace default user-agent for image web request
            var client = new HttpClient();
            client.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", @"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36");
            ImageService.Instance.Initialize(new Configuration {
                HttpClient = client
            });

            MainPage = new TabbedPage
            {
                Children =
                {
                    new SearchPage(),
                    new DonwloadPage(),
                    new SettingPage()
                }
            };
            AppSetting.AutoSave = true;
        }
コード例 #2
0
 public HomeController(IAreaRepository areaRepository, IDeviceRepository devRepository,
                       IUserRepository userRepository, IAppSettingRepository appSettingRepository, IAuditLogRepository auditLogRepository, ITransportPlanRepository transportPlanRepository)
     : base(areaRepository)
 {
     this.areaRepository          = areaRepository;
     this.devRepository           = devRepository;
     this.userRepository          = userRepository;
     this.appSettingRepository    = appSettingRepository;
     this.auditLogRepository      = auditLogRepository;
     this.transportPlanRepository = transportPlanRepository;
 }
コード例 #3
0
 public Handler(IAppSettingRepository repository, IMapper mapper)
 {
     this._repository = repository;
     this._mapper     = mapper;
 }
コード例 #4
0
 public AppSettingService(IAppSettingRepository DBSettingRepository, IMapper mapper)
 {
     _DBSettingRepository = DBSettingRepository;
     _mapper = mapper;
 }
コード例 #5
0
 public AppSettingService(IAppSettingRepository appSettingRepository, IAgentRepository agentRepository, ICacheHelper cacheHelper)
     : base(agentRepository, cacheHelper)
 {
     _appSettingRepository = appSettingRepository;
 }
コード例 #6
0
 public AppSettingQueryComponent(IAppSettingRepository appSettingRepository)
 {
     this._appSettingRepository = appSettingRepository;
 }
コード例 #7
0
 public AppSettingCreatedDomainEventHandler(IAppSettingRepository repository)
 {
     this._repository = repository;
 }
コード例 #8
0
ファイル: AppSettingService.cs プロジェクト: huutoannht/mart
 public AppSettingService(IAppSettingRepository repository)
 {
     _repository = repository;
 }
コード例 #9
0
 public Handler(IAppSettingRepository repository, IUserIdentityService userIdentityService)
 {
     this._repository          = repository;
     this._userIdentityService = userIdentityService;
 }
コード例 #10
0
ファイル: Global.asax.cs プロジェクト: Joy011024/PickUpData
        static void OrmIocFactory()
        {
            if (propertyVal.Count > 0)
            {//存储字典非空出来
            }
            string             connString = InitAppSetting.LogicDBConnString;
            InterfaceIocHelper ioc        = new InterfaceIocHelper();
            string             dir        = NowAppDirHelper.GetNowAppDir(AppCategory.WebApp);
            // 获取到的目录 E:\Code\DayDayStudy\PickUpData\HRApp\HRApp.Web\
            string dllDir = dir + "bin\\";

            #region dll路径配置
            Dictionary <MvcLevel, AssemblyData> mvc = new Dictionary <MvcLevel, AssemblyData>();
            mvc.Add(MvcLevel.DAL, new AssemblyData()
            {
                AssemblyName = "HRApp.Infrastructure.dll", Namespace = "HRApp.Infrastructure"
            });
            mvc.Add(MvcLevel.Bll, new AssemblyData()
            {
                AssemblyName = "HRApp.ApplicationService.dll", Namespace = "HRApp.ApplicationService"
            });
            #endregion
            propertyVal.Add("SqlConnString", connString);
            propertyVal.Add(typeof(IEnumDataRepository).Name + ".SqlConnString", InitAppSetting.AccountDBConnString);   //账号库
            propertyVal.Add(typeof(IEnumDataService).Name + ".SqlConnString", InitAppSetting.AccountDBConnString);      //账号库
            propertyVal.Add(typeof(IAppAccountRepository).Name + ".SqlConnString", InitAppSetting.AccountDBConnString); //账号库
            propertyVal.Add(typeof(IAppAccountService).Name + ".SqlConnString", InitAppSetting.AccountDBConnString);    //账号库
            propertyVal.Add(typeof(IMenuRepository).Name + ".SqlConnString", InitAppSetting.AccountDBConnString);       //账号库
            propertyVal.Add(typeof(IDataFromOtherRepository).Name + ".SqlConnString", InitAppSetting.QueryUinDB);       //这个是用于系统中查询其他库的数据切换操作
            #region dal层属性
            #region Account DB
            IEnumDataRepository enumDal = ioc.IocConvert <IEnumDataRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(EnumDataRepository).Name);
            ioc.IocFillProperty(enumDal, propertyVal);
            IAppAccountRepository accountDal = ioc.IocConvert <IAppAccountRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(AppAccountRepository).Name);
            ioc.IocFillProperty(accountDal, propertyVal);
            IMenuRepository menuDal = ioc.IocConvert <IMenuRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(MenuRepository).Name);
            ioc.IocFillProperty(menuDal, propertyVal);
            #endregion
            #region log --all
            ILogDataRepository logDal = ioc.IocConvert <ILogDataRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(LogDataRepository).Name);
            ioc.IocFillProperty(logDal, propertyVal);
            #endregion
            IAppRepository appDal = ioc.IocConvert <IHRApp.Infrastructure.IAppRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(AppRepository).Name);
            ioc.IocFillProperty <IAppRepository, IAppRepository>(appDal, propertyVal);
            IAppSettingRepository appSettingDal = ioc.IocConvert <IAppSettingRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(AppSettingRepository).Name);
            ioc.IocFillProperty(appSettingDal, propertyVal);

            IOrganizationRepository organzeDal = ioc.IocConvert <IOrganizationRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(OrganizationRepository).Name);
            ioc.IocFillProperty(organzeDal, propertyVal);
            IContactDataRepository contacterDal = ioc.IocConvert <IContactDataRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(ContactDataRepository).Name);
            ioc.IocFillProperty(contacterDal, propertyVal);
            IMaybeSpecialRepository maybeSpecialDal = ioc.IocConvert <IMaybeSpecialRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(MaybeSpecialRepository).Name);
            ioc.IocFillProperty <IMaybeSpecialRepository>(maybeSpecialDal, propertyVal);
            ISpecialSpellNameRepository speicalSpellDal = ioc.IocConvert <ISpecialSpellNameRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(SpecialSpellNameRepository).Name);
            ioc.IocFillProperty <ISpecialSpellNameRepository>(speicalSpellDal, propertyVal);
            IDataFromOtherRepository dataFormOtherDal = ioc.IocConvert <IDataFromOtherRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(DataFromOtherRepository).Name);
            ioc.IocFillProperty <IDataFromOtherRepository>(dataFormOtherDal, propertyVal);
            IReportEnumDataRepository reportDal = ioc.IocConvert <IReportEnumDataRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(ReportEnumDataRepository).Name);
            ioc.IocFillProperty <IReportEnumDataRepository>(reportDal, propertyVal);
            IRelyTableRepository relyDal = ioc.IocConvert <IRelyTableRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(RelyTableRepository).Name);
            ioc.IocFillProperty <IRelyTableRepository>(relyDal, propertyVal);
            IEmailDataRepository emailDal = ioc.IocConvert <IEmailDataRepository>(dllDir, mvc[MvcLevel.DAL].AssemblyName, mvc[MvcLevel.DAL].Namespace, typeof(EmailDataRepository).Name);
            ioc.IocFillProperty <IEmailDataRepository>(emailDal, propertyVal);
            #endregion
            #region orm中dal层实例化存储到字典中
            propertyVal.Add(typeof(ILogDataRepository).Name, logDal);
            propertyVal.Add(typeof(IEnumDataRepository).Name, enumDal);
            propertyVal.Add(typeof(IAppAccountRepository).Name, accountDal);
            propertyVal.Add(typeof(IAppRepository).Name, appDal);
            propertyVal.Add(typeof(IAppSettingRepository).Name, appSettingDal);
            propertyVal.Add(typeof(IMenuRepository).Name, menuDal);
            propertyVal.Add(typeof(IOrganizationRepository).Name, organzeDal);
            propertyVal.Add(typeof(IContactDataRepository).Name, contacterDal);
            propertyVal.Add(typeof(IMaybeSpecialRepository).Name, maybeSpecialDal);
            propertyVal.Add(typeof(ISpecialSpellNameRepository).Name, speicalSpellDal);
            propertyVal.Add(typeof(IDataFromOtherRepository).Name, dataFormOtherDal);
            propertyVal.Add(typeof(IReportEnumDataRepository).Name, reportDal);
            propertyVal.Add(typeof(IRelyTableRepository).Name, relyDal);
            propertyVal.Add(typeof(IEmailDataRepository).Name, emailDal);
            #endregion
            #region 业务层
            IEnumDataService enumBll = ioc.IocConvert <IEnumDataService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(EnumDataService).Name);
            ioc.IocFillProperty <IEnumDataService, EnumDataService>(enumBll, propertyVal);
            propertyVal.Add(typeof(IEnumDataService).Name, enumBll);
            IAppAccountService accountBll = ioc.IocConvert <IAppAccountService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(AppAccountService).Name);
            ioc.IocFillProperty <IAppAccountService, AppAccountService>(accountBll, propertyVal);
            propertyVal.Add(typeof(IAppAccountService).Name, accountBll);
            //构造函数的参数注入  判断构造函数的参数是否需要进行注入
            IAppDataService appService = ioc.IocConvert <IAppDataService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(AppDataService).Name);
            ioc.IocFillProperty <IAppDataService, AppDataService>(appService, propertyVal);
            propertyVal.Add(typeof(IAppDataService).Name, appService);
            IAppSettingService appSetService = ioc.IocConvert <IAppSettingService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(AppSettingService).Name);
            ioc.IocFillProperty <IAppSettingService, AppSettingService>(appSetService, propertyVal); //属性和字段注入
            propertyVal.Add(typeof(IAppSettingService).Name, appSetService);
            IMenuService menuService = ioc.IocConvert <IMenuService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(MenuService).Name);
            ioc.IocFillProperty <IMenuService, MenuService>(menuService, propertyVal);
            propertyVal.Add(typeof(IMenuService).Name, menuService);
            IOrganizationService organzeService = ioc.IocConvert <IOrganizationService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(OrganizationService).Name);
            ioc.IocFillProperty <IOrganizationService, OrganizationService>(organzeService, propertyVal);
            propertyVal.Add(typeof(IOrganizationService).Name, organzeService);
            IContactDataService contactService = ioc.IocConvert <IContactDataService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(ContactDataService).Name);
            ioc.IocFillProperty <IContactDataService, ContactDataService>(contactService, propertyVal);
            propertyVal.Add(typeof(IContactDataService).Name, contactService);
            IMaybeSpecialService maybeSpeiclaService = ioc.IocConvert <IMaybeSpecialService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(MaybeSpecialService).Name);
            ioc.IocFillProperty <IMaybeSpecialService, MaybeSpecialService>(maybeSpeiclaService, propertyVal);
            propertyVal.Add(typeof(IMaybeSpecialService).Name, maybeSpeiclaService);
            ISpecialSpellNameService specialSpellService = ioc.IocConvert <ISpecialSpellNameService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(SpecialSpellNameService).Name);
            ioc.IocFillProperty <ISpecialSpellNameService, SpecialSpellNameService>(specialSpellService, propertyVal);
            propertyVal.Add(typeof(ISpecialSpellNameService).Name, specialSpellService);
            IDataFromOtherService dataFormService = ioc.IocConvert <IDataFromOtherService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(DataFromOtherService).Name);
            ioc.IocFillProperty <IDataFromOtherService, DataFromOtherService>(dataFormService, propertyVal);
            propertyVal.Add(typeof(IDataFromOtherService).Name, dataFormService);
            IReportEnumDataService reportBll = ioc.IocConvert <IReportEnumDataService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(ReportEnumDataService).Name);
            ioc.IocFillProperty <IReportEnumDataService, ReportEnumDataService>(reportBll, propertyVal);
            propertyVal.Add(typeof(IReportEnumDataService).Name, reportBll);
            IRelyTableService relyBll = ioc.IocConvert <IRelyTableService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(RelyTableService).Name);
            ioc.IocFillProperty <IRelyTableService>(relyBll, propertyVal);
            propertyVal.Add(typeof(IRelyTableService).Name, relyBll);
            IEmailDataService emailBll = ioc.IocConvert <IEmailDataService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(EmailDataService).Name);
            ioc.IocFillProperty <IEmailDataService>(emailBll, propertyVal);
            propertyVal.Add(typeof(IEmailDataService).Name, emailBll);
            ILogDataService logBll = ioc.IocConvert <ILogDataService>(dllDir, mvc[MvcLevel.Bll].AssemblyName, mvc[MvcLevel.Bll].Namespace, typeof(LogDataService).Name);
            ioc.IocFillProperty <ILogDataService>(logBll, propertyVal);
            propertyVal.Add(typeof(ILogDataService).Name, logBll);
            #endregion
        }
コード例 #11
0
 public AppSettingsService(
     IAppSettingRepository appSettingRepository)
 {
     _appSettingRepository = appSettingRepository;
     LoadSettings();
 }
コード例 #12
0
 public AppSettingComponent(IAppSettingRepository appSettingRepository,
                            IUserIdentityService identityService)
 {
     this._appSettingRepository = appSettingRepository;
     this._identityService      = identityService;
 }
コード例 #13
0
 public EmailDataService(IAppSettingRepository appSetting, IEmailDataRepository emailDal, ILogDataRepository logRepository)
 {
     appSettingDal = appSetting;
     emailDataDal  = emailDal;
     logDal        = logRepository;
 }
コード例 #14
0
 public AppSettingService(IAppSettingRepository appSettingRepository)
 {
     _appSettingRepository = appSettingRepository;
 }
コード例 #15
0
 public InfoService(IAppSettingRepository appSettingRepository)
 {
     this._appSettingRepository = appSettingRepository;
 }
コード例 #16
0
 public AppSettingService(IAppSettingRepository appSet)
 {
     appSettingRepository = appSet;
 }
コード例 #17
0
 public MissionService(IMissionRepository missionRepository, IAppSettingRepository appSettingRepository, IMapper mapper)
 {
     _missionRepository    = missionRepository;
     _appSettingRepository = appSettingRepository;
     _mapper = mapper;
 }
 public ServiceAppSetting(IAppSettingRepository appSettingRepository)
 {
     _appSettingRepository = appSettingRepository ?? throw new ArgumentNullException(nameof(appSettingRepository));
 }
コード例 #19
0
ファイル: LoggerFactory.cs プロジェクト: kalabakas1/MPE
 public LoggerFactory()
 {
     _appSettingRepository = new SettingsRepository();
 }