示例#1
0
 public override void CopyFrom(JsonEmptyResult Other)
 {
     base.CopyFrom(Other);
     if (Other is JsonResult <T> )
     {
         this.Result = (Other as JsonResult <T>).Result;
     }
 }
示例#2
0
        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);
        }
示例#3
0
        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;
             * }*/
        }
示例#4
0
        //[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;
        }