-
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.
Merge pull request #64 from Mijo-Software/mjohne-patch-1
Add files via upload
- Loading branch information
Showing
7 changed files
with
355 additions
and
386 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,87 @@ | ||
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 = (AssemblyTitleAttribute)attributes[0]; | ||
if (!string.IsNullOrEmpty(value: titleAttribute.Title)) | ||
{ | ||
return titleAttribute.Title; | ||
} | ||
} | ||
return System.IO.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 | ||
} | ||
} |
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
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
Oops, something went wrong.