예제 #1
0
 public void SetLocation(HLocation location)
 {
     try
     {
         if (location == null)
         {
             this.Remove("location");
         }
         else
         {
             this["location"] = location;
         }
     }
     catch (Exception e)
     {
         Debug.WriteLine("{0} : Can not update the location attribute", e.ToString()); ;
     }
 }
예제 #2
0
 /// <summary>
 /// The geographical location to which the message refer. NULL if undefined
 /// </summary>
 /// <returns></returns>
 public HLocation GetLocation()
 {
     HLocation location = null;
     try
     {
         location = new HLocation(JObject.Parse(this["location"].ToString()));
     }
     catch (Exception e)
     {
         Debug.WriteLine("{0} : Can not fetch the location attribute", e.ToString());
     }
     return location;
 }