static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var conf = new ConfigurationBuilder(); conf.AddJsonFile("appsettings"); var services = new ServiceCollection(); Startup start = new Startup(conf.Build()); start.ConfigureRepositoryServices(services); var helper = HI.GetInst(services.BuildServiceProvider()); var mainForm = new FrmMain(); IObserverEvent observer = new FrmMainObserver(mainForm); CoRBuilder.Listener?.Register(observer); Application.Run(mainForm); }
public HelperRun <TInterfaceModel> GetExecutor <TInterfaceModel, TViewModel>(EType type, string stextJson, Operation op) { IStep <IManagementModelRequest <TInterfaceModel> > _businessLogic = null; lock (lockReesource) { _businessLogic = HI.GetInst().Get <IStep <IManagementModelRequest <TInterfaceModel> > >(); } IMapper _mapper = HI.GetInst().Get <IMapper>(); TViewModel itemViewModel = JsonConvert.DeserializeObject <TViewModel>(stextJson); var itemModel = _mapper.Map <TInterfaceModel>(itemViewModel); var request = new ManagementModelRequest <TInterfaceModel> { Item = itemModel, Type = op }; HelperRun <TInterfaceModel> pExecutor = new HelperRun <TInterfaceModel> { BusinessLogic = _businessLogic, Request = request }; return(pExecutor); }
public static HI GetInst(ServiceProvider sr = null) { if (Instance == null) { lock (LockerInstance) { Instance = new HI(sr); } } return(Instance); }