public Main(
            IOptionsBackend o, ILoggerBackend logger,
            ISolution solution, DocumentManager dm)
        {
            Instance = this;

            Options         = new Options(o);
            Logger          = new Logger(logger);
            Solution        = solution;
            DocumentManager = dm;

            DocumentManager.DocumentChanged   += OnDocumentChanged;
            DocumentManager.ContainersChanged += OnContainersChanged;

            Options.EnabledChanged  += OnEnabledChanged;
            Options.TemplateChanged += OnTemplateChanged;
            Options.IgnoreBuiltinProjectsChanged += OnIgnoreBuiltinProjectsChanged;
            Options.IgnoreSingleProjectChanged   += OnIgnoreSingleProjectChanged;
            Options.LoggingChanged += OnLoggingChanged;

            if (Options.Enabled)
            {
                Logger.Log("initialized");
                Start();
            }
            else
            {
                Logger.Log("initialized but disabled in the options");
            }
        }
Beispiel #2
0
 public static void AddBackend(ILoggerBackend backend, string name, bool overwrite = false)
 {
     backendNames.AddOrUpdate(name, backend, (key, value) =>
     {
         if (!overwrite)
         {
             throw new RecoverableException(string.Format("Backend with name '{0}' already exists", key));
         }
         value.Dispose();
         return(backend);
     });
     backends.Add(backend);
 }
Beispiel #3
0
 public static void AddBackend(ILoggerBackend backend, string name, bool overwrite = false)
 {
     backendNames.AddOrUpdate(name, backend, (key, value) =>
     {
         if (!overwrite)
         {
             throw new RecoverableException(string.Format("Backend with name '{0}' already exists", key));
         }
         value.Dispose();
         return backend;
     });
     backends.Add(backend);
 }
Beispiel #4
0
 public static void RemoveBackend(ILoggerBackend backend)
 {
     backends.Remove(backend);
     backend.Dispose();
 }
 public Logger(ILoggerBackend backend)
 {
     Backend = backend;
 }
Beispiel #6
0
 public bool AddBackend(string name, ILoggerBackend backend)
 {
     return(mBackends.TryAdd(name, backend));
 }