本文整理汇总了C#中Errors.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Errors.ToString方法的具体用法?C# Errors.ToString怎么用?C# Errors.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Errors
的用法示例。
在下文中一共展示了Errors.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReportError
internal void ReportError(ExplorerNode node, Errors error)
{
ErrorNode parent = (ErrorNode)this[error.ToString()];
if (parent == null)
parent = new ErrorNode(this, error.ToString(), getMessage(error));
Activator.CreateInstance(node.GetType(), (ExplorerNode)parent, node);
}
示例2: When_ToString_is_called_and_the_errors_are_not_initialized_then_the_result_contains_an_empty_string
public void When_ToString_is_called_and_the_errors_are_not_initialized_then_the_result_contains_an_empty_string()
{
var errors = new Errors();
var errorsString = errors.ToString();
Assert.IsTrue(string.IsNullOrEmpty(errorsString));
}
示例3: CreateAndLogError
/// <summary>
/// Creates and Logs the error context information for the occurred error
/// </summary>
/// <param name="error">Error code</param>
/// <param name="method">Method where the error occurred</param>
/// <param name="additionalInfo">Additional information for the error</param>
/// <param name="exception">Inner Exception</param>
/// <param name="descriptionParameters">Description Parameters</param>
/// <param name="additionalDescriptionParameters">Additional Description Parameters</param>
/// <param name="shortName">Shortname of the business error occured for</param>
/// <param name="arguments">Arguments to log of the method where the error occurred</param>
/// <returns>Error context information</returns>
public static ErrorContextInformation CreateAndLogError(Errors error, string method, string additionalInfo = null, Exception exception = null,
object[] descriptionParameters = null, object[] additionalDescriptionParameters = null, string shortName = "", params object[] arguments)
{
return new ErrorContextInformation(error.ToString(), error.GetDescription(descriptionParameters), method,
additionalInformation: string.IsNullOrEmpty(additionalInfo)
? error.GetAdditionalDescription(additionalDescriptionParameters)
: (additionalDescriptionParameters == null
? additionalInfo
: string.Format(additionalInfo, additionalDescriptionParameters)),
innerException: exception, shortName: shortName, arguments: arguments);
}
示例4: RequestException
/// <summary>
/// new
/// </summary>
/// <param name="error"></param>
/// <param name="cmdName"></param>
public RequestException(Errors error)
: base(string.Concat("errorType:", error.ToString(),string.Empty))
{
this.Error = error;
}
示例5: RequestException
/// <summary>
/// new
/// </summary>
/// <param name="error"></param>
/// <param name="cmdName"></param>
public RequestException(Errors error, string cmdName)
: base(string.Concat("errorType:", error.ToString(), " cmdName:", cmdName ?? string.Empty))
{
this.Error = error;
}