• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IJsonLineInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: WithLineInfo

        private PackageSpecFormatException WithLineInfo(IJsonLineInfo lineInfo)
        {
            Line = lineInfo.LineNumber;
            Column = lineInfo.LinePosition;

            return this;
        }
开发者ID:eerhardt,项目名称:NuGet3,代码行数:7,代码来源:PackageSpecFormatException.cs


示例2: CreateError

        protected ValidationError CreateError(string message, ErrorType errorType, JSchema schema, object value, IList<ValidationError> childErrors, IJsonLineInfo lineInfo, string path)
        {
            if (_schemaDiscovery == null)
            {
                _schemaDiscovery = new JSchemaDiscovery();
                _schemaDiscovery.Discover(Schema, null);
            }

            ValidationError error = new ValidationError();
            error.Message = message;
            error.ErrorType = errorType;
            error.Path = path;
            if (lineInfo != null)
            {
                error.LineNumber = lineInfo.LineNumber;
                error.LinePosition = lineInfo.LinePosition;
            }
            error.Schema = schema;
            error.SchemaId = _schemaDiscovery.KnownSchemas.Single(s => s.Schema == schema).Id;
            error.SchemaBaseUri = schema.BaseUri;
            error.Value = value;
            error.ChildErrors = childErrors;

            return error;
        }
开发者ID:Nangal,项目名称:Newtonsoft.Json.Schema,代码行数:25,代码来源:Validator.cs


示例3: 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


示例4: WithLineInfo

        private FileFormatException WithLineInfo(IJsonLineInfo lineInfo)
        {
            if (lineInfo != null)
            {
                Line = lineInfo.LineNumber;
                Column = lineInfo.LinePosition;
            }

            return this;
        }
开发者ID:elanwu123,项目名称:dnx,代码行数:10,代码来源:FileFormatException.cs


示例5: CreateError

        protected ValidationError CreateError(string message, ErrorType errorType, JSchema schema, object value, IList<ValidationError> childErrors, IJsonLineInfo lineInfo, string path)
        {
            if (_schemaDiscovery == null)
            {
                _schemaDiscovery = new JSchemaDiscovery();
                _schemaDiscovery.Discover(Schema, null);
            }

            Uri schemaId = _schemaDiscovery.KnownSchemas.Single(s => s.Schema == schema).Id;

            ValidationError error = ValidationError.CreateValidationError(message, errorType, schema, schemaId, value, childErrors, lineInfo, path);

            return error;
        }
开发者ID:rynnwang,项目名称:Newtonsoft.Json.Schema,代码行数:14,代码来源:Validator.cs


示例6: 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


示例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 += "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:ByteSempai,项目名称:Ubiquitous,代码行数:22,代码来源:JsonException.cs


示例8: 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


示例9: SetLineInfo

 internal void SetLineInfo(IJsonLineInfo lineInfo)
 {
     _lineNumber = lineInfo.LineNumber;
     _linePosition = lineInfo.LinePosition;
 }
开发者ID:rynnwang,项目名称:Newtonsoft.Json.Schema,代码行数:5,代码来源:JSchema.cs


示例10: 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


示例11: CreateValidationError

 internal static ValidationError CreateValidationError(IFormattable message, ErrorType errorType, JSchema schema, Uri schemaId, object value, IList<ValidationError> childErrors, IJsonLineInfo lineInfo, string path)
 {
     ValidationError error = new ValidationError();
     error._formattable = message;
     error.ErrorType = errorType;
     error.Path = path;
     if (lineInfo != null)
     {
         error.LineNumber = lineInfo.LineNumber;
         error.LinePosition = lineInfo.LinePosition;
     }
     error.Schema = schema;
     error.SchemaId = schemaId;
     error.SchemaBaseUri = schema.BaseUri;
     error.Value = value;
     error.ChildErrors = childErrors;
     return error;
 }
开发者ID:Pondidum,项目名称:Newtonsoft.Json.Schema,代码行数:18,代码来源:ValidationError.cs


示例12: JsonResolveLinkContext

 public JsonResolveLinkContext (Type type, JsonSerializer serializer, IJsonLineInfo lineInfo)
 {
     Type = type;
     Serializer = serializer;
     LineInfo = lineInfo;
 }
开发者ID:binki,项目名称:Alba.Framework,代码行数:6,代码来源:JsonResolveLinkContext.cs


示例13: 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


示例14: Create

 internal static JSchemaReaderException Create(IJsonLineInfo lineInfo, Uri baseUri, string path, string message)
 {
     return Create(lineInfo, baseUri, path, message, null);
 }
开发者ID:Pondidum,项目名称:Newtonsoft.Json.Schema,代码行数:4,代码来源:JSchemaReaderException.cs


示例15: CreateError

        protected ValidationError CreateError(IFormattable message, ErrorType errorType, JSchema schema, object value, IList<ValidationError> childErrors, IJsonLineInfo lineInfo, string path)
        {
            ValidationError error = ValidationError.CreateValidationError(message, errorType, schema, null, value, childErrors, lineInfo, path);

            return error;
        }
开发者ID:bmperdue,项目名称:Newtonsoft.Json.Schema,代码行数:6,代码来源:Validator.cs


示例16: Create

 // Token: 0x060007DA RID: 2010
 // RVA: 0x0000AA6C File Offset: 0x00008C6C
 internal static JsonSerializationException Create(IJsonLineInfo lineInfo, string path, string message, Exception ex)
 {
     message = JsonPosition.FormatMessage(lineInfo, path, message);
     return new JsonSerializationException(message, ex);
 }
开发者ID:newchild,项目名称:Project-DayZero,代码行数:7,代码来源:JsonSerializationException.cs


示例17: CreateSerializationException

    private JsonSerializationException CreateSerializationException(IJsonLineInfo lineInfo, string message, Exception ex)
    {
      message = JsonReader.FormatExceptionMessage(lineInfo, message);

      return new JsonSerializationException(message, ex);
    }
开发者ID:bladefist,项目名称:Newtonsoft.Json,代码行数:6,代码来源:JsonSerializerInternalReader.cs


示例18: 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类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IJsonSerializer类代码示例发布时间:2022-05-24
下一篇:
C# IJsonClassGeneratorConfig类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap