diff --git a/Utils/OwnView.cs b/Utils/OwnView.cs
index 102e1a5..ae3285e 100644
--- a/Utils/OwnView.cs
+++ b/Utils/OwnView.cs
@@ -4,21 +4,23 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
-namespace BlubbFish.Utils
-{
- public abstract class OwnView
- {
+namespace BlubbFish.Utils {
+ public abstract class OwnView {
+
+ protected OwnView() {
+ this.Init();
+ }
///
/// Called if the Oberver (Model) updates its View
///
- abstract public void Update();
+ public abstract void Update();
///
/// Called if view is viewed
///
- abstract protected void Init();
+ protected abstract void Init();
///
/// Called if Form is Disposed
///
- abstract public void Dispose();
+ public abstract void Dispose();
}
}
diff --git a/Utils/Updater.cs b/Utils/Updater.cs
index 3a736b3..4a7a776 100644
--- a/Utils/Updater.cs
+++ b/Utils/Updater.cs
@@ -1,10 +1,12 @@
using System;
+using System.IO;
namespace BlubbFish.Utils {
- public class Updater {
+ public class Updater : OwnObject {
private static Updater instances;
private String url;
+ private String[] versions;
public class UpdaterEventArgs : EventArgs {
public UpdaterEventArgs(Boolean hasUpdates, String message) {
@@ -45,8 +47,18 @@ namespace BlubbFish.Utils {
/// Set Path to check for Updates
///
/// HTTP URI
- public void SetPath(String url) {
+ public void SetPath(String url, String[] versions) {
this.url = url;
+ this.versions = versions;
+ StreamWriter file = new StreamWriter("version.txt");
+ file.BaseStream.SetLength(0);
+ file.BaseStream.Flush();
+ file.BaseStream.Seek(0, SeekOrigin.Begin);
+ foreach (String version in versions) {
+ file.WriteLine(version);
+ }
+ file.Flush();
+ file.Close();
}
///
@@ -57,6 +69,9 @@ namespace BlubbFish.Utils {
if(this.url == "") {
throw new ArgumentException("You must set url first.");
}
+ if(this.versions.Length == 0) {
+ throw new ArgumentException("You must set a Version number first.");
+ }
if(this.UpdateResult == null) {
throw new ArgumentNullException("You must attach an event first.");
}