AnlageIP adresse kann nun im Menu geändert werden
This commit is contained in:
@@ -28,6 +28,7 @@ namespace SanShared
|
|||||||
this.FirmCode = 103086;
|
this.FirmCode = 103086;
|
||||||
this.ProductCode = ProductCode;
|
this.ProductCode = ProductCode;
|
||||||
#else
|
#else
|
||||||
|
return;
|
||||||
this.FirmCode = 10;
|
this.FirmCode = 10;
|
||||||
this.ProductCode = 1;
|
this.ProductCode = 1;
|
||||||
#endif
|
#endif
|
||||||
@@ -101,6 +102,9 @@ namespace SanShared
|
|||||||
|
|
||||||
public void CleanDongle()
|
public void CleanDongle()
|
||||||
{
|
{
|
||||||
|
#if DEBUG
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
cmApi.CmRelease(hcmse);
|
cmApi.CmRelease(hcmse);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,7 +146,7 @@ namespace SanShared
|
|||||||
|
|
||||||
public bool IsLicensed(byte neededMask)
|
public bool IsLicensed(byte neededMask)
|
||||||
{
|
{
|
||||||
#if LAPTOP
|
#if DEBUG
|
||||||
return true;
|
return true;
|
||||||
#else
|
#else
|
||||||
uint DongleFeature = GetFeatureMap();
|
uint DongleFeature = GetFeatureMap();
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
@@ -18,7 +20,7 @@ namespace SanSystem.Einstellungen
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
result = getConfiguration(dataGridViewColumn.HeaderText);
|
result = (int)getConfiguration(dataGridViewColumn.HeaderText);
|
||||||
}
|
}
|
||||||
catch(Exception )
|
catch(Exception )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ namespace SanSystem.Einstellungen
|
|||||||
{
|
{
|
||||||
abstract class Settings : IDisposable
|
abstract class Settings : IDisposable
|
||||||
{
|
{
|
||||||
protected Dictionary<string, int> configuration = new Dictionary<string, int>();
|
protected Dictionary<string, long> configuration = new Dictionary<string, long>();
|
||||||
|
|
||||||
|
|
||||||
const string pfad = "Settings";
|
const string pfad = "Settings";
|
||||||
|
|
||||||
@@ -30,15 +31,15 @@ namespace SanSystem.Einstellungen
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
string input = File.ReadAllText(modPath);
|
string input = File.ReadAllText(modPath);
|
||||||
configuration = (Dictionary<string, int>)JsonConvert.DeserializeObject(input, typeof(Dictionary<string, int>));
|
configuration = (Dictionary<string, long>)JsonConvert.DeserializeObject(input, typeof(Dictionary<string, long>));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int getConfiguration(string keyName, int retry = 0)
|
protected long getConfiguration(string keyName, int retry = 0)
|
||||||
{
|
{
|
||||||
if (retry >= 3)
|
if (retry >= 3)
|
||||||
throw new Exception("Fehler, zuviele versuche");
|
throw new Exception("Fehler, zuviele versuche");
|
||||||
int result = -1;
|
long result = -1;
|
||||||
if(!configuration.TryGetValue(keyName,out result))
|
if(!configuration.TryGetValue(keyName,out result))
|
||||||
{
|
{
|
||||||
configuration.Add(keyName, 20);
|
configuration.Add(keyName, 20);
|
||||||
@@ -53,7 +54,7 @@ namespace SanSystem.Einstellungen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setConfig(string keyName, int value)
|
protected void setConfig(string keyName, long value)
|
||||||
{
|
{
|
||||||
configuration[keyName] = value;
|
configuration[keyName] = value;
|
||||||
}
|
}
|
||||||
|
|||||||
56
SanSystem/Einstellungen/SoftwareConfiguration.cs
Normal file
56
SanSystem/Einstellungen/SoftwareConfiguration.cs
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace SanSystem.Einstellungen
|
||||||
|
{
|
||||||
|
class SoftwareConfiguration : Settings
|
||||||
|
{
|
||||||
|
long IPToLong(string addr)
|
||||||
|
{
|
||||||
|
System.Net.IPAddress ip;
|
||||||
|
if (System.Net.IPAddress.TryParse(addr, out ip))
|
||||||
|
return (((long)ip.GetAddressBytes()[0] << 24) | ((int)ip.GetAddressBytes()[1] << 16) | ((int)ip.GetAddressBytes()[2] << 8) | ip.GetAddressBytes()[3]);
|
||||||
|
else return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
string LongToIP(long addr)
|
||||||
|
{
|
||||||
|
System.Net.IPAddress tmpIp;
|
||||||
|
if (System.Net.IPAddress.TryParse(addr.ToString(), out tmpIp))
|
||||||
|
{
|
||||||
|
return tmpIp.ToString();
|
||||||
|
/*try
|
||||||
|
{
|
||||||
|
Byte[] bytes = tmpIp.GetAddressBytes();
|
||||||
|
long addrs = (long)BitConverter.ToInt32(bytes, 0);
|
||||||
|
return new System.Net.IPAddress(addrs).ToString();
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
//catch (Exception e) { return e.Message; }
|
||||||
|
}
|
||||||
|
else return String.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void SetAnlageIP(string text)
|
||||||
|
{
|
||||||
|
setConfig("ANLAGEIP",IPToLong(text));
|
||||||
|
}
|
||||||
|
|
||||||
|
public SoftwareConfiguration() : base("SoftwareConfiguration")
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetAnlageIP()
|
||||||
|
{
|
||||||
|
long ip = getConfiguration("ANLAGEIP");
|
||||||
|
if (ip <= 0) throw new Exception("Something went wrong");
|
||||||
|
return LongToIP(ip);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void InitDevValues()
|
||||||
|
{
|
||||||
|
configuration.Add("ANLAGEIP", IPToLong("192.168.2.248"));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
using KlassenBIB;
|
using KlassenBIB;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using SanShared;
|
using SanShared;
|
||||||
|
using SanSystem.Einstellungen;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
@@ -185,11 +186,12 @@ namespace SanSystem
|
|||||||
{
|
{
|
||||||
Ping pingSender = new Ping();
|
Ping pingSender = new Ping();
|
||||||
PingOptions options = new PingOptions();
|
PingOptions options = new PingOptions();
|
||||||
|
SoftwareConfiguration softwareConfiguration = new SoftwareConfiguration();
|
||||||
|
|
||||||
string data = "aaaaaaaaaaaaa";
|
string data = "aaaaaaaaaaaaa";
|
||||||
byte[] buffer = Encoding.ASCII.GetBytes(data);
|
byte[] buffer = Encoding.ASCII.GetBytes(data);
|
||||||
int timeout = 20;
|
int timeout = 20;
|
||||||
PingReply reply = pingSender.Send("192.168.2.248", timeout, buffer, options);
|
PingReply reply = pingSender.Send(softwareConfiguration.GetAnlageIP(), timeout, buffer, options);
|
||||||
return reply.Status == IPStatus.Success;
|
return reply.Status == IPStatus.Success;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ namespace SanSystem
|
|||||||
MessageBox.Show("Bitte nur 1 Instanz starten der Software!", "", MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
MessageBox.Show("Bitte nur 1 Instanz starten der Software!", "", MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
||||||
Environment.Exit(1);
|
Environment.Exit(1);
|
||||||
}
|
}
|
||||||
|
#if !DEBUG
|
||||||
using (Dongle dongle = new Dongle(60))
|
using (Dongle dongle = new Dongle(60))
|
||||||
{
|
{
|
||||||
if (dongle.CheckDongleVorhanden())
|
if (dongle.CheckDongleVorhanden())
|
||||||
@@ -40,7 +41,12 @@ namespace SanSystem
|
|||||||
MessageBox.Show("Sorry es wurde kein Dongle gefunden!");
|
MessageBox.Show("Sorry es wurde kein Dongle gefunden!");
|
||||||
Application.Exit();
|
Application.Exit();
|
||||||
}
|
}
|
||||||
}
|
#else
|
||||||
|
Application.EnableVisualStyles();
|
||||||
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
Application.Run(new frmMain());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,6 +109,7 @@
|
|||||||
<Compile Include="BüroExporter.cs" />
|
<Compile Include="BüroExporter.cs" />
|
||||||
<Compile Include="Einstellungen\ObjecteListSetting.cs" />
|
<Compile Include="Einstellungen\ObjecteListSetting.cs" />
|
||||||
<Compile Include="Einstellungen\Settings.cs" />
|
<Compile Include="Einstellungen\Settings.cs" />
|
||||||
|
<Compile Include="Einstellungen\SoftwareConfiguration.cs" />
|
||||||
<Compile Include="Einstellungen\StreetListSettings.cs" />
|
<Compile Include="Einstellungen\StreetListSettings.cs" />
|
||||||
<Compile Include="FrmAktuelleBesatzung.cs">
|
<Compile Include="FrmAktuelleBesatzung.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
@@ -218,6 +219,12 @@
|
|||||||
<Compile Include="frmSelectNewSan.Designer.cs">
|
<Compile Include="frmSelectNewSan.Designer.cs">
|
||||||
<DependentUpon>frmSelectNewSan.cs</DependentUpon>
|
<DependentUpon>frmSelectNewSan.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="frmSettings.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="frmSettings.Designer.cs">
|
||||||
|
<DependentUpon>frmSettings.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="frmStrassenList.cs">
|
<Compile Include="frmStrassenList.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -319,6 +326,9 @@
|
|||||||
<EmbeddedResource Include="frmSelectNewSan.resx">
|
<EmbeddedResource Include="frmSelectNewSan.resx">
|
||||||
<DependentUpon>frmSelectNewSan.cs</DependentUpon>
|
<DependentUpon>frmSelectNewSan.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="frmSettings.resx">
|
||||||
|
<DependentUpon>frmSettings.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="frmStrassenList.resx">
|
<EmbeddedResource Include="frmStrassenList.resx">
|
||||||
<DependentUpon>frmStrassenList.cs</DependentUpon>
|
<DependentUpon>frmStrassenList.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
|||||||
30
SanSystem/frmMain.Designer.cs
generated
30
SanSystem/frmMain.Designer.cs
generated
@@ -38,6 +38,7 @@
|
|||||||
this.stammdatenImportierenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.stammdatenImportierenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.auftraggeberToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.auftraggeberToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.prefixSuffixToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.prefixSuffixToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.exportFürBüroErstellenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.speichernToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.speichernToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.massenstatistikToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.massenstatistikToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.projektordnerÖffnenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.projektordnerÖffnenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
@@ -51,7 +52,7 @@
|
|||||||
this.toolstrip_gesamtLiner = new System.Windows.Forms.ToolStripStatusLabel();
|
this.toolstrip_gesamtLiner = new System.Windows.Forms.ToolStripStatusLabel();
|
||||||
this.toolstrip_messages = new System.Windows.Forms.ToolStripStatusLabel();
|
this.toolstrip_messages = new System.Windows.Forms.ToolStripStatusLabel();
|
||||||
this.update = new UpdateLib.Updater();
|
this.update = new UpdateLib.Updater();
|
||||||
this.exportFürBüroErstellenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.configuration = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.mainmenu.SuspendLayout();
|
this.mainmenu.SuspendLayout();
|
||||||
this.statusStrip1.SuspendLayout();
|
this.statusStrip1.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
@@ -67,10 +68,11 @@
|
|||||||
this.projektordnerÖffnenToolStripMenuItem,
|
this.projektordnerÖffnenToolStripMenuItem,
|
||||||
this.toolStripMenuItem1,
|
this.toolStripMenuItem1,
|
||||||
this.imprägnierberichteToolStripMenuItem,
|
this.imprägnierberichteToolStripMenuItem,
|
||||||
this.berichteToolStripMenuItem});
|
this.berichteToolStripMenuItem,
|
||||||
|
this.configuration});
|
||||||
this.mainmenu.Location = new System.Drawing.Point(0, 0);
|
this.mainmenu.Location = new System.Drawing.Point(0, 0);
|
||||||
this.mainmenu.Name = "mainmenu";
|
this.mainmenu.Name = "mainmenu";
|
||||||
this.mainmenu.Size = new System.Drawing.Size(813, 29);
|
this.mainmenu.Size = new System.Drawing.Size(921, 29);
|
||||||
this.mainmenu.TabIndex = 1;
|
this.mainmenu.TabIndex = 1;
|
||||||
this.mainmenu.Text = "menuStrip1";
|
this.mainmenu.Text = "menuStrip1";
|
||||||
//
|
//
|
||||||
@@ -122,6 +124,13 @@
|
|||||||
this.prefixSuffixToolStripMenuItem.Text = "Prefix / Suffix";
|
this.prefixSuffixToolStripMenuItem.Text = "Prefix / Suffix";
|
||||||
this.prefixSuffixToolStripMenuItem.Click += new System.EventHandler(this.PrefixSuffixToolStripMenuItem_Click);
|
this.prefixSuffixToolStripMenuItem.Click += new System.EventHandler(this.PrefixSuffixToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
|
// exportFürBüroErstellenToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.exportFürBüroErstellenToolStripMenuItem.Name = "exportFürBüroErstellenToolStripMenuItem";
|
||||||
|
this.exportFürBüroErstellenToolStripMenuItem.Size = new System.Drawing.Size(254, 26);
|
||||||
|
this.exportFürBüroErstellenToolStripMenuItem.Text = "Export für Büro erstellen";
|
||||||
|
this.exportFürBüroErstellenToolStripMenuItem.Click += new System.EventHandler(this.exportFürBüroErstellenToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
// speichernToolStripMenuItem
|
// speichernToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.speichernToolStripMenuItem.Name = "speichernToolStripMenuItem";
|
this.speichernToolStripMenuItem.Name = "speichernToolStripMenuItem";
|
||||||
@@ -187,7 +196,7 @@
|
|||||||
this.toolstrip_messages});
|
this.toolstrip_messages});
|
||||||
this.statusStrip1.Location = new System.Drawing.Point(0, 431);
|
this.statusStrip1.Location = new System.Drawing.Point(0, 431);
|
||||||
this.statusStrip1.Name = "statusStrip1";
|
this.statusStrip1.Name = "statusStrip1";
|
||||||
this.statusStrip1.Size = new System.Drawing.Size(813, 22);
|
this.statusStrip1.Size = new System.Drawing.Size(921, 22);
|
||||||
this.statusStrip1.TabIndex = 3;
|
this.statusStrip1.TabIndex = 3;
|
||||||
this.statusStrip1.Text = "statusStrip1";
|
this.statusStrip1.Text = "statusStrip1";
|
||||||
//
|
//
|
||||||
@@ -214,18 +223,18 @@
|
|||||||
//
|
//
|
||||||
this.update.UpdateUrl = "http://home.cosysda.de/sanverwaltung/UpdateInfo.dat";
|
this.update.UpdateUrl = "http://home.cosysda.de/sanverwaltung/UpdateInfo.dat";
|
||||||
//
|
//
|
||||||
// exportFürBüroErstellenToolStripMenuItem
|
// configuration
|
||||||
//
|
//
|
||||||
this.exportFürBüroErstellenToolStripMenuItem.Name = "exportFürBüroErstellenToolStripMenuItem";
|
this.configuration.Name = "configuration";
|
||||||
this.exportFürBüroErstellenToolStripMenuItem.Size = new System.Drawing.Size(254, 26);
|
this.configuration.Size = new System.Drawing.Size(118, 25);
|
||||||
this.exportFürBüroErstellenToolStripMenuItem.Text = "Export für Büro erstellen";
|
this.configuration.Text = "Configuration";
|
||||||
this.exportFürBüroErstellenToolStripMenuItem.Click += new System.EventHandler(this.exportFürBüroErstellenToolStripMenuItem_Click);
|
this.configuration.Click += new System.EventHandler(this.configuration_Click);
|
||||||
//
|
//
|
||||||
// frmMain
|
// frmMain
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(813, 453);
|
this.ClientSize = new System.Drawing.Size(921, 453);
|
||||||
this.Controls.Add(this.statusStrip1);
|
this.Controls.Add(this.statusStrip1);
|
||||||
this.Controls.Add(this.mainmenu);
|
this.Controls.Add(this.mainmenu);
|
||||||
this.IsMdiContainer = true;
|
this.IsMdiContainer = true;
|
||||||
@@ -267,6 +276,7 @@
|
|||||||
private UpdateLib.Updater update;
|
private UpdateLib.Updater update;
|
||||||
private System.Windows.Forms.ToolStripStatusLabel toolstrip_messages;
|
private System.Windows.Forms.ToolStripStatusLabel toolstrip_messages;
|
||||||
private System.Windows.Forms.ToolStripMenuItem exportFürBüroErstellenToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem exportFürBüroErstellenToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem configuration;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -154,6 +154,8 @@ namespace SanSystem
|
|||||||
|
|
||||||
private void FrmProjektList_FormClosed(object sender, FormClosedEventArgs e)
|
private void FrmProjektList_FormClosed(object sender, FormClosedEventArgs e)
|
||||||
{
|
{
|
||||||
|
showauftraggeberform();
|
||||||
|
|
||||||
toolStripStatus_projekt_Label.Text = Global.Instance.ProjektNummer;
|
toolStripStatus_projekt_Label.Text = Global.Instance.ProjektNummer;
|
||||||
Form[] openedWindows = this.MdiChildren;
|
Form[] openedWindows = this.MdiChildren;
|
||||||
foreach(Form form in openedWindows)
|
foreach(Form form in openedWindows)
|
||||||
@@ -225,7 +227,18 @@ namespace SanSystem
|
|||||||
|
|
||||||
private void auftraggeberToolStripMenuItem_Click(object sender, EventArgs e)
|
private void auftraggeberToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if(Datenbank.Instance.loadedProjekt.Auftraggeber == null)
|
showauftraggeberform();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showauftraggeberform()
|
||||||
|
{
|
||||||
|
if (Datenbank.Instance.loadedProjekt == null)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Es wurde kein Projekt geladen");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Datenbank.Instance.loadedProjekt.Auftraggeber == null)
|
||||||
{
|
{
|
||||||
Auftraggeber auftraggeber = new Auftraggeber();
|
Auftraggeber auftraggeber = new Auftraggeber();
|
||||||
Datenbank.Instance.TeufelDB.Auftraggeber.Add(auftraggeber);
|
Datenbank.Instance.TeufelDB.Auftraggeber.Add(auftraggeber);
|
||||||
@@ -377,5 +390,11 @@ namespace SanSystem
|
|||||||
await export.ContinueWith(task => MessageBox.Show("Büro export abgeschlossen"));
|
await export.ContinueWith(task => MessageBox.Show("Büro export abgeschlossen"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void configuration_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
frmSettings frmSettings = new frmSettings();
|
||||||
|
frmSettings.ShowDialog();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
85
SanSystem/frmSettings.Designer.cs
generated
Normal file
85
SanSystem/frmSettings.Designer.cs
generated
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
namespace SanSystem
|
||||||
|
{
|
||||||
|
partial class frmSettings
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.txt_anlageIP = new System.Windows.Forms.TextBox();
|
||||||
|
this.btn_save = new System.Windows.Forms.Button();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Location = new System.Drawing.Point(12, 9);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(197, 20);
|
||||||
|
this.label1.TabIndex = 0;
|
||||||
|
this.label1.Text = "IP Adresse von der Anlage";
|
||||||
|
//
|
||||||
|
// txt_anlageIP
|
||||||
|
//
|
||||||
|
this.txt_anlageIP.Location = new System.Drawing.Point(233, 6);
|
||||||
|
this.txt_anlageIP.Name = "txt_anlageIP";
|
||||||
|
this.txt_anlageIP.Size = new System.Drawing.Size(253, 26);
|
||||||
|
this.txt_anlageIP.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// btn_save
|
||||||
|
//
|
||||||
|
this.btn_save.Location = new System.Drawing.Point(12, 125);
|
||||||
|
this.btn_save.Name = "btn_save";
|
||||||
|
this.btn_save.Size = new System.Drawing.Size(377, 146);
|
||||||
|
this.btn_save.TabIndex = 2;
|
||||||
|
this.btn_save.Text = "Speichern";
|
||||||
|
this.btn_save.UseVisualStyleBackColor = true;
|
||||||
|
this.btn_save.Click += new System.EventHandler(this.btn_save_Click);
|
||||||
|
//
|
||||||
|
// frmSettings
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(1200, 692);
|
||||||
|
this.Controls.Add(this.btn_save);
|
||||||
|
this.Controls.Add(this.txt_anlageIP);
|
||||||
|
this.Controls.Add(this.label1);
|
||||||
|
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||||
|
this.Name = "frmSettings";
|
||||||
|
this.Text = "Einstellungen";
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.TextBox txt_anlageIP;
|
||||||
|
private System.Windows.Forms.Button btn_save;
|
||||||
|
}
|
||||||
|
}
|
||||||
43
SanSystem/frmSettings.cs
Normal file
43
SanSystem/frmSettings.cs
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
using SanSystem.Einstellungen;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace SanSystem
|
||||||
|
{
|
||||||
|
public partial class frmSettings : Form
|
||||||
|
{
|
||||||
|
SoftwareConfiguration softwareConfiguration = null;
|
||||||
|
public frmSettings()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
softwareConfiguration = new SoftwareConfiguration();
|
||||||
|
|
||||||
|
txt_anlageIP.Text = softwareConfiguration.GetAnlageIP();
|
||||||
|
}
|
||||||
|
|
||||||
|
void makeBindings()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void speichern()
|
||||||
|
{
|
||||||
|
softwareConfiguration.SetAnlageIP(txt_anlageIP.Text);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btn_save_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
speichern();
|
||||||
|
softwareConfiguration.SaveSettings();
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
120
SanSystem/frmSettings.resx
Normal file
120
SanSystem/frmSettings.resx
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
Reference in New Issue
Block a user