Exemple #1
0
 public async Task SetAlertSettingsAsync(YouMailAlerts alerts)
 {
     try
     {
         AddPendingOp();
         if (await LoginWaitAsync())
         {
             var content = SerializeObjectToHttpContent(alerts, YMST.c_alertSettings);
             using (var response = await YouMailApiAsync(YMST.c_alertSettingsUrl, content, HttpMethod.Put))
             {
             }
         }
     }
     finally
     {
         RemovePendingOp();
     }
 }
Exemple #2
0
        /// <summary>
        /// Get the YouMail alert settings
        /// </summary>
        /// <returns></returns>
        public async Task <YouMailAlerts> GetAlertSettingsAsync()
        {
            try
            {
                AddPendingOp();
                YouMailAlerts returnValue = null;
                if (await LoginWaitAsync())
                {
                    using (var response = await YouMailApiAsync(YMST.c_alertSettingsUrl, null, HttpMethod.Get))
                    {
                        returnValue = DeserializeObject <YouMailAlerts>(response.GetResponseStream(), YMST.c_alertSettings);
                    }
                }

                return(returnValue);
            }
            finally
            {
                RemovePendingOp();
            }
        }