public override void ContributeAdapterComponents(IComponentContainer existingComponents, IComponentContainerBuilder newComponents) { base.ContributeAdapterComponents(existingComponents, newComponents); var platformConfig = existingComponents.Resolve <IMessagingPlatformConfiguration>(); var webAppPorts = existingComponents.ResolveAll <WebAppInjectorPort>(); var httpEndpointConfigs = existingComponents.ResolveAll <HttpEndpointInjectorPort>() .Select(endpoint => platformConfig.Endpoints[endpoint.Name]) .Cast <IHttpEndpointConfig>() .ToArray(); foreach (var appPort in webAppPorts) { var assetFolderPath = PathUtility.ExpandPathFromBinary( "GeneratedDeployables", "NWheels.Frameworks.Uidl.Adapters.WebAngular", appPort.ApplicationName); foreach (var endpointConfig in httpEndpointConfigs) { endpointConfig.StaticFolders.Add(ConfigureStaticResourceFolder( appPort.UriPathBase, assetFolderPath, platformConfig.NewHttpStaticFolderConfig())); } } }
public PlantillaViewModel(IComponentContainer componentContainer) { this.filtroService = componentContainer.Resolve <IFiltrosServices>(); this.plantillasService = componentContainer.Resolve <IExportarPlantillaService>(); this.AplicarFiltroCommand = new DelegateCommand(AplicarFiltro); this.RemoverFiltroCommand = new DelegateCommand(RemoverFiltro); this.ObtenerPlantillaCommand = new DelegateCommand(ObtenerPlantillaSelected); this.ExportarExcelCommand = new DelegateCommand(ExportarExcel); this.FiltroRangoFechas = new KeyValuePair <RangoFechasUtility.RangoFecha, string>(RangoFechasUtility.RangoFecha.UltimoMes, RangoFechasUtility.RangoFechas[RangoFechasUtility.RangoFecha.UltimoMes]); this.TipoFechaCreacion = true; CallAsynchronousLoadFilters(); }
public override void ContributeComponents(IComponentContainer existingComponents, IComponentContainerBuilder newComponents) { base.ContributeComponents(existingComponents, newComponents); var hostBuilder = existingComponents.Resolve <MicroserviceHostBuilder>(); hostBuilder.ApplyComponentContributions(existingComponents, newComponents); }
public CabeceraPacienteViewModel(IRegionManager regionManager, IComponentContainer componentContainer) { this.regionManager = regionManager; this.cabeceraPaciente = componentContainer.Resolve <ICabeceraPacienteService>(); this.pacientes = new ObservableCollection <Paciente>(this.cabeceraPaciente.GetDatosPaciente()); this._paciente = this.cabeceraPaciente.GetDatosPacientef(); }
//------------------------------------------------------------------------------------------------------------------------------------------------- public override void ContributeConfiguration(IComponentContainer existingComponents) { base.ContributeConfiguration(existingComponents); var messagingPlatformConfig = existingComponents.Resolve <IMessagingPlatformConfiguration>(); var httpEndpointConfig = messagingPlatformConfig.NewHttpEndpointConfig(); httpEndpointConfig.Name = "rest-api"; httpEndpointConfig.Port = 5000; messagingPlatformConfig.Endpoints.Add("rest-api", httpEndpointConfig); }
//------------------------------------------------------------------------------------------------------------------------------------------------- public override void ContributeComponents(IComponentContainer existingComponents, IComponentContainerBuilder newComponents) { newComponents.RegisterComponentType <NonStaticTestRequestHandler>().InstancePerDependency(); newComponents.ContributeHttpEndpoint( "Static", onRequest: null); newComponents.ContributeHttpEndpoint( "Dynamic", onRequest: context => { var handler = existingComponents.Resolve <NonStaticTestRequestHandler>(); return(handler.HandleRequest(context)); }); newComponents.ContributeHttpEndpoint( "Mixed", onRequest: context => { var handler = existingComponents.Resolve <NonStaticTestRequestHandler>(); return(handler.HandleRequest(context)); }); }
public UsoHCEViewModel(IComponentContainer componentContainer, ModalDialogHelper modalDialogHelper, IEventAggregator eventAggregator) { this.eventAggregator = eventAggregator; this.filtroService = componentContainer.Resolve <IFiltrosServices>(); this.indicadoresService = componentContainer.Resolve <IIndicadoresServices>(); this.modalDialogHelper = modalDialogHelper; this.AplicarFiltroCommand = new DelegateCommand(AplicarFiltro); this.RemoverFiltroCommand = new DelegateCommand(RemoverFiltro); this.MostrarListadoPacientesDiagnosticadosCommand = new DelegateCommand <decimal?>(MostrarListadoPacientesDiagnosticados); this.FiltroRangoFechas = new KeyValuePair <RangoFechasUtility.RangoFecha, string>(RangoFechasUtility.RangoFecha.Hoy, RangoFechasUtility.RangoFechas[RangoFechasUtility.RangoFecha.Hoy]); CallAsynchronousLoadFilters(); EstadisticaPacientesChangedEvent recargaPacientes = this.eventAggregator.GetEvent <EstadisticaPacientesChangedEvent>(); EtiquetasChangedEvent recargaEtiquetas = this.eventAggregator.GetEvent <EtiquetasChangedEvent>(); recargaPacientes.Subscribe(OnIndicadorPacientes); recargaEtiquetas.Subscribe(OnIndicadorPacientes); }
//------------------------------------------------------------------------------------------------------------------------------------------------- public override void ContributeConfiguration(IComponentContainer existingComponents) { base.ContributeConfiguration(existingComponents); var configuration = existingComponents.Resolve <IMessagingPlatformConfiguration>(); configuration.Endpoints["Static"] = new TestHttpEndpointConfiguration() { Name = "Static", Port = 5500, StaticFolders = new IHttpStaticFolderConfig[] { new TestHttpStaticFolderConfig { LocalRootPath = Path.Combine(_s_binaryFolder, "System/wwwroot/Static1".ToPathString()), RequestBasePath = "/static/files/one" }, new TestHttpStaticFolderConfig { LocalRootPath = Path.Combine(_s_binaryFolder, "System/wwwroot/Static2".ToPathString()), RequestBasePath = "/static/files/two", DefaultFiles = new string[] { "index.html" } }, new TestHttpStaticFolderConfig { LocalRootPath = Path.Combine(_s_binaryFolder, "System/wwwroot/Static2".ToPathString()), RequestBasePath = "/", DefaultFiles = new string[] { "index.html" } } } }; configuration.Endpoints["Dynamic"] = new TestHttpEndpointConfiguration() { Name = "Dynamic", Port = 5501 }; configuration.Endpoints["Mixed"] = new TestHttpEndpointConfiguration() { Name = "Mixed", Port = 5502, StaticFolders = new IHttpStaticFolderConfig[] { new TestHttpStaticFolderConfig { LocalRootPath = Path.Combine(_s_binaryFolder, "System/wwwroot/Static1".ToPathString()), RequestBasePath = "/static/files/one" } } }; }
//----------------------------------------------------------------------------------------------------------------------------------------------------- public void ConfigureHttpEndpoint(IComponentContainer existingComponents) { if (OnConfiguration != null) { var configuration = existingComponents.Resolve <IMessagingPlatformConfiguration>(); if (!configuration.Endpoints.TryGetValue(this.Name, out IEndpointConfig endpointConfig)) { endpointConfig = configuration.NewHttpEndpointConfig(); endpointConfig.Name = this.Name; configuration.Endpoints.Add(this.Name, endpointConfig); } var httpEndpointConfig = (IHttpEndpointConfig)endpointConfig; OnConfiguration(httpEndpointConfig); } }
/// <summary> /// Resolves a command builder. /// </summary> /// <returns>ICommandBuilder.</returns> public ICommandBuilder ResolveCommandBuilder(string name) { return(Container.Resolve <ICommandBuilder>(name)); }
//------------------------------------------------------------------------------------------------------------------------------------------------- public Task ScheduledInvoke(IInvocationMessage invocation) { object target = _components.Resolve(invocation.TargetType); return(invocation.Invoke(target)); }
public ListadoUrgenciaViewModel(IRegionManager regionManager, IComponentContainer componentContainer) { this.regionManager = regionManager; this.urgenciaService = componentContainer.Resolve <IUrgenciaService>(); this.Pacientes = new ObservableCollection <UrgenciaModel>(this.urgenciaService.GetListadoUrgencia()); }
/// <summary> /// Obtiene la implementación previamente registrada para una interfase dada. /// </summary> /// <typeparam name="T">Interface del componente</typeparam> /// <returns>Devuelve una instancia que implementa la interface</returns> public T Resolve <T>() where T : class { return(_container.Resolve <T>()); }