using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using NetMonitorTray.Properties; using BlubbFish.Utils; namespace NetMonitorTray.Models { public class Window : OwnModel { private InIReader networkfile; private Window() { this.init(); } override protected void init() { this.networkfile = InIReader.getInstance("network.ini"); } /// /// Listet alle Netzwerke auf /// public List Networks { get { return this.networkfile.getSections(); } } public string getNetworkProperty(string network, string property) { return this.networkfile.getValue(network, property); } /// /// Fügt ein neues Netzwerk hinzu /// /// Netzwerkid /// true if added, false if error public bool addNetwork(string name) { if (this.networkfile.addSection(name)) { this.update(); return true; } return false; } /// /// Löscht ein Netzwerk /// /// Netzwerkid /// true if deleted, false if error public bool removeNetwork(string name) { if (this.networkfile.removeSection(name)) { this.update(); return true; } return false; } } }