protected virtual void OnUpdateCheckSuccess(UpdateInformation information) { var evt = UpdateCheckCompleted; if (evt != null) { evt(this, new UpdateCheckCompletedEventArgs { Success = true, Information = information }); } }
/// <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; }
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(); }