public static ContainerBuilder AddFileConfig(this ContainerBuilder builder)
        {
            IOConfigSection config = System.Configuration
                                     .ConfigurationManager
                                     .GetSection(IOConfigSection.SECTION_NAME) as IOConfigSection;

            builder.RegisterInstance(config).As <IOConfigSection>().SingleInstance();
            return(builder);
        }
Exemplo n.º 2
0
        public IOConfigSectionViewModel(
            IOConfigSection view,
            JToken sectionConfig)
        {
            _view = view;

            SupportSubtitle = sectionConfig["support_subtitle"]?.ToObject <bool>() ?? false;

            _outputSuffix    = sectionConfig["output_suffix"]?.ToObject <string>() ?? _outputSuffix;
            _outputExtension = sectionConfig["output_extension"]?.ToObject <string>() ?? _outputExtension;

            _hasInvalidCharHelper =
                // ReSharper disable once InvokeAsExtensionMethod
                Observable.Merge(
                    this
                    .WhenAnyValue(x => x.Input)
                    .Select(x => PathExtension.InvalidChars.Any(x.Contains)),
                    this
                    .WhenAnyValue(x => x.Subtitle)
                    .Select(x => PathExtension.InvalidChars.Any(x.Contains)))
                .ToProperty(this, x => x.HasInvalidChar);
        }
Exemplo n.º 3
0
 public ReadReportCommand(ILogger logger, IOConfigSection ioConfig, ClientManager clientManager)
 {
     this.logger         = logger;
     this.ioConfig       = ioConfig;
     this._clientManager = clientManager;
 }