SetResult() public method

public SetResult ( Newtonsoft.Json.Linq.JArray result ) : void
result Newtonsoft.Json.Linq.JArray
return void
Example #1
0
        private void notifyResultError(string @ref, ResultStatus resultStatus, string errorMsg, Action<HMessage> messageDelegate)
        {
            JObject obj = new JObject();
            obj["errorMsg"] = errorMsg;

            HResult result = new HResult();
            result.SetStatus(resultStatus);
            result.SetResult(obj);

            HMessage message = new HMessage();
            message.SetRef(@ref);
            message.SetType("hResult");
            message.SetPayload(result);

            this.notifyMessage(message, messageDelegate);
        }
Example #2
0
        //---private methods---
        private HMessage InnerBuildResult(string actor, string @ref, ResultStatus? status, JToken result, HMessageOptions mOptions)
        {
            if (actor == null || actor.Length <= 0)
                throw new MissingAttrException("actor");
            if (@ref == null || @ref.Length <= 0)
                throw new MissingAttrException("ref");
            if (status == null)
                throw new MissingAttrException("status");

            HResult hResult = new HResult();
            hResult.SetResult(result);
            hResult.SetStatus(status);
            if (mOptions == null)
                mOptions = new HMessageOptions();
            mOptions.Ref = @ref;

            return BuildMessage(actor, "hResult", hResult, mOptions);
        }