예제 #1
0
        /// <summary>
        /// If payload type is HConvState.
        /// </summary>
        /// <returns>The payload of HConvState type.</returns>
        public HConvState GetPayloadAsHConvState()
        {
            HConvState payload = null;

            try
            {
                payload = new HConvState(JObject.Parse(this["payload"].ToString()));
            }
            catch (Exception e)
            {
                Debug.WriteLine("{0} : Can not fetch the payload attribute", e.ToString());
            }
            return(payload);
        }
예제 #2
0
 public void SetPayload(HConvState payload)
 {
     try
     {
         if (payload == null)
         {
             this.Remove("payload");
         }
         else
         {
             this["payload"] = payload;
         }
     }
     catch (Exception e)
     {
         Debug.WriteLine("{0} : Can not update the payload attribute", e.ToString());
     }
 }
예제 #3
0
 public HMessage BuildMessage(string actor, string type, HConvState payload, HMessageOptions mOptions)
 {
     return InnerBuildMessage(actor, type, payload, mOptions);
 }
예제 #4
0
        /// <summary>
        /// The client MUST be connected to access to this service.
        /// Allow a hubapp client to create a hMessage with a hConvState payload.
        /// </summary>
        /// <param name="actor"></param>
        /// <param name="convid"></param>
        /// <param name="status"></param>
        /// <param name="mOptions"></param>
        /// <returns></returns>
        public HMessage BuildConvState(string actor, string convid, string status, HMessageOptions mOptions)
        {
            if (actor == null || actor.Length <= 0)
                throw new MissingAttrException("actor");
            if (convid == null || convid.Length <= 0)
                throw new MissingAttrException("convid");
            if (status == null || status.Length <= 0)
                throw new MissingAttrException("status");

            HConvState convState = new HConvState();
            convState.SetStatus(status);

            HMessage message = BuildMessage(actor, "hConvState", convState, mOptions);
            message.SetConvid(convid);
            return message;
        }
예제 #5
0
 public void SetPayload(HConvState payload)
 {
     try
     {
         if (payload == null)
         {
             this.Remove("payload");
         }
         else
         {
             this["payload"] = payload;
         }
     }
     catch (Exception e)
     {
         Debug.WriteLine("{0} : Can not update the payload attribute", e.ToString());
     }
 }
예제 #6
0
 /// <summary>
 /// If payload type is HConvState.
 /// </summary>
 /// <returns>The payload of HConvState type.</returns>
 public HConvState GetPayloadAsHConvState()
 {
     HConvState payload = null;
     try
     {
         payload = new HConvState(JObject.Parse(this["payload"].ToString()));
     }
     catch (Exception e)
     {
         Debug.WriteLine("{0} : Can not fetch the payload attribute", e.ToString());
     }
     return payload;
 }