Пример #1
0
 private ConfigurationState()
 {
     Ui       = new UiSection();
     Logger   = new LoggerSection();
     System   = new SystemSection();
     Graphics = new GraphicsSection();
     Hid      = new HidSection();
     EnableDiscordIntegration = new ReactiveObject <bool>();
 }
Пример #2
0
        public virtual void Configure()
        {
            var config  = LoggerSection.GetConfig();
            var section = config.Loggers.Cast <LoggerSectionElement>().FirstOrDefault(x => x.Type == typeof(T).Name);

            LogLevel = section != null?section.Level.ToEnum <LogLevelType>() : LogLevelType.Debug;

            Active     = section != null ? section.Active : true;
            parameters = section != null ? section.Parameters : new LoggerSectionParameterCollection();
        }
        public static void TraceProviderSettings(LoggerSection section)
        {
#if TRACE
            Trace.WriteLine("Les paramètres des providers sont:");
            foreach (KeyValueConfigurationElement setting in section.ProviderSettings)
            {
                Trace.WriteLine("[" + setting.Key + "]=\"" + setting.Value + "\"");
            }
#endif
        }
        public static void TraceProviderDefinitions(LoggerSection section)
        {
#if TRACE
            Trace.WriteLine("Les définitions de provider sont:");
            foreach (ProviderDefinitionElement providerDefinition in section.Definitions)
            {
                Trace.WriteLine(providerDefinition.Name);
            }
#endif
        }
Пример #5
0
 private ConfigurationState()
 {
     Ui       = new UiSection();
     Logger   = new LoggerSection();
     System   = new SystemSection();
     Graphics = new GraphicsSection();
     Hid      = new HidSection();
     EnableDiscordIntegration = new ReactiveObject <bool>();
     CheckUpdatesOnStart      = new ReactiveObject <bool>();
     ShowConfirmExit          = new ReactiveObject <bool>();
     HideCursorOnIdle         = new ReactiveObject <bool>();
 }
Пример #6
0
        public override void Configure()
        {
            var config = LoggerSection.GetConfig();

            foreach (var logger in config.Loggers.Cast <LoggerSectionElement>())
            {
                var loggerInstance = CastleWindsorService.Resolve(logger.Type, null);
                if (loggerInstance.GetType().GetInterface(typeof(IWebApiLogger).Name) != null)
                {
                    loggers.Add(loggerInstance as IWebApiLogger);
                }
            }
        }
Пример #7
0
 /// <summary>
 /// Default constructor
 /// </summary>
 private LoggerBuilder()
 {
     this.LoggerSection = ConfigurationManager.GetSection(SECTION_NAME) as LoggerSection;
 }