Ejemplo n.º 1
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;
        }
Ejemplo n.º 2
0
        public MarkdownContext(
            Func <string, string> getToken = null,
            LogActionDelegate logWarning   = null,
            LogActionDelegate logError     = null,
            ReadFileDelegate readFile      = null,
            GetLinkDelegate getLink        = null)
        {
            _getToken = getToken ?? (_ => null);
            ReadFile  = readFile ?? ReadFileDefault;
            GetLink   = getLink ?? ((path, a, b) => path);

            LogWarning = logWarning ?? ((a, b, c, d) => { });
            LogError   = logError ?? ((a, b, c, d) => { });
        }
Ejemplo n.º 3
0
 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) => { });
 }