/* ==============================================================================
* 功能描述:
* 创 建 者:Garrett
* 创建日期:2019/5/31 16:24:04
* ==============================================================================*/
using System;
using MBIRevitBase;
namespace ServiceRevitLib.Mode
{
///
/// CheckResultBase
///
public class ResultBase
{
public ResultBase()
{
Result = ResultState.Success;
}
///
/// 异常结果
///
///
///
public static ResultBase Exception(string msg)
{
return new ResultBase(){Result = ResultState.Failure,ResultMsg = msg};
}
///
/// 成功或失败结果描述
///
public string ResultMsg { get; set; }
///
/// 结果
///
public ResultState Result { get; set; }
public static implicit operator ResultBase(BResult result)
{
return new ResultBase()
{
ResultMsg = result.Message,
Result = (ResultState)(Convert.ToInt32(result.IsSuccessed))
};
}
}
}