예제 #1
0
파일: AOPResult.cs 프로젝트: mer2/devfx
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="resultNo">返回代码</param>
 /// <param name="resultDescription">对应的描述信息</param>
 /// <param name="resultAttachObject">相应的附加信息</param>
 /// <param name="innerAOPResult">内部AOPResult</param>
 public AOPResult(int resultNo, string resultDescription, object resultAttachObject, AOPResult innerAOPResult)
 {
     this.resultNo = resultNo;
     this.resultDescription = resultDescription;
     this.resultAttachObject = resultAttachObject;
     this.innerAOPResult = innerAOPResult;
 }
예제 #2
0
 public void TestAOPResultConverting()
 {
     var ap = new AOPResult<int>();
     var ap1 = (IAOPResult<int>)ap;
     AOPResult aop = ap;
     aop.ResultAttachObject = 1F;
     Assert.IsTrue(aop.ResultAttachObject is int);
     Assert.IsTrue(ap1.ResultAttachObjectEx == 1);
 }
예제 #3
0
파일: AOPResult.cs 프로젝트: cash2one/devfx
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="resultNo">返回代码</param>
 /// <param name="resultDescription">对应的描述信息</param>
 /// <param name="resultAttachObject">相应的附加信息</param>
 /// <param name="innerAOPResult">内部AOPResult</param>
 public AOPResult(int resultNo, string resultDescription, object resultAttachObject, AOPResult innerAOPResult)
 {
     this.resultNo           = resultNo;
     this.resultDescription  = resultDescription;
     this.resultAttachObject = resultAttachObject;
     this.innerAOPResult     = innerAOPResult;
 }
예제 #4
0
 /// <summary>
 /// 把<c>IAOPResult&lt;Q&gt;</c>转换成<c>IAOPResult&lt;P&gt;</c>
 /// </summary>
 /// <typeparam name="Q">附加的泛型</typeparam>
 /// <typeparam name="P">附加的泛型</typeparam>
 /// <param name="result">待转换的<c>IAOPResult&lt;T&gt;</c></param>
 /// <returns>转换后的<c>IAOPResult&lt;T&gt;</c></returns>
 public static IAOPResult <P> ToAOPResult <Q, P>(this IAOPResult <Q> result)
 {
     return(AOPResult.Create(result.ResultNo, result.ResultDescription, default(P), result, result.GetResultData()));
 }
예제 #5
0
 /// <summary>
 /// 把<c>IAOPResult&lt;Q&gt;</c>转换成<c>IAOPResult&lt;P&gt;</c>,其中<typeparamref name="Q"/>从<typeparamref name="P"/>派生
 /// </summary>
 /// <typeparam name="Q">附加的泛型</typeparam>
 /// <typeparam name="P">附加的泛型</typeparam>
 /// <param name="result">待转换的<c>IAOPResult&lt;T&gt;</c></param>
 /// <returns>转换后的<c>IAOPResult&lt;T&gt;</c></returns>
 public static IAOPResult <P> CovertTo <Q, P>(this IAOPResult <Q> result) where Q : P
 {
     return(AOPResult.Create <P>(result.ResultNo, result.ResultDescription, result.ResultAttachObjectEx, result, result.GetResultData()));
 }