コード例 #1
0
 public MarkdownContext(
     Func <string, string> getToken = null,
     LogActionDelegate logWarning   = null,
     LogActionDelegate logError     = null,
     ReadFileDelegate readFile      = null)
 {
     _getToken  = getToken ?? (_ => null);
     ReadFile   = readFile ?? ReadFileDefault;
     LogWarning = logWarning ?? ((a, b, c, d) => { });
     LogError   = logError ?? ((a, b, c, d) => { });
 }
コード例 #2
0
ファイル: LogManager.cs プロジェクト: fedepezzola/logger
 public bool unsubscribeLogger(ILogger sub)
 {
     if (_Subscribers.Remove(sub))
     {
         _addError   -= sub.addError;
         _addWarning -= sub.addWarning;
         _addMessage -= sub.addMessage;
         sub.Terminate();
         return(true);
     }
     return(false);
 }
コード例 #3
0
ファイル: LogManager.cs プロジェクト: fedepezzola/logger
 public bool subscribeLogger(ILogger sub)
 {
     if (!_Subscribers.Contains(sub))
     {
         sub.Init();
         _Subscribers.Add(sub);
         _addError   += sub.addError;
         _addWarning += sub.addWarning;
         _addMessage += sub.addMessage;
         return(true);
     }
     return(false);
 }
コード例 #4
0
        public MarkdownContext(
            IReadOnlyDictionary <string, string> tokens = null,
            LogActionDelegate logWarning = null,
            LogActionDelegate logError   = null,
            ReadFileDelegate readFile    = null,
            GetLinkDelegate getLink      = null)
        {
            Tokens   = tokens ?? ImmutableDictionary <string, string> .Empty;
            ReadFile = readFile ?? ReadFileDefault;
            GetLink  = getLink ?? ((path, relativeTo) => path);

            LogWarning = logWarning;
            LogError   = logError;
        }
コード例 #5
0
ファイル: MarkdownContext.cs プロジェクト: wwhitehead/docfx
 public MarkdownContext(
     Func <string, string> getToken  = null,
     LogActionDelegate logInfo       = null,
     LogActionDelegate logSuggestion = null,
     LogActionDelegate logWarning    = null,
     LogActionDelegate logError      = null,
     ReadFileDelegate readFile       = null,
     GetLinkDelegate getLink         = null)
 {
     _getToken     = getToken ?? (_ => null);
     ReadFile      = readFile ?? ((a, b) => (a, a));
     GetLink       = getLink ?? ((a, b) => a);
     LogInfo       = logInfo ?? ((a, b, c, d) => { });
     LogSuggestion = logSuggestion ?? ((a, b, c, d) => { });
     LogWarning    = logWarning ?? ((a, b, c, d) => { });
     LogError      = logError ?? ((a, b, c, d) => { });
 }