diff --git a/AboutBox.sln b/AboutBox.sln
index 4feb763..47cac6d 100644
--- a/AboutBox.sln
+++ b/AboutBox.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.28307.572
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30711.63
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AboutBox", "AboutBox\AboutBox.csproj", "{32F8CF98-005D-4F81-8381-CC2B8FC7A4D8}"
EndProject
@@ -26,6 +26,7 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
+ RESX_NeutralResourcesLanguage = de-DE
SolutionGuid = {15165E4A-C2AA-46F2-94D4-379F9DC52145}
EndGlobalSection
EndGlobal
diff --git a/AboutBox/AboutBox.Designer.cs b/AboutBox/AboutBox.Designer.cs
index 98c96b5..518953c 100644
--- a/AboutBox/AboutBox.Designer.cs
+++ b/AboutBox/AboutBox.Designer.cs
@@ -33,11 +33,12 @@
this.labelProgramName = new System.Windows.Forms.Label();
this.labelVersion = new System.Windows.Forms.Label();
this.labelCopyright = new System.Windows.Forms.Label();
- this.labelDisklaimer = new System.Windows.Forms.Label();
+ this.labelDisclaimer = new System.Windows.Forms.Label();
this.textBox = new System.Windows.Forms.TextBox();
this.buttonExport = new System.Windows.Forms.Button();
this.buttonClose = new System.Windows.Forms.Button();
this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
+ this.buttonDllInfo = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
this.SuspendLayout();
//
@@ -62,10 +63,10 @@
resources.ApplyResources(this.labelCopyright, "labelCopyright");
this.labelCopyright.Name = "labelCopyright";
//
- // labelDisklaimer
+ // labelDisclaimer
//
- resources.ApplyResources(this.labelDisklaimer, "labelDisklaimer");
- this.labelDisklaimer.Name = "labelDisklaimer";
+ resources.ApplyResources(this.labelDisclaimer, "labelDisclaimer");
+ this.labelDisclaimer.Name = "labelDisclaimer";
//
// textBox
//
@@ -91,19 +92,29 @@
//
this.saveFileDialog.FileOk += new System.ComponentModel.CancelEventHandler(this.saveFileDialog_FileOk);
//
+ // buttonDllInfo
+ //
+ resources.ApplyResources(this.buttonDllInfo, "buttonDllInfo");
+ this.buttonDllInfo.Name = "buttonDllInfo";
+ this.buttonDllInfo.UseVisualStyleBackColor = true;
+ this.buttonDllInfo.Click += new System.EventHandler(this.buttonDllInfo_Click);
+ //
// AboutBox
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.buttonDllInfo);
this.Controls.Add(this.buttonClose);
this.Controls.Add(this.buttonExport);
this.Controls.Add(this.textBox);
- this.Controls.Add(this.labelDisklaimer);
+ this.Controls.Add(this.labelDisclaimer);
this.Controls.Add(this.labelCopyright);
this.Controls.Add(this.labelVersion);
this.Controls.Add(this.labelProgramName);
this.Controls.Add(this.pictureBox);
this.Name = "AboutBox";
+ this.ShowIcon = false;
+ this.Load += new System.EventHandler(this.AboutBox_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@@ -116,10 +127,11 @@
private System.Windows.Forms.Label labelProgramName;
private System.Windows.Forms.Label labelVersion;
private System.Windows.Forms.Label labelCopyright;
- private System.Windows.Forms.Label labelDisklaimer;
+ private System.Windows.Forms.Label labelDisclaimer;
private System.Windows.Forms.TextBox textBox;
private System.Windows.Forms.Button buttonExport;
private System.Windows.Forms.Button buttonClose;
private System.Windows.Forms.SaveFileDialog saveFileDialog;
+ private System.Windows.Forms.Button buttonDllInfo;
}
}
\ No newline at end of file
diff --git a/AboutBox/AboutBox.cs b/AboutBox/AboutBox.cs
index 7fff3f4..319bd31 100644
--- a/AboutBox/AboutBox.cs
+++ b/AboutBox/AboutBox.cs
@@ -13,14 +13,18 @@ using System.Windows.Forms;
namespace Eugen.ESystem.Windows.Forms
{
+ ///
+ /// Displays a Program Information Box
+ ///
public partial class AboutBox : Form
{
#region Version und Copyright
// Version und Copyright
- string dllName = Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); //Den Programmnamen auslesen
- string dllVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
+ static string dllName = Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); //Den Programmnamen auslesen
+ static string dllVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
static object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
- string copyright = ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
+ static string copyright = GenerateCopyright();
+ string icon = Application.StartupPath + "\\Info.bmp";
//Assembly Datum und Zeit
static DateTime value = AssemblyDateTime();
string date = value.ToShortDateString();
@@ -32,6 +36,47 @@ namespace Eugen.ESystem.Windows.Forms
//Tage seit dem 1. Januar 2000 und Sekunden seit Mitternacht, (multiplizier mit 2 ergibt das Original)
return buildDateTime;
}
+
+ private static string CurrentYear()
+ {
+ DateTime dtn = DateTime.Now;
+ return dtn.Year.ToString();
+ }
+
+ private static string StartYear()
+ {
+ string startYear = "";
+ if (((AssemblyCopyrightAttribute)attributes[0]).Copyright.Contains("Copyright © "))
+ {
+ startYear = ((AssemblyCopyrightAttribute)attributes[0]).Copyright.Replace("Copyright © ", "");
+ while (startYear.StartsWith(" "))
+ {
+ startYear = startYear.Remove(0, 1);
+ }
+ startYear = startYear.Remove(startYear.IndexOf(" "));
+ return startYear;
+ }
+ else
+ {
+ DateTime dtn = DateTime.Now;
+ return dtn.Year.ToString();
+ }
+ }
+
+ private static string GenerateCopyright()
+ {
+ string startYear = StartYear();
+ string currentYear = CurrentYear();
+
+ if (startYear == currentYear)
+ {
+ return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
+ }
+ else
+ {
+ return ((AssemblyCopyrightAttribute)attributes[0]).Copyright.Replace(startYear, String.Concat(startYear, "-", currentYear));
+ }
+ }
#endregion
#region DLL-Info
@@ -55,37 +100,123 @@ namespace Eugen.ESystem.Windows.Forms
///
public static string[] DllInfo { private set; get; }
- private void SetDllInfo()
+ private static void SetDllInfo()
{
//Name, Version und Copyright setzen
DllName = dllName;
DllVersion = dllVersion;
- Copyright = this.copyright;
-
- string[] dllInfo = new string[3];
- dllInfo[0] = dllName;
- dllInfo[1] = dllVersion;
- dllInfo[2] = this.copyright;
- DllInfo = dllInfo;
+ Copyright = copyright;
}
#endregion
- public AboutBox(string programName, string programVersion, string programCopyright)
+ ///
+ /// Displays a Program Information Box
+ ///
+ static AboutBox()
{
SetDllInfo(); //Name, Version und Copyright der DLL setzen
+ }
+ ///
+ /// Displays a Program Information Box
+ ///
+ /// A valid Program name.
+ /// A valid version number.
+ /// The copyrigth Information
+ /// true = Button is displayed; false = Button is not displayed.
+ public AboutBox(string programName, string programVersion, string programCopyright)
+ {
InitializeComponent();
SetContent(programName, programVersion, programCopyright); //Fensterinhalt setzen
}
+ public AboutBox(string programName, string programVersion, string programCopyright, bool showDllInfoButton)
+ {
+ InitializeComponent();
+
+ if (showDllInfoButton)
+ {
+ buttonDllInfo.Enabled = true;
+ buttonDllInfo.Visible = true;
+ }
+ else
+ {
+ buttonDllInfo.Enabled = false;
+ buttonDllInfo.Visible = false;
+ }
+
+ SetContent(programName, programVersion, programCopyright); //Fensterinhalt setzen
+ }
+
+ ///
+ /// Displays a Program Information Box
+ ///
+ /// A valid Program name.
+ /// A valid version number.
+ /// The copyrigth Information
+ /// valid icon in the size 32x32 dots with path. Larger icons are cropped. E.g.: C\:MyFolder\MyIcon.ico
+ /// true = Button is displayed; false = Button is not displayed.
+ public AboutBox(string programName, string programVersion, string programCopyright, Icon icon, bool showDllInfoButton)
+ {
+ InitializeComponent();
+
+ pictureBox.Image = Bitmap.FromHicon(new Icon(icon, new Size(32, 32)).Handle);
+
+ if (showDllInfoButton)
+ {
+ buttonDllInfo.Enabled = true;
+ buttonDllInfo.Visible = true;
+ }
+ else
+ {
+ buttonDllInfo.Enabled = false;
+ buttonDllInfo.Visible = false;
+ }
+
+ SetContent(programName, programVersion, programCopyright); //Fensterinhalt setzen
+ }
+
+ private void AboutBox_Load(object sender, EventArgs e)
+ {
+ DllInfoSelected = false;
+ }
protected string ProgramName { private set; get; }
protected string ProgramVersion { private set; get; }
protected string ProgramCopyright { private set; get; }
+ protected bool DllInfoSelected { set; get; }
+ protected bool ShowDllInfoButton { set; get; }
+
private void buttonClose_Click(object sender, EventArgs e)
{
- this.Close(); //Das Fenster schliessen
+ if (DllInfoSelected)
+ {
+ buttonDllInfo.Enabled = true;
+
+ labelDisclaimer.Text = Language.disclaimerHeader001;
+ textBox.Text = Language.disclaimer;
+ DllInfoSelected = false;
+ }
+ else
+ {
+ this.Close(); //Das Fenster schliessen
+ }
+ }
+
+ private void buttonDllInfo_Click(object sender, EventArgs e)
+ {
+ //DLL-Informationen anzeigen
+ DllInfoSelected = true;
+ buttonDllInfo.Enabled = false;
+
+ labelDisclaimer.Text = Language.dllInfo001;
+ textBox.Text = "";
+
+ if (GetAllDllNames() != null)
+ {
+ textBox.Text = CreateDllInfo(GetAllDllNames());
+ }
}
private void buttonExport_Click(object sender, EventArgs e)
@@ -114,6 +245,26 @@ namespace Eugen.ESystem.Windows.Forms
}
}
+ private void SaveFileDialogFileOk(object sender, System.ComponentModel.CancelEventArgs e)
+ {
+ string fileName = saveFileDialog.FileName;
+ string text = ExportText();
+
+ try
+ {
+ File.WriteAllText(fileName, text); //Schreibt den Text in eine Datei
+ }
+ catch (Exception)
+ {
+
+ MessageBox.Show(Language.message001,
+ Language.messageHead001,
+ MessageBoxButtons.OK,
+ MessageBoxIcon.Error,
+ MessageBoxDefaultButton.Button1);
+ }
+ }
+
private void SetContent(string programName, string programVersion, string programCopyright)
{
labelProgramName.Text = programName;
@@ -130,38 +281,73 @@ namespace Eugen.ESystem.Windows.Forms
}
labelCopyright.Text = programCopyright;
ProgramCopyright = programCopyright;
- }
- private void SaveFileDialogFileOk(object sender, System.ComponentModel.CancelEventArgs e)
- {
- string fileName = saveFileDialog.FileName;
- string text = ExportText();
-
- try
- {
- File.WriteAllText(fileName, text); //Schreibt den Text in eine Datei
- }
- catch (Exception)
- {
-
- MessageBox.Show(Language.message001,
- Language.messageHead001,
- MessageBoxButtons.OK,
- MessageBoxIcon.Error,
- MessageBoxDefaultButton.Button1);
- }
+ textBox.Text = Language.disclaimer;
}
private string ExportText()
{
- if (textBox.SelectionLength > 0)
+ if (DllInfoSelected)
{
- return textBox.SelectedText; //Gibt den selektierten Text zurück
+ DateTime today = DateTime.Now;
+
+ return String.Concat(Language.dllInfo001, "\r\n", today.ToString("yyyy-MM-dd - HH:mm:ss"), "\r\n--------------------------------------------------------------------------------\r\n", FixLineLenght.Format(textBox.Text, 80)); //Gibt den ganzen Text zurück
}
else
{
- return String.Concat(ProgramName, "\r\n", ProgramVersion, "\r\n", ProgramCopyright, "\r\n--------------------------------------------------------------------------------\r\n", FixLineLenght.Format(textBox.Text, 80)); //Gibt den ganzen Text zurück
+ if (textBox.SelectionLength > 0)
+ {
+ return textBox.SelectedText; //Gibt den selektierten Text zurück
+ }
+ else
+ {
+ return String.Concat(ProgramName, "\r\n", ProgramVersion, "\r\n", ProgramCopyright, "\r\n--------------------------------------------------------------------------------\r\n", FixLineLenght.Format(textBox.Text, 80)); //Gibt den ganzen Text zurück
+ }
}
}
+
+ private List GetAllDllNames()
+ {
+ List dllNames = new List();
+
+ if (dllNames != null)
+ {
+ dllNames.Clear();
+ }
+
+ DirectoryInfo ParentDirectory = new DirectoryInfo(Application.StartupPath);
+ foreach (FileInfo fi in ParentDirectory.GetFiles())
+ {
+ if (fi.Extension.ToLower() == ".dll")
+ {
+ dllNames.Add(fi.FullName);
+ }
+ }
+
+ return dllNames;
+ }
+
+ private string CreateDllInfo(List dllNames)
+ {
+ string dllInfos = "";
+ string dllName = "";
+ string dllVersion = "";
+
+ if (dllNames != null)
+ {
+ foreach (var name in dllNames)
+ {
+ Assembly assembly = Assembly.LoadFrom(name);
+
+ dllName = String.Concat(assembly.ToString().Remove(assembly.ToString().IndexOf(",")), ".dll");
+ dllVersion = assembly.ToString().Remove(0, assembly.ToString().IndexOf("Version=") + 8);
+ dllVersion = dllVersion.Remove(dllVersion.IndexOf(","));
+
+ dllInfos = String.Concat(dllInfos, dllName, "\r\n", dllVersion, "\r\n\r\n");
+ }
+ }
+
+ return dllInfos.Remove(dllInfos.LastIndexOf("\r\n\r\n"));
+ }
}
}
diff --git a/AboutBox/AboutBox.de.resx b/AboutBox/AboutBox.de.resx
index ec8bfdf..821b956 100644
--- a/AboutBox/AboutBox.de.resx
+++ b/AboutBox/AboutBox.de.resx
@@ -118,6 +118,24 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ Über
+
+
+ Schließen
+
+
+ DLL-Info
+
+
+ Exportieren
+
+
+ Verzichtserklärung
+
+
+ ProgrammName
+
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
@@ -169,4 +187,7 @@
n+cU1BA7UtmpRvd62f+G5dWscM+EhcV/ABQ+MjIwFZTbAAAAAElFTkSuQmCC
+
+ DIE SOFTWARE WIRD ZUR VERFÜGUNG GESTELLT, WIE SIE IST, OHNE JEGLICHE HAFTUNG IRGENDEINER ART. BIS ZUM MAXIMAL, IN DIESEM FALL GESETZLICH ERLAUBTEN, LEHNT DER AUTOR WEITERHIN JEDE HAFTUNG AB, EINGESCHLOSSEN JEDE GARANTIE UNTER KAUFLEUTEN, DIE GARANTIE FÜR DEN EINSATZ ZU BESTIMMTEN ZWECKEN UND NICHTEINSETZBARKEIT. DIE GESAMTE GEFAHR, DIE AUS DEM GEBRAUCH ODER DER LEISTUNG VON DEM PRODUKT UND DEN UNTERLAGEN HERAUS ENTSTEHT, BLEIBT BEI DEM BENUTZER DIESER SOFTWARE. SOWEIT GESETZLICH ZULÄSSIG, IST DER AUTOR IN KEINEM FALL HAFTBAR FÜR IRGENDWELCHE FOLGE-, ZUFÄLLIGEN, INDIREKTEN ODER ANDEREN SCHÄDEN WELCHER ART AUCH IMMER (EINSCHLIESSLICH, ABER NICHT BESCHRÄNKT AUF SCHÄDEN AUS ENTGANGENEN GEWINN, GESCHÄFTSUNTERBRECHUNG, VERLUST VON GESCHÄFTLICHEN INFORMATIONEN ODER VERMÖGENSSCHÄDEN), DIE AUS DER VERWENDUNG ODER DER UNMÖGLICHKEIT DER VERWENDUNG DES SOFTWAREPRODUKTS RESULTIEREN, SELBST WENN DER AUTOR AUF DIE MÖGLICHKEIT SOLCHER SCHÄDEN HINGEWIESEN WORDEN IST.
+
\ No newline at end of file
diff --git a/AboutBox/AboutBox.en.resx b/AboutBox/AboutBox.en.resx
index 31067b0..4049863 100644
--- a/AboutBox/AboutBox.en.resx
+++ b/AboutBox/AboutBox.en.resx
@@ -118,6 +118,30 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ About
+
+
+ Close
+
+
+ DLL-Info
+
+
+ Export
+
+
+ Disclaimer
+
+
+ 55, 13
+
+
+ 280, 44
+
+
+ ProgramName
+
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
@@ -169,25 +193,7 @@
n+cU1BA7UtmpRvd62f+G5dWscM+EhcV/ABQ+MjIwFZTbAAAAAElFTkSuQmCC
-
- 280, 44
-
-
- ProgramName
-
-
- 55, 13
-
-
- Disklaimer
-
THE SOFTWARE IS PROVIDED AS IS, WITHOUT ANY LIABILITY OF ANY KIND. UP TO THE MAXIMUM, IN THIS CASE PERMITTED BY LAW, THE AUTHOR CONTINUES TO DISCLAIM ALL LIABILITY, INCLUDING ANY WARRANTY AMONG MERCHANTS, THE WARRANTY FOR USE FOR SPECIFIC PURPOSES AND NON-USABILITY. THE ENTIRE RISK ARISING FROM THE USE OR PERFORMANCE OF THE PRODUCT AND THE DOCUMENTATION REMAINS WITH THE USER OF THIS SOFTWARE. TO THE FULLEST EXTENT PERMITTED BY LAW, THE AUTHOR SHALL IN NO EVENT BE LIABLE FOR ANY CONSEQUENTIAL, INCIDENTAL, INDIRECT OR OTHER DAMAGES WHATSOEVER (INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION OR LOSS OF PROFITS) ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE PRODUCT, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
- Export
-
-
- Close
-
\ No newline at end of file
diff --git a/AboutBox/AboutBox.resx b/AboutBox/AboutBox.resx
index 7de76d2..e14b7b3 100644
--- a/AboutBox/AboutBox.resx
+++ b/AboutBox/AboutBox.resx
@@ -189,7 +189,7 @@
$this
- 7
+ 8
True
@@ -201,13 +201,13 @@
70, 13
- 308, 44
+ 314, 44
4
- Programmname
+ ProgrammName
labelProgramName
@@ -219,7 +219,7 @@
$this
- 6
+ 7
True
@@ -238,6 +238,7 @@
Version
+ @Invariant
labelVersion
@@ -249,7 +250,7 @@
$this
- 5
+ 6
True
@@ -268,6 +269,7 @@
Copyright
+ @Invariant
labelCopyright
@@ -279,34 +281,34 @@
$this
- 4
+ 5
-
+
True
-
+
12, 144
-
+
94, 13
-
+
7
-
+
Verzichtserklärung
-
- labelDisklaimer
+
+ labelDisclaimer
-
+
System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
+
$this
-
- 3
+
+ 4
12, 162
@@ -337,7 +339,7 @@
$this
- 2
+ 3
12, 341
@@ -361,7 +363,7 @@
$this
- 1
+ 2
407, 341
@@ -373,7 +375,7 @@
1
- Schliesen
+ Schließen
buttonClose
@@ -385,11 +387,41 @@
$this
- 0
+ 1
17, 17
+
+ False
+
+
+ 209, 341
+
+
+ 75, 23
+
+
+ 8
+
+
+ DLL-Info
+
+
+ False
+
+
+ buttonDllInfo
+
+
+ System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ $this
+
+
+ 0
+
True
@@ -415,7 +447,7 @@
System.Windows.Forms.SaveFileDialog, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- About
+ AboutBox
System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
diff --git a/AboutBox/Language.Designer.cs b/AboutBox/Language.Designer.cs
index 6f3ed0f..c025ca6 100644
--- a/AboutBox/Language.Designer.cs
+++ b/AboutBox/Language.Designer.cs
@@ -19,7 +19,7 @@ namespace Eugen.ESystem.Windows.Forms {
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Language {
@@ -39,7 +39,7 @@ namespace Eugen.ESystem.Windows.Forms {
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("About.Language", typeof(Language).Assembly);
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AboutBox.Language", typeof(Language).Assembly);
resourceMan = temp;
}
return resourceMan;
@@ -69,6 +69,33 @@ namespace Eugen.ESystem.Windows.Forms {
}
}
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die DIE SOFTWARE WIRD ZUR VERFÜGUNG GESTELLT, WIE SIE IST, OHNE JEGLICHE HAFTUNG IRGENDEINER ART. BIS ZUM MAXIMAL, IN DIESEM FALL GESETZLICH ERLAUBTEN, LEHNT DER AUTOR WEITERHIN JEDE HAFTUNG AB, EINGESCHLOSSEN JEDE GARANTIE UNTER KAUFLEUTEN, DIE GARANTIE FÜR DEN EINSATZ ZU BESTIMMTEN ZWECKEN UND NICHTEINSETZBARKEIT. DIE GESAMTE GEFAHR, DIE AUS DEM GEBRAUCH ODER DER LEISTUNG VON DEM PRODUKT UND DEN UNTERLAGEN HERAUS ENTSTEHT, BLEIBT BEI DEM BENUTZER DIESER SOFTWARE. SOWEIT GESETZLICH ZULÄSSIG, IST DER AUTOR IN K [Rest der Zeichenfolge wurde abgeschnitten]"; ähnelt.
+ ///
+ internal static string disclaimer {
+ get {
+ return ResourceManager.GetString("disclaimer", resourceCulture);
+ }
+ }
+
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die Verzichtserklärung: ähnelt.
+ ///
+ internal static string disclaimerHeader001 {
+ get {
+ return ResourceManager.GetString("disclaimerHeader001", resourceCulture);
+ }
+ }
+
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die Auflistung aller im Programm verwendeten DLLs: ähnelt.
+ ///
+ internal static string dllInfo001 {
+ get {
+ return ResourceManager.GetString("dllInfo001", resourceCulture);
+ }
+ }
+
///
/// Sucht eine lokalisierte Zeichenfolge, die Datei konnte nicht gespeichert werden. ähnelt.
///
diff --git a/AboutBox/Language.de.resx b/AboutBox/Language.de.resx
index e702524..7160580 100644
--- a/AboutBox/Language.de.resx
+++ b/AboutBox/Language.de.resx
@@ -120,6 +120,15 @@
Text-Datei (*.txt)|*.txt|Alle Dateien (*.*)|*.*
+
+ DIE SOFTWARE WIRD ZUR VERFÜGUNG GESTELLT, WIE SIE IST, OHNE JEGLICHE HAFTUNG IRGENDEINER ART. BIS ZUM MAXIMAL, IN DIESEM FALL GESETZLICH ERLAUBTEN, LEHNT DER AUTOR WEITERHIN JEDE HAFTUNG AB, EINGESCHLOSSEN JEDE GARANTIE UNTER KAUFLEUTEN, DIE GARANTIE FÜR DEN EINSATZ ZU BESTIMMTEN ZWECKEN UND NICHTEINSETZBARKEIT. DIE GESAMTE GEFAHR, DIE AUS DEM GEBRAUCH ODER DER LEISTUNG VON DEM PRODUKT UND DEN UNTERLAGEN HERAUS ENTSTEHT, BLEIBT BEI DEM BENUTZER DIESER SOFTWARE. SOWEIT GESETZLICH ZULÄSSIG, IST DER AUTOR IN KEINEM FALL HAFTBAR FÜR IRGENDWELCHE FOLGE-, ZUFÄLLIGEN, INDIREKTEN ODER ANDEREN SCHÄDEN WELCHER ART AUCH IMMER (EINSCHLIESSLICH, ABER NICHT BESCHRÄNKT AUF SCHÄDEN AUS ENTGANGENEN GEWINN, GESCHÄFTSUNTERBRECHUNG, VERLUST VON GESCHÄFTLICHEN INFORMATIONEN ODER VERMÖGENSSCHÄDEN), DIE AUS DER VERWENDUNG ODER DER UNMÖGLICHKEIT DER VERWENDUNG DES SOFTWAREPRODUKTS RESULTIEREN, SELBST WENN DER AUTOR AUF DIE MÖGLICHKEIT SOLCHER SCHÄDEN HINGEWIESEN WORDEN IST.
+
+
+ Verzichtserklärung
+
+
+ Auflistung aller im Programm verwendeten DLLs:
+
Datei konnte nicht gespeichert werden.
diff --git a/AboutBox/Language.en.resx b/AboutBox/Language.en.resx
index 794d239..6887763 100644
--- a/AboutBox/Language.en.resx
+++ b/AboutBox/Language.en.resx
@@ -120,6 +120,15 @@
Text-File (*.txt)|*.txt|All Files (*.*)|*.*
+
+ THE SOFTWARE IS PROVIDED AS IS, WITHOUT ANY LIABILITY OF ANY KIND. UP TO THE MAXIMUM, IN THIS CASE PERMITTED BY LAW, THE AUTHOR CONTINUES TO DISCLAIM ALL LIABILITY, INCLUDING ANY WARRANTY AMONG MERCHANTS, THE WARRANTY FOR USE FOR SPECIFIC PURPOSES AND NON-USABILITY. THE ENTIRE RISK ARISING FROM THE USE OR PERFORMANCE OF THE PRODUCT AND THE DOCUMENTATION REMAINS WITH THE USER OF THIS SOFTWARE. TO THE FULLEST EXTENT PERMITTED BY LAW, THE AUTHOR SHALL IN NO EVENT BE LIABLE FOR ANY CONSEQUENTIAL, INCIDENTAL, INDIRECT OR OTHER DAMAGES WHATSOEVER (INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION OR LOSS OF PROFITS) ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE PRODUCT, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+
+ Disclaimer
+
+
+ Listing of all DLLs used in the program:
+
File could not be saved.
diff --git a/AboutBox/Language.resx b/AboutBox/Language.resx
index e702524..7160580 100644
--- a/AboutBox/Language.resx
+++ b/AboutBox/Language.resx
@@ -120,6 +120,15 @@
Text-Datei (*.txt)|*.txt|Alle Dateien (*.*)|*.*
+
+ DIE SOFTWARE WIRD ZUR VERFÜGUNG GESTELLT, WIE SIE IST, OHNE JEGLICHE HAFTUNG IRGENDEINER ART. BIS ZUM MAXIMAL, IN DIESEM FALL GESETZLICH ERLAUBTEN, LEHNT DER AUTOR WEITERHIN JEDE HAFTUNG AB, EINGESCHLOSSEN JEDE GARANTIE UNTER KAUFLEUTEN, DIE GARANTIE FÜR DEN EINSATZ ZU BESTIMMTEN ZWECKEN UND NICHTEINSETZBARKEIT. DIE GESAMTE GEFAHR, DIE AUS DEM GEBRAUCH ODER DER LEISTUNG VON DEM PRODUKT UND DEN UNTERLAGEN HERAUS ENTSTEHT, BLEIBT BEI DEM BENUTZER DIESER SOFTWARE. SOWEIT GESETZLICH ZULÄSSIG, IST DER AUTOR IN KEINEM FALL HAFTBAR FÜR IRGENDWELCHE FOLGE-, ZUFÄLLIGEN, INDIREKTEN ODER ANDEREN SCHÄDEN WELCHER ART AUCH IMMER (EINSCHLIESSLICH, ABER NICHT BESCHRÄNKT AUF SCHÄDEN AUS ENTGANGENEN GEWINN, GESCHÄFTSUNTERBRECHUNG, VERLUST VON GESCHÄFTLICHEN INFORMATIONEN ODER VERMÖGENSSCHÄDEN), DIE AUS DER VERWENDUNG ODER DER UNMÖGLICHKEIT DER VERWENDUNG DES SOFTWAREPRODUKTS RESULTIEREN, SELBST WENN DER AUTOR AUF DIE MÖGLICHKEIT SOLCHER SCHÄDEN HINGEWIESEN WORDEN IST.
+
+
+ Verzichtserklärung
+
+
+ Auflistung aller im Programm verwendeten DLLs:
+
Datei konnte nicht gespeichert werden.
diff --git a/AboutBox/Properties/AssemblyInfo.cs b/AboutBox/Properties/AssemblyInfo.cs
index e0dae07..f3bb837 100644
--- a/AboutBox/Properties/AssemblyInfo.cs
+++ b/AboutBox/Properties/AssemblyInfo.cs
@@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die einer Assembly zugeordnet sind.
-[assembly: AssemblyTitle("About")]
+[assembly: AssemblyTitle("AboutBox")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("About")]
+[assembly: AssemblyProduct("AboutBox")]
[assembly: AssemblyCopyright("Copyright © 2019 by Eugen Höglinger")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
diff --git a/Daten/Customer.ico b/Daten/Customer.ico
new file mode 100644
index 0000000..650f010
Binary files /dev/null and b/Daten/Customer.ico differ
diff --git a/Test_AboutBox/Form1.Designer.cs b/Test_AboutBox/Form1.Designer.cs
index 5b7f9c2..daf67d4 100644
--- a/Test_AboutBox/Form1.Designer.cs
+++ b/Test_AboutBox/Form1.Designer.cs
@@ -28,46 +28,116 @@
///
private void InitializeComponent()
{
- this.button = new System.Windows.Forms.Button();
- this.labelInfo = new System.Windows.Forms.Label();
+ this.buttonAbout = new System.Windows.Forms.Button();
+ this.groupBoxProgramInfo = new System.Windows.Forms.GroupBox();
+ this.labelProgramInfo = new System.Windows.Forms.Label();
+ this.groupBoxDLLInfo = new System.Windows.Forms.GroupBox();
+ this.labelDLLInfo = new System.Windows.Forms.Label();
+ this.buttonAboutWithDllInfo = new System.Windows.Forms.Button();
+ this.button1buttonAboutWithCustomerIconAndDllInfo = new System.Windows.Forms.Button();
+ this.groupBoxProgramInfo.SuspendLayout();
+ this.groupBoxDLLInfo.SuspendLayout();
this.SuspendLayout();
//
- // button
+ // buttonAbout
//
- this.button.Location = new System.Drawing.Point(13, 234);
- this.button.Name = "button";
- this.button.Size = new System.Drawing.Size(267, 23);
- this.button.TabIndex = 0;
- this.button.Text = "Über anzeigen";
- this.button.UseVisualStyleBackColor = true;
- this.button.Click += new System.EventHandler(this.button_Click);
+ this.buttonAbout.Location = new System.Drawing.Point(12, 160);
+ this.buttonAbout.Name = "buttonAbout";
+ this.buttonAbout.Size = new System.Drawing.Size(776, 23);
+ this.buttonAbout.TabIndex = 0;
+ this.buttonAbout.Text = "Über anzeigen";
+ this.buttonAbout.UseVisualStyleBackColor = true;
+ this.buttonAbout.Click += new System.EventHandler(this.button_Click);
//
- // labelInfo
+ // groupBoxProgramInfo
//
- this.labelInfo.AutoSize = true;
- this.labelInfo.Location = new System.Drawing.Point(13, 13);
- this.labelInfo.Name = "labelInfo";
- this.labelInfo.Size = new System.Drawing.Size(16, 13);
- this.labelInfo.TabIndex = 1;
- this.labelInfo.Text = "...";
+ this.groupBoxProgramInfo.Controls.Add(this.labelProgramInfo);
+ this.groupBoxProgramInfo.Location = new System.Drawing.Point(12, 372);
+ this.groupBoxProgramInfo.Name = "groupBoxProgramInfo";
+ this.groupBoxProgramInfo.Size = new System.Drawing.Size(385, 66);
+ this.groupBoxProgramInfo.TabIndex = 9;
+ this.groupBoxProgramInfo.TabStop = false;
+ this.groupBoxProgramInfo.Text = "Programm Information";
+ //
+ // labelProgramInfo
+ //
+ this.labelProgramInfo.AutoSize = true;
+ this.labelProgramInfo.ImeMode = System.Windows.Forms.ImeMode.NoControl;
+ this.labelProgramInfo.Location = new System.Drawing.Point(7, 20);
+ this.labelProgramInfo.Name = "labelProgramInfo";
+ this.labelProgramInfo.Size = new System.Drawing.Size(16, 13);
+ this.labelProgramInfo.TabIndex = 0;
+ this.labelProgramInfo.Text = "...";
+ //
+ // groupBoxDLLInfo
+ //
+ this.groupBoxDLLInfo.Controls.Add(this.labelDLLInfo);
+ this.groupBoxDLLInfo.Location = new System.Drawing.Point(403, 372);
+ this.groupBoxDLLInfo.Name = "groupBoxDLLInfo";
+ this.groupBoxDLLInfo.Size = new System.Drawing.Size(385, 66);
+ this.groupBoxDLLInfo.TabIndex = 10;
+ this.groupBoxDLLInfo.TabStop = false;
+ this.groupBoxDLLInfo.Text = "DLL Information";
+ //
+ // labelDLLInfo
+ //
+ this.labelDLLInfo.AutoSize = true;
+ this.labelDLLInfo.ImeMode = System.Windows.Forms.ImeMode.NoControl;
+ this.labelDLLInfo.Location = new System.Drawing.Point(7, 20);
+ this.labelDLLInfo.Name = "labelDLLInfo";
+ this.labelDLLInfo.Size = new System.Drawing.Size(16, 13);
+ this.labelDLLInfo.TabIndex = 0;
+ this.labelDLLInfo.Text = "...";
+ //
+ // buttonAboutWithDllInfo
+ //
+ this.buttonAboutWithDllInfo.Location = new System.Drawing.Point(12, 190);
+ this.buttonAboutWithDllInfo.Name = "buttonAboutWithDllInfo";
+ this.buttonAboutWithDllInfo.Size = new System.Drawing.Size(776, 23);
+ this.buttonAboutWithDllInfo.TabIndex = 11;
+ this.buttonAboutWithDllInfo.Text = "Über mit DLL-Informationen anzeigen";
+ this.buttonAboutWithDllInfo.UseVisualStyleBackColor = true;
+ this.buttonAboutWithDllInfo.Click += new System.EventHandler(this.buttonAboutWithDllInfo_Click);
+ //
+ // button1buttonAboutWithCustomerIconAndDllInfo
+ //
+ this.button1buttonAboutWithCustomerIconAndDllInfo.Location = new System.Drawing.Point(12, 220);
+ this.button1buttonAboutWithCustomerIconAndDllInfo.Name = "button1buttonAboutWithCustomerIconAndDllInfo";
+ this.button1buttonAboutWithCustomerIconAndDllInfo.Size = new System.Drawing.Size(776, 23);
+ this.button1buttonAboutWithCustomerIconAndDllInfo.TabIndex = 12;
+ this.button1buttonAboutWithCustomerIconAndDllInfo.Text = "Über mit Customer Icon und DLL-Informationen anzeigen";
+ this.button1buttonAboutWithCustomerIconAndDllInfo.UseVisualStyleBackColor = true;
+ this.button1buttonAboutWithCustomerIconAndDllInfo.Click += new System.EventHandler(this.button1buttonAboutWithCustomerIconAndDllInfo_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(292, 269);
- this.Controls.Add(this.labelInfo);
- this.Controls.Add(this.button);
+ this.ClientSize = new System.Drawing.Size(800, 450);
+ this.Controls.Add(this.button1buttonAboutWithCustomerIconAndDllInfo);
+ this.Controls.Add(this.buttonAboutWithDllInfo);
+ this.Controls.Add(this.groupBoxProgramInfo);
+ this.Controls.Add(this.groupBoxDLLInfo);
+ this.Controls.Add(this.buttonAbout);
this.Name = "Form1";
this.Text = "Test_About";
+ this.Load += new System.EventHandler(this.Form1_Load);
+ this.groupBoxProgramInfo.ResumeLayout(false);
+ this.groupBoxProgramInfo.PerformLayout();
+ this.groupBoxDLLInfo.ResumeLayout(false);
+ this.groupBoxDLLInfo.PerformLayout();
this.ResumeLayout(false);
- this.PerformLayout();
}
#endregion
- private System.Windows.Forms.Button button;
- private System.Windows.Forms.Label labelInfo;
+ private System.Windows.Forms.Button buttonAbout;
+ private System.Windows.Forms.GroupBox groupBoxProgramInfo;
+ private System.Windows.Forms.Label labelProgramInfo;
+ private System.Windows.Forms.GroupBox groupBoxDLLInfo;
+ private System.Windows.Forms.Label labelDLLInfo;
+ private System.Windows.Forms.Button buttonAboutWithDllInfo;
+ private System.Windows.Forms.Button button1buttonAboutWithCustomerIconAndDllInfo;
}
}
\ No newline at end of file
diff --git a/Test_AboutBox/Form1.cs b/Test_AboutBox/Form1.cs
index 16d700e..ca15a39 100644
--- a/Test_AboutBox/Form1.cs
+++ b/Test_AboutBox/Form1.cs
@@ -9,6 +9,7 @@ using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
+using Eugen.ESystem.Windows.Forms;
namespace Eugen.ESystem.Windows.Forms
{
@@ -16,10 +17,10 @@ namespace Eugen.ESystem.Windows.Forms
{
#region Version und Copyright
// Version und Copyright
- string name = Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); //Den Programmnamen auslesen
- string version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
+ string programName = Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); //Den Programmnamen auslesen
+ string programVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
static object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
- string copyright = ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
+ string copyright = GenerateCopyright();
string icon = Application.StartupPath + "\\Info.bmp";
//Assembly Datum und Zeit
static DateTime value = AssemblyDateTime();
@@ -32,28 +33,122 @@ namespace Eugen.ESystem.Windows.Forms
//Tage seit dem 1. Januar 2000 und Sekunden seit Mitternacht, (multiplizier mit 2 ergibt das Original)
return buildDateTime;
}
+
+ private static string CurrentYear()
+ {
+ DateTime dtn = DateTime.Now;
+ return dtn.Year.ToString();
+ }
+
+ private static string StartYear()
+ {
+ //string startYear = ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
+ //return startYear.Remove(0, startYear.LastIndexOf(" ") + 1);
+ string startYear = "";
+ if (((AssemblyCopyrightAttribute)attributes[0]).Copyright.Contains("Copyright © "))
+ {
+ startYear = ((AssemblyCopyrightAttribute)attributes[0]).Copyright.Replace("Copyright © ", "");
+ while (startYear.StartsWith(" "))
+ {
+ startYear = startYear.Remove(0, 1);
+ }
+ startYear = startYear.Remove(startYear.IndexOf(" "));
+ return startYear;
+ }
+ else
+ {
+ DateTime dtn = DateTime.Now;
+ return dtn.Year.ToString();
+ }
+ }
+
+ private static string GenerateCopyright()
+ {
+ string startYear = StartYear();
+ string currentYear = CurrentYear();
+
+ if (startYear == currentYear)
+ {
+ return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
+ }
+ else
+ {
+ //return String.Concat(((AssemblyCopyrightAttribute)attributes[0]).Copyright, "-", currentYear);
+ return ((AssemblyCopyrightAttribute)attributes[0]).Copyright.Replace(startYear, String.Concat(startYear, "-", currentYear));
+ }
+ }
#endregion
- public Form1()
+ #region Programm-Info
+ ///
+ /// Contains the name of the program file
+ ///
+ public static string ProgramName { set; get; }
+
+ ///
+ /// Contains the version of the program file
+ ///
+ public static string ProgramVersion { set; get; }
+
+ ///
+ /// Contains the copyright notice
+ ///
+ public static string Copyright { set; get; }
+
+ private void SetProgramInfo()
{
+ //Name, Version und Copyright setzen
+ ProgramName = programName;
+ ProgramVersion = programVersion;
+ Copyright = copyright;
+ }
+ #endregion
+
+ public Form1()
+ {
+ SetProgramInfo(); //Name, Version und Copyright setzen
InitializeComponent();
}
+ private void Form1_Load(object sender, EventArgs e)
+ {
+ ShowInformation(); //Programm- und DLL-Information anzeigen
+ }
+
+ private void ShowInformation()
+ {
+ labelProgramInfo.Text = String.Concat(ProgramName, "\n", ProgramVersion, "\n", Copyright); //Programm-Information anzeigen
+
+ // DLL-Information anzeigen
+ labelDLLInfo.Text = String.Concat(AboutBox.DllName, "\n", AboutBox.DllVersion, "\n", AboutBox.Copyright);
+ }
+
private void button_Click(object sender, EventArgs e)
{
- //
- //Diese Zeile und die dazugehörige Methode in das Programm kopieren
- //
+ //--------------------------------------------------------------
+ //--- Diesen Bereich ins eigene Programm einfügen --- Anfang ---
+ //--------------------------------------------------------------
// Zeigt das 'AboutBox' Fenster an
- ShowAboutBox(name, version, copyright);
+ var about = new AboutBox(ProgramName, ProgramVersion, Copyright);
+ about.ShowDialog();
+ //--------------------------------------------------------------
+ //--- Diesen Bereich ins eigene Programm einfügen --- Ende ---
+ //--------------------------------------------------------------
}
- private void ShowAboutBox(string programName, string programVersion, string programCopyright)
+ private void buttonAboutWithDllInfo_Click(object sender, EventArgs e)
{
- var about = new Eugen.ESystem.Windows.Forms.AboutBox(programName, programVersion, programCopyright);
- about.ShowDialog();
+ // Zeigt das 'AboutBox' Fenster mit DLL-Informationen an
+ var aboutDll = new AboutBox(ProgramName, ProgramVersion, Copyright, true);
+ aboutDll.ShowDialog();
+ }
- labelInfo.Text = String.Concat(AboutBox.DllName, "\n", AboutBox.DllVersion, "\n", AboutBox.Copyright);
+ private void button1buttonAboutWithCustomerIconAndDllInfo_Click(object sender, EventArgs e)
+ {
+ // Zeigt das 'AboutBox' Fenster mit Customer Icon und DLL-Informationen an
+ Icon icon = new Icon(@"H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\AboutBox.git\Daten\Customer.ico");
+ var aboutDll = new AboutBox(ProgramName, ProgramVersion, Copyright, icon, true);
+ aboutDll.ShowDialog();
}
}
}