当前位置: 首页>>代码示例>>C#>>正文


C# IJsonLineInfo.HasLineInfo方法代码示例

本文整理汇总了C#中IJsonLineInfo.HasLineInfo方法的典型用法代码示例。如果您正苦于以下问题:C# IJsonLineInfo.HasLineInfo方法的具体用法?C# IJsonLineInfo.HasLineInfo怎么用?C# IJsonLineInfo.HasLineInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IJsonLineInfo的用法示例。


在下文中一共展示了IJsonLineInfo.HasLineInfo方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FormatMessage

        internal static string FormatMessage(IJsonLineInfo lineInfo, string path, string message)
        {
            if (!message.EndsWith(Environment.NewLine, StringComparison.Ordinal))
            {
                message = message.Trim();

                if (!message.EndsWith('.'))
                    message += ".";
            }

            if (path == null && !lineInfo.HasLineInfo())
                return message;

            message += " ";

            if (path != null)
            {
                message += "Path '{0}'".FormatWith(CultureInfo.InvariantCulture, path);

                if (lineInfo != null && lineInfo.HasLineInfo())
                    message += ", line {0}, position {1}".FormatWith(CultureInfo.InvariantCulture, lineInfo.LineNumber, lineInfo.LinePosition);
            }
            else
            {
                message += "Line {0}, position {1}".FormatWith(CultureInfo.InvariantCulture, lineInfo.LineNumber, lineInfo.LinePosition);
            }

            message += ".";
            return message;
        }
开发者ID:Nangal,项目名称:Newtonsoft.Json.Schema,代码行数:30,代码来源:JSchemaException.cs

示例2: FormatExceptionMessage

 internal static string FormatExceptionMessage(IJsonLineInfo lineInfo, string path, string message)
 {
   if (!message.EndsWith(Environment.NewLine))
   {
     message = message.Trim();
     if (!message.EndsWith("."))
       message = message + ".";
     message = message + " ";
   }
   message = message + StringUtils.FormatWith("Path '{0}'", (IFormatProvider) CultureInfo.InvariantCulture, (object) path);
   if (lineInfo != null && lineInfo.HasLineInfo())
     message = message + StringUtils.FormatWith(", line {0}, position {1}", (IFormatProvider) CultureInfo.InvariantCulture, (object) lineInfo.LineNumber, (object) lineInfo.LinePosition);
   message = message + ".";
   return message;
 }
开发者ID:Zeludon,项目名称:FEZ,代码行数:15,代码来源:JsonException.cs

示例3: FormatMessage

        internal static string FormatMessage(IJsonLineInfo lineInfo, string path, string message)
        {
            // don't add a fullstop and space when message ends with a new line
            if (!message.EndsWith(Environment.NewLine))
            {
                message = message.Trim();

                if (!message.EndsWith(".", StringComparison.Ordinal))
                    message += ".";

                message += " ";
            }

            message += "Path '{0}'".FormatWith(CultureInfo.InvariantCulture, path);

            if (lineInfo != null && lineInfo.HasLineInfo())
                message += ", line {0}, position {1}".FormatWith(CultureInfo.InvariantCulture, lineInfo.LineNumber, lineInfo.LinePosition);

            message += ".";

            return message;
        }
开发者ID:925coder,项目名称:Newtonsoft.Json,代码行数:22,代码来源:JsonPosition.cs

示例4: Create

        internal static JsonReaderException Create(IJsonLineInfo lineInfo, string path, string message, Exception ex)
        {
            message = JsonPosition.FormatMessage(lineInfo, path, message);

            int lineNumber;
            int linePosition;
            if (lineInfo != null && lineInfo.HasLineInfo())
            {
                lineNumber = lineInfo.LineNumber;
                linePosition = lineInfo.LinePosition;
            }
            else
            {
                lineNumber = 0;
                linePosition = 0;
            }

            return new JsonReaderException(message, ex, path, lineNumber, linePosition);
        }
开发者ID:cilliemalan,项目名称:Cargo,代码行数:19,代码来源:JsonReaderException.cs

示例5: FormatExceptionMessage

    internal static string FormatExceptionMessage(IJsonLineInfo lineInfo, string message)
    {
      if (!message.EndsWith("."))
        message += ".";

      if (lineInfo != null && lineInfo.HasLineInfo())
        message += " Line {0}, position {1}.".FormatWith(CultureInfo.InvariantCulture, lineInfo.LineNumber, lineInfo.LinePosition);

      return message;
    }
开发者ID:pvasek,项目名称:Newtonsoft.Json,代码行数:10,代码来源:JsonReader.cs

示例6: CreateReaderException

    internal JsonReaderException CreateReaderException(IJsonLineInfo lineInfo, string message, Exception ex)
    {
      message = FormatExceptionMessage(lineInfo, message);

      int lineNumber;
      int linePosition;
      if (lineInfo != null && lineInfo.HasLineInfo())
      {
        lineNumber = lineInfo.LineNumber;
        linePosition = lineInfo.LinePosition;
      }
      else
      {
        lineNumber = 0;
        linePosition = 0;
      }

      return new JsonReaderException(message, ex, lineNumber, linePosition);
    }
开发者ID:bitpusher,项目名称:Newtonsoft.Json4,代码行数:19,代码来源:JsonReader.cs

示例7: FormatExceptionMessage

        internal static string FormatExceptionMessage(IJsonLineInfo lineInfo, string path, string message)
        {
            // don't add a fullstop and space when message ends with a new line
            if (!message.EndsWith(Environment.NewLine))
            {
                message = message.Trim();

                if (!message.EndsWith("."))
                    message += ".";

                message += " ";
            }

            message += string.Format("Path '{0}'", path);

            if (lineInfo != null && lineInfo.HasLineInfo())
                message += string.Format(", line {0}, position {1}", lineInfo.LineNumber, lineInfo.LinePosition);

            message += ".";

            return message;
        }
开发者ID:artikh,项目名称:CouchDude,代码行数:22,代码来源:SystemJsonValueReader.cs

示例8: FormatExceptionMessage

    internal static string FormatExceptionMessage(IJsonLineInfo lineInfo, string path, string message)
    {
      message = message.Trim();

      if (!message.EndsWith("."))
        message += ".";

      message += " Path '{0}'".FormatWith(CultureInfo.InvariantCulture, path);

      if (lineInfo != null && lineInfo.HasLineInfo())
        message += ", line {0}, position {1}".FormatWith(CultureInfo.InvariantCulture, lineInfo.LineNumber, lineInfo.LinePosition);

      message += ".";

      return message;
    }
开发者ID:leesanghyun2,项目名称:mp-onlinevideos2,代码行数:16,代码来源:JsonReaderException.cs


注:本文中的IJsonLineInfo.HasLineInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。