masscheckin ganz viel kram

This commit is contained in:
2015-11-16 00:10:59 +00:00
parent 8264cbfa7b
commit dfc14d9c36
45 changed files with 1862 additions and 834 deletions
+72 -57
View File
@@ -6,63 +6,78 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using NetMonitorTray.Properties;
using BlubbFish.Utils;
using NetMonitorUtils;
namespace NetMonitorTray.Models
{
public class Window : OwnModel<Window>
{
private InIReader networkfile;
private Window()
{
this.init();
}
override protected void init()
{
this.networkfile = InIReader.getInstance("network.ini");
}
/// <summary>
/// Listet alle Netzwerke auf
/// </summary>
public List<string> Networks
{
get { return this.networkfile.getSections(); }
}
public string getNetworkProperty(string network, string property)
{
return this.networkfile.getValue(network, property);
}
/// <summary>
/// Fügt ein neues Netzwerk hinzu
/// </summary>
/// <param name="name">Netzwerkid</param>
/// <returns>true if added, false if error</returns>
public bool addNetwork(string name)
{
if (this.networkfile.addSection(name))
{
this.update();
return true;
}
return false;
}
/// <summary>
/// Löscht ein Netzwerk
/// </summary>
/// <param name="name">Netzwerkid</param>
/// <returns>true if deleted, false if error</returns>
public bool removeNetwork(string name)
{
if (this.networkfile.removeSection(name))
{
this.update();
return true;
}
return false;
}
namespace NetMonitorTray.Models {
public class Window : OwnModel<Window> {
private InIReader networkfile;
private InIReader vpnfile;
private InIReader settingsfile;
private NetworkSetter networksetter;
private Window() {
this.init();
}
override protected void init() {
this.networkfile = InIReader.getInstance("network.ini");
this.vpnfile = InIReader.getInstance("vpn.ini");
this.settingsfile = InIReader.getInstance("config.ini");
this.networksetter = new NetworkSetter("network.ini", "config.ini");
}
/// <summary>
/// Listet alle Netzwerke auf
/// </summary>
public List<string> Networks {
get { return this.networkfile.getSections(); }
}
public List<string> Vpns {
get { return this.vpnfile.getSections(); }
}
/// <summary>
/// Fügt ein neues Netzwerk hinzu
/// </summary>
/// <param name="name">Netzwerkid</param>
/// <returns>true if added, false if error</returns>
public bool addNetwork(string name) {
if(this.networkfile.addSection(name)) {
this.update();
return true;
}
return false;
}
/// <summary>
/// Löscht ein Netzwerk
/// </summary>
/// <param name="name">Netzwerkid</param>
/// <returns>true if deleted, false if error</returns>
public bool removeNetwork(string name) {
if(this.networkfile.removeSection(name)) {
this.update();
return true;
}
return false;
}
internal string getVpnProperty(string vpn, string property) {
return this.vpnfile.getValue(vpn, property);
}
public string getNetworkProperty(string network, string property) {
return this.networkfile.getValue(network, property);
}
public string getSettingsProperty(string setting, string property) {
return this.settingsfile.getValue(setting, property);
}
public List<string> getNetworkAdapters() {
return this.networksetter.getAdapters();
}
}
}