Skip to content

Commit

Permalink
Merge pull request #21 from Mijo-Software/mjohne-patch-1
Browse files Browse the repository at this point in the history
Add files via upload
  • Loading branch information
mjohne authored Oct 19, 2023
2 parents f8fcdc6 + 3a983a0 commit 1dcb788
Show file tree
Hide file tree
Showing 21 changed files with 2,387 additions and 12 deletions.
91 changes: 91 additions & 0 deletions AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
using System.Reflection;

namespace MijoSoftware.AssemblyInformation
{
/// <summary>
/// Provide some assembly information
/// </summary>
public static class AssemblyInfo
{
#region Assembly attribute accessors

/// <summary>
/// Return the title of the assembly
/// </summary>
public static string AssemblyTitle
{
get
{
object[] attributes = Assembly.GetExecutingAssembly()
.GetCustomAttributes(attributeType: typeof(AssemblyTitleAttribute), inherit: false);
if (attributes.Length > 0)
{
AssemblyTitleAttribute titleAttribute = attributes[0] as AssemblyTitleAttribute;
if (!string.IsNullOrEmpty(value: titleAttribute.Title))
{
return titleAttribute.Title;
}
}
return Path.GetFileNameWithoutExtension(path: Assembly.GetExecutingAssembly().CodeBase);
}
}

/// <summary>
/// Return the version of the assembly
/// </summary>
public static string AssemblyVersion => Assembly.GetExecutingAssembly().GetName().Version.ToString();

/// <summary>
/// Return the description of the assembly
/// </summary>
public static string AssemblyDescription
{
get
{
object[] attributes = Assembly.GetExecutingAssembly()
.GetCustomAttributes(attributeType: typeof(AssemblyDescriptionAttribute), inherit: false);
return attributes.Length == 0 ? string.Empty : ((AssemblyDescriptionAttribute)attributes[0]).Description;
}
}

/// <summary>
/// Return the product name of the assembly
/// </summary>
public static string AssemblyProduct
{
get
{
object[] attributes = Assembly.GetExecutingAssembly()
.GetCustomAttributes(attributeType: typeof(AssemblyProductAttribute), inherit: false);
return attributes.Length == 0 ? string.Empty : ((AssemblyProductAttribute)attributes[0]).Product;
}
}

/// <summary>
/// Return the copyright of the assembly
/// </summary>
public static string AssemblyCopyright
{
get
{
object[] attributes = Assembly.GetExecutingAssembly()
.GetCustomAttributes(attributeType: typeof(AssemblyCopyrightAttribute), inherit: false);
return attributes.Length == 0 ? string.Empty : ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
}
}

/// <summary>
/// Return the company name of the assembly
/// </summary>
public static string AssemblyCompany
{
get
{
object[] attributes = Assembly.GetExecutingAssembly()
.GetCustomAttributes(attributeType: typeof(AssemblyCompanyAttribute), inherit: false);
return attributes.Length == 0 ? string.Empty : ((AssemblyCompanyAttribute)attributes[0]).Company;
}
}
#endregion
}
}
1,157 changes: 1,157 additions & 0 deletions FdtmForm.Designer.cs

Large diffs are not rendered by default.

Loading

0 comments on commit 1dcb788

Please sign in to comment.