Exemple #1
0
        private bool ParseHomePageResponse(string resp)
        {
            try
            {
                using (MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(resp)))
                {
                    var ser = new DataContractJsonSerializer(typeof(Responses.Home.HomeResponse));
                    Responses.Home.HomeResponse response = (ser.ReadObject(stream) as Responses.Home.HomeResponse);

                    Events.OnHandleHomePageResponse(response);

                    return(true);
                }
            }
            catch (Exception ex)
            {
                Events.OnErrorOccurred(ex.Message);
            }

            return(false);
        }
Exemple #2
0
 internal void OnHandleHomePageResponse(Responses.Home.HomeResponse obj) => EventHomePageResponse?.Invoke(this, new HomePageEventArgs()
 {
     HomeResponse = obj
 });