本文整理汇总了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;未经允许,请勿转载。 |
请发表评论