-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
557 additions
and
1,565 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,99 @@ | ||
using MijoSoftware.AssemblyInformation; | ||
|
||
using System; | ||
using System.Reflection; | ||
using System.Windows.Forms; | ||
|
||
namespace NumericListGenerator | ||
{ | ||
/// <summary> | ||
/// AboutBoxForm | ||
/// </summary> | ||
internal partial class AboutBoxForm : Form | ||
{ | ||
/// <summary> | ||
/// Constructor | ||
/// </summary> | ||
public AboutBoxForm() => InitializeComponent(); | ||
|
||
/// <summary> | ||
/// Set the information text in the status bar | ||
/// </summary> | ||
/// <param name="sender">object sender</param> | ||
/// <param name="e">event arguments</param> | ||
/// <remarks>The parameters <paramref name="e"/> and <paramref name="sender"/> are not needed, but must be indicated.</remarks> | ||
private void SetStatusbar_Enter(object sender, EventArgs e) => toolStripStatusLabel.Text = ((Control)sender).AccessibleDescription; | ||
|
||
/// <summary> | ||
/// Clear the information text in the status bar | ||
/// </summary> | ||
/// <param name="sender">object sender</param> | ||
/// <param name="e">event arguments</param> | ||
/// <remarks>The parameters <paramref name="e"/> and <paramref name="sender"/> are not needed, but must be indicated.</remarks> | ||
private void ClearStatusbar_Leave(object sender, EventArgs e) => toolStripStatusLabel.Text = string.Empty; | ||
|
||
/// <summary> | ||
/// Load the form | ||
/// </summary> | ||
/// <param name="sender">object sender</param> | ||
/// <param name="e">event arguments</param> | ||
/// <remarks>The parameters <paramref name="e"/> and <paramref name="sender"/> are not needed, but must be indicated.</remarks> | ||
private void AboutBoxForm_Load(object sender, EventArgs e) | ||
{ | ||
Text = $"Info über {AssemblyInfo.AssemblyTitle}"; | ||
labelProductName.Text = AssemblyInfo.AssemblyProduct; | ||
labelVersion.Text = $"Version {AssemblyInfo.AssemblyVersion}"; | ||
labelCopyright.Text = AssemblyInfo.AssemblyCopyright; | ||
labelCompanyName.Text = AssemblyInfo.AssemblyCompany; | ||
textBoxDescription.Text = AssemblyInfo.AssemblyDescription; | ||
} | ||
partial class AboutBoxForm : Form | ||
{ | ||
public AboutBoxForm() | ||
{ | ||
InitializeComponent(); | ||
Text = $"Info über {AssemblyTitle}"; | ||
labelProductName.Text = AssemblyProduct; | ||
labelVersion.Text = $"Version {AssemblyVersion}"; | ||
labelCopyright.Text = AssemblyCopyright; | ||
labelCompanyName.Text = AssemblyCompany; | ||
textBoxDescription.Text = AssemblyDescription; | ||
} | ||
|
||
#region Assemblyattributaccessoren | ||
|
||
public static string AssemblyTitle | ||
{ | ||
get | ||
{ | ||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(attributeType: typeof(AssemblyTitleAttribute), inherit: false); | ||
if (attributes.Length > 0) | ||
{ | ||
AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0]; | ||
if (!string.IsNullOrEmpty(value: titleAttribute.Title)) | ||
{ | ||
return titleAttribute.Title; | ||
} | ||
} | ||
return System.IO.Path.GetFileNameWithoutExtension(path: Assembly.GetExecutingAssembly().CodeBase); | ||
} | ||
} | ||
|
||
public static string AssemblyVersion | ||
{ | ||
get | ||
{ | ||
return Assembly.GetExecutingAssembly().GetName().Version.ToString(); | ||
} | ||
} | ||
|
||
public static string AssemblyDescription | ||
{ | ||
get | ||
{ | ||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(attributeType: typeof(AssemblyDescriptionAttribute), inherit: false); | ||
if (attributes.Length == 0) | ||
{ | ||
return ""; | ||
} | ||
return ((AssemblyDescriptionAttribute)attributes[0]).Description; | ||
} | ||
} | ||
|
||
public static string AssemblyProduct | ||
{ | ||
get | ||
{ | ||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(attributeType: typeof(AssemblyProductAttribute), inherit: false); | ||
if (attributes.Length == 0) | ||
{ | ||
return ""; | ||
} | ||
return ((AssemblyProductAttribute)attributes[0]).Product; | ||
} | ||
} | ||
|
||
public static string AssemblyCopyright | ||
{ | ||
get | ||
{ | ||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(attributeType: typeof(AssemblyCopyrightAttribute), inherit: false); | ||
if (attributes.Length == 0) | ||
{ | ||
return ""; | ||
} | ||
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; | ||
} | ||
} | ||
|
||
public static string AssemblyCompany | ||
{ | ||
get | ||
{ | ||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(attributeType: typeof(AssemblyCompanyAttribute), inherit: false); | ||
if (attributes.Length == 0) | ||
{ | ||
return ""; | ||
} | ||
return ((AssemblyCompanyAttribute)attributes[0]).Company; | ||
} | ||
} | ||
#endregion | ||
} | ||
} |
Oops, something went wrong.