Merge branch 'Reflection' of Common/Utils into dev

This commit is contained in:
Drew Tingen
2018-04-18 19:27:19 +00:00
committed by Gogs
2 changed files with 18 additions and 0 deletions

View File

@@ -3,3 +3,8 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- Adding extension method for getting Informational Version from an Assembly

View File

@@ -57,5 +57,18 @@ namespace ICD.Common.Utils.Extensions
string path = extends.GetPath();
return path == null ? DateTime.MinValue : IcdFile.GetCreationTime(path);
}
/// <summary>
/// Gets the informational version for the given assembly.
/// </summary>
/// <param name="extends"></param>
/// <returns></returns>
public static string GetInformationalVersion(this Assembly extends)
{
if (extends == null)
throw new ArgumentNullException("extends");
return extends.GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
}
}
}