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