Example #1
0
        protected virtual void OnUpdateCheckSuccess(UpdateInformation information)
        {
            var evt = UpdateCheckCompleted;

            if (evt != null)
            {
                evt(this, new UpdateCheckCompletedEventArgs {
                    Success     = true,
                    Information = information
                });
            }
        }
Example #2
0
        /// <summary>
        /// Asynchronous callback that handles the update check request.
        /// </summary>
        private void CheckForUpdateCallback(IAsyncResult result)
        {
            if (_checkRequest == null)
            {
                return;
            }

            try {
                var response = _checkRequest.EndGetResponse(result);
                LastInformation = ParseUpdateCheckResponse(response.GetResponseStream());

                OnUpdateCheckSuccess(LastInformation);
            }
            catch (Exception ex) {
                OnUpdateCheckError(ex);
            }

            _checkRequest = null;
        }
 protected virtual void OnUpdateCheckSuccess(UpdateInformation information)
 {
     var evt = UpdateCheckCompleted;
     if (evt != null) {
         evt(this, new UpdateCheckCompletedEventArgs {
             Success = true,
             Information = information
         });
     }
 }
 public static string Serialize(UpdateInformation information)
 {
     var serializer = new XmlSerializer(typeof(UpdateInformation));
     var sb = new StringBuilder();
     using(var writer = new StringWriter(sb)){
         serializer.Serialize(writer, information);
     }
     return sb.ToString();
 }