public static void CheckForUpdates(bool automaticMode, Action <Action> doRequestAction = null) { RequestObject updateRequest = new RequestObject { WebRequest = WebRequest.CreateHttp(App.VERSIONS_URL), Parameter = automaticMode, DoRequestAction = doRequestAction, OnSuccess = ReadUpdateResponseStream, OnFailure = ro => { if ((ro.Parameter as bool?) == false) { MessageBox.Show($"Update URL \"{App.VERSIONS_URL}\" could not be opened.", "Network error", MessageBoxButton.OK, MessageBoxImage.Error); } } }; updateRequest.BeginGetResponse(ResponseReceived); }