本文整理汇总了C#中IResult.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# IResult.ToString方法的具体用法?C# IResult.ToString怎么用?C# IResult.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IResult
的用法示例。
在下文中一共展示了IResult.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleResult
protected void HandleResult(IResult result)
{
if (result == null)
{
this.LastResponse = "Null Response\n";
LogView.AddLog(this.LastResponse);
return;
}
this.LastResponseTexture = null;
// Some platforms return the empty string instead of null.
if (!string.IsNullOrEmpty(result.Error))
{
this.Status = "Error - Check log for details";
this.LastResponse = "Error Response:\n" + result.Error;
}
else if (result.Cancelled)
{
this.Status = "Cancelled - Check log for details";
this.LastResponse = "Cancelled Response:\n" + result.RawResult;
}
else if (!string.IsNullOrEmpty(result.RawResult))
{
this.Status = "Success - Check log for details";
this.LastResponse = "Success Response:\n" + result.RawResult;
}
else
{
this.LastResponse = "Empty Response\n";
}
LogView.AddLog(result.ToString());
}
示例2: MathWorkspaceItem
public MathWorkspaceItem(string strExp, IResult result)
{
this.strExp = strExp;
this.result = result;
this.answer = result.ToString();
}
示例3: IsSuccess
/// <summary>
/// 判断一个返回结果是否成功。如果失败,将会弹出异常信息。
/// </summary>
/// <param name="owner">控件拥有者。</param>
/// <param name="result">返回结果。</param>
/// <param name="prefix">前缀内容。</param>
/// <param name="suffix">后缀内容。</param>
/// <returns>返回结果的状态。</returns>
public static bool IsSuccess(this Control owner, IResult result, string prefix, string suffix = null)
{
if (result != null)
{
if (result.IsSucceed) return true;
Msg.ShowError(owner, prefix + result.ToString() + suffix);
}
return false;
}