public override void CopyFrom(JsonEmptyResult Other) { base.CopyFrom(Other); if (Other is JsonResult <T> ) { this.Result = (Other as JsonResult <T>).Result; } }
public static JsonEmptyResult Execute(Action Func) { JsonEmptyResult lResult = new JsonEmptyResult(); try { if (Func != null) { Func(); } } catch (Exception ex) { lResult.Error = ex.Message; // ErrorHelper.ToDisplayString(ex); //lResult.IsLoginError = ex is SrvLoginException; } return(lResult); }
public override void CopyFrom(JsonEmptyResult Other) { base.CopyFrom(Other); var lOtherType = Other.GetType(); var lPartIndexProp = lOtherType.GetProperty("PartIndex"); var lPartCountProp = lOtherType.GetProperty("PartCount"); if (lPartIndexProp != null) { this.PartIndex = Convert.ToInt32(lPartIndexProp.GetValue(Other, null)); } if (lPartCountProp != null) { this.PartCount = Convert.ToInt32(lPartCountProp.GetValue(Other, null)); } /*if (Other is JsonPartResult<T>) * { * this.PartIndex = (Other as JsonPartResult<T>).PartIndex; * this.PartCount = (Other as JsonPartResult<T>).PartCount; * }*/ }
//[DataMember] //public Boolean IsLoginError { get; set; } //[DataMember] //public String ResultType { get; set; } public virtual void CopyFrom(JsonEmptyResult Other) { this.Error = Other.Error; //this.IsLoginError = Other.IsLoginError; //this.ResultType = Other.ResultType; }