private void _updateSearchWorker_DoWork(object sender, DoWorkEventArgs e) { try { var schedueller = new ScheduledStart( _updateSettings.ProjektID, _updateSettings.Updateinterval, _updateSettings.CustomUpdateInterval); if (!schedueller.CanCheck()) { e.Result = new UpdateResult( new List<updatePackage>(), new updateConfiguration(), new changelogDictionary()); return; } //Searchprovider initialisieren var sProvider = new searchProvider(this); //Updatesuche durchführen sProvider.executeSearch(); schedueller.WriteCurrentDate(); //Result zurückgeben e.Result = new UpdateResult( sProvider.foundUpdates, sProvider.currentConfiguration, sProvider.correspondingChangelogs); } catch (Exception ex) { e.Result = ex; } }
/// <summary> /// <para>Sucht nach verfügbaren Aktualisierungen.</para> /// <para>Informationen über die Updates können über die Eigenschaft <see cref="currentUpdateResult"/> abgerufen werden.</para> /// </summary> /// <returns>Gibt true zurück wenn ein Update gefunden wurde, andernfalls false.</returns> public bool checkForUpdates() { var schedueller = new ScheduledStart( _updateSettings.ProjektID, _updateSettings.Updateinterval, _updateSettings.CustomUpdateInterval); if (!schedueller.CanCheck()) { return false; } //Updatesuche vorbereiten prepareUpdateCheck(); //Suchprovider initialisieren var sProvider = new searchProvider(this); //Updatesuche durchführen sProvider.executeSearch(); schedueller.WriteCurrentDate(); //Ergebnis auswerten if (sProvider.foundUpdates.Count > 0) { currentUpdateResult = new UpdateResult( sProvider.foundUpdates, sProvider.currentConfiguration, sProvider.correspondingChangelogs); return true; } currentUpdateResult = new UpdateResult(new List<updatePackage>(), sProvider.currentConfiguration, new changelogDictionary()); return false; }