Exemplo n.º 1
0
 public void SetPayload(HResult 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());
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// If payload type is HResult.
 /// </summary>
 /// <returns>The payload of HResult type.</returns>
 public HResult GetPayloadAsHResult()
 {
     HResult payload = null;
     try
     {
         payload = new HResult(JObject.Parse(this["payload"].ToString()));
     }
     catch (Exception e)
     {
         Debug.WriteLine("{0} : Can not fetch the payload attribute", e.ToString());
     }
     return payload;
 }