Ejemplo n.º 1
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));
        }
Ejemplo n.º 2
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);
        }