Пример #1
0
 public RazorLightService(IComponentSettings componentSettings, IWebHostEnvironment host)
 {
     _componentSettings = componentSettings;
     _componentSettings.SetUrl(host.ContentRootPath);
     Engine = new RazorLightEngineBuilder()
              .UseFileSystemProject(componentSettings.BaseComponentFullDir)
              .UseMemoryCachingProvider()
              .Build();
     //Engine = engine;
 }
Пример #2
0
        /// <summary>
        /// Monitors a directory for files that match a specified file filter, passed via
        /// properties.
        /// </summary>
        public FileWatcherComponent(IComponentSettings settings, IMessagePublisher eventPublisher, ILogger <FileWatcherComponent> logger)
        {
            Settings             = settings;
            _logger              = logger;
            _existingFileChecker = new ExistingFileChecker(this, _logger);
            _messagePublisher    = eventPublisher;

            ConfigureDirectoryAndFilter();
            ConfigureBufferSize();
        }
Пример #3
0
 public MaComponentRenderer(
     IIMaComponent imaComponent,
     RazorLightService viewRenderService,
     IServiceProvider serviceProvider,
     IWebHostEnvironment hostingEnvironment,
     IComponentSettings componentSettings)
 {
     _imaComponent       = imaComponent;
     _componentSettings  = componentSettings;
     viewRenderer        = viewRenderService;
     _serviceProvider    = serviceProvider;
     _hostingEnvironment = hostingEnvironment;
 }
        public NodeManagerComponent(IComponentSettings settings, ILogger <NodeManagerComponent> logger)
        {
            Settings             = settings;
            _masterConfiguration = new ConfigurationBuilder()
                                   .SetBasePath(Environment.CurrentDirectory)
                                   .AddJsonFile(Settings.Properties["masterConfigurationFile"], optional: false, reloadOnChange: true)
                                   .AddEnvironmentVariables()
                                   .Build();


            _logger = logger;

            _nodeSynchronizer       = new NodeSynchronizer();
            _distributedLockFactory = new DistributedLockFactory(_masterConfiguration);


            _masterWebApi = new Program(_masterConfiguration);
        }
Пример #5
0
        // attempt to load all assemblies passed through configuration
        private void LoadRequestedAssemblies()
        {
            // this is when the validity of the configuration will be important
            // if paths or namespaces are incorrect we won't be able to load
            // the requested resources, resulting in an error state
            ComponentType = GetTypeFromAssembly(ComponentConfiguration.AssemblyPath, ComponentConfiguration.FullyQualifiedClassName);

            // component is required, while message publisher is optional
            // since not all components will use a message publisher
            if (ComponentType is null)
            {
                HostState = HostState.Errored;
            }
            else if (!(MessagePublisherConfiguration is null))
            {
                ConfigureMessagePublisher();
            }

            _componentSettings        = ComponentConfiguration.ToComponentSettings();
            _messagePublisherSettings = MessagePublisherConfiguration.ToMessagePublisherSettings();
        }
 public ReplicationComponent(IComponentSettings settings, ILogger <ReplicationComponent> logger)
 {
     Settings = settings;
     _logger  = logger;
 }
Пример #7
0
 public IMaComponent(IWebHostEnvironment hostingEnvironment, IComponentSettings componentSettings)
 {
     _hostingEnvironment = hostingEnvironment;
     _componentSettings  = componentSettings;
     _componentSettings.SetUrl(_hostingEnvironment.ContentRootPath);
 }