Changeset 3728 for trunk/sources/HeuristicLab.Core/3.3/Attributes
- Timestamp:
- 05/09/10 01:43:38 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core/3.3/Attributes/ItemAttribute.cs
r2931 r3728 21 21 22 22 using System; 23 using System.Linq; 24 using System.Reflection; 23 25 using HeuristicLab.Common; 24 26 … … 56 58 else return string.Empty; 57 59 } 60 public static Version GetVersion(Type type) { 61 Assembly assembly = Assembly.GetAssembly(type); 62 AssemblyFileVersionAttribute version = assembly.GetCustomAttributes(typeof(AssemblyFileVersionAttribute), true). 63 Cast<AssemblyFileVersionAttribute>().FirstOrDefault(); 64 if (version != null) { 65 return new Version(version.Version); 66 } else { 67 return assembly.GetName().Version; 68 } 69 } 58 70 } 59 71 }
Note: See TracChangeset
for help on using the changeset viewer.