using System; namespace BlubbFish.Utils { public class Updater { private static Updater instances; private String url; public delegate void UpdateStatus(Boolean hasUpdates, String message); public event UpdateStatus UpdateResult; private Updater() { } /// /// Get Instance of Updater /// public static Updater Instance { get { if(instances == null) { instances = new Updater(); } return instances; } } /// /// Waits for the Result of the Updater thread. /// public void WaitForExit() { throw new NotImplementedException(); } /// /// Set Path to check for Updates /// /// HTTP URI public void SetPath(String url) { this.url = url; } /// /// Check for Updates /// /// public void Check() { if(this.url == "") { throw new ArgumentException("You must set url first."); } if(this.UpdateResult == null) { throw new ArgumentNullException("You must attach an event first."); } } /// /// Update the file /// /// The filename of the targetfile /// The url of the sourcefile /// Updates the Programm after it has been closed /// public Boolean Update(String filename, String url, Boolean afterExit = true) { return true; } } }