Skip to content

Commit

Permalink
Add files via upload (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjohne authored Oct 26, 2021
1 parent e559a0d commit 47ff758
Show file tree
Hide file tree
Showing 16 changed files with 557 additions and 1,565 deletions.
178 changes: 87 additions & 91 deletions Numeric List Generator/AboutBoxForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

137 changes: 93 additions & 44 deletions Numeric List Generator/AboutBoxForm.cs
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
}
}
Loading

0 comments on commit 47ff758

Please sign in to comment.