Example #1
0
        /// <summary>
        /// Return a location of the given JSON token `t` in the document `j`.
        /// </summary>
        /// <param name="jsonDoc"></param>
        /// <param name="jsonToken"></param>
        /// <returns>a string in this format `fileName:lineNumber:linePosition`</returns>
        private static string Location(IJsonDocument jsonDoc, JToken jsonToken)
        {
            // up cast.
            IJsonLineInfo x = jsonToken;

            return(x == null ?
                   null :
                   $"{ObjectPath.FileNameNorm(jsonDoc.FileName)}:{x.LineNumber}:{x.LinePosition}");
        }
Example #2
0
 public ComparisonMessage(
     MessageTemplate template,
     ObjectPath path,
     IJsonDocument oldDoc,
     IJsonDocument newDoc,
     Category severity,
     params object[] formatArguments
     )
 {
     Severity = severity;
     Message  = $"{string.Format(CultureInfo.CurrentCulture, template.Message, formatArguments)}";
     Path     = path;
     OldDoc   = oldDoc;
     NewDoc   = newDoc;
     Id       = template.Id;
     Code     = template.Code;
     DocUrl   = $"{DocBaseUrl}{template.Id}.md";
     Mode     = template.Type;
 }
 public DynamicJsonWrapper(IJsonDocument jsonDocument)
 {
     _data = jsonDocument.JsonValue;
 }
 public DynamicJsonWrapper(IJsonDocument jsonDocument)
 {
     _data = jsonDocument.JsonValue;
 }