2 // AssemblyInfo.cs: Assembly Informations
5 // Sebastien Pouliot <sebastien@ximian.com>
7 // Copyright (C) 2004-2008 Novell Inc. (http://www.novell.com)
11 using System.Reflection;
12 using System.Runtime.CompilerServices;
15 // AssemblyTitle - included in tool's source code
16 // AssemblyDescription - included in tool's source code
18 [assembly: AssemblyCompany("Motus Technologies, Novell")]
19 [assembly: AssemblyProduct("Mono Security Tools")]
20 [assembly: AssemblyCopyright("Copyright 2002, 2003 Motus Technologies. Copyright 2004-2008 Novell. BSD licensed.")]
21 [assembly: AssemblyVersion (Consts.MonoVersion)]
23 //[assembly: AssemblyConfiguration("")]
24 //[assembly: AssemblyTrademark("")]
25 //[assembly: AssemblyCulture("")]
26 //[assembly: AssemblyDelaySign(true)]
27 //[assembly: AssemblyKeyFile("sectools.pub")]
28 //[assembly: AssemblyKeyName("")]
30 namespace Mono.Tools {
32 public class AssemblyInfo {
35 private string _title;
36 private string _copyright;
37 private string _description;
38 private string _version;
40 public AssemblyInfo ()
41 : this (Assembly.GetExecutingAssembly ())
45 public AssemblyInfo (Assembly a)
48 throw new ArgumentNullException ("a");
50 AssemblyName an = a.GetName ();
51 _name = an.ToString ();
53 object [] att = a.GetCustomAttributes (typeof (AssemblyTitleAttribute), false);
54 _title = ((att.Length > 0) ? ((AssemblyTitleAttribute) att [0]).Title : String.Empty);
56 att = a.GetCustomAttributes (typeof (AssemblyCopyrightAttribute), false);
57 _copyright = ((att.Length > 0) ? ((AssemblyCopyrightAttribute) att [0]).Copyright : String.Empty);
59 att = a.GetCustomAttributes (typeof (AssemblyDescriptionAttribute), false);
60 _description = ((att.Length > 0) ? ((AssemblyDescriptionAttribute) att [0]).Description : String.Empty);
62 _version = an.Version.ToString ();
65 public string Copyright {
66 get { return _copyright; }
69 public string Description {
70 get { return _description; }
78 get { return _title; }
81 public string Version {
82 get { return _version; }
85 public override string ToString ()
87 StringBuilder sb = new StringBuilder ();
88 sb.AppendFormat ("{1} - version {2}{0}{3}{0}{4}{0}",
93 return sb.ToString ();