using System; using System.Drawing; using System.Reflection; using System.Diagnostics; using System.Windows.Forms; namespace Kackman.Framework { public static class ApplicationExtension { public static Image Image { get { Uri uri = new Uri(Assembly.GetEntryAssembly().CodeBase); using (Icon icon = Icon.ExtractAssociatedIcon(uri.LocalPath)) return icon.ToBitmap(); } } public static string Copyright { get { Assembly assembly = Assembly.GetEntryAssembly(); AssemblyCopyrightAttribute[] attrs = (AssemblyCopyrightAttribute[])assembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); if (attrs.Length > 0) return attrs[0].Copyright; return string.Empty; } } public static string Trademark { get { Assembly assembly = Assembly.GetEntryAssembly(); AssemblyTrademarkAttribute[] attrs = (AssemblyTrademarkAttribute[])assembly.GetCustomAttributes(typeof(AssemblyTrademarkAttribute), false); if (attrs.Length > 0) return attrs[0].Trademark; return string.Empty; } } public static string Description { get { Assembly assembly = Assembly.GetEntryAssembly(); AssemblyDescriptionAttribute[] attrs = (AssemblyDescriptionAttribute[])assembly.GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false); if (attrs.Length > 0) return attrs[0].Description; return string.Empty; } } } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)
10 PRINT "Don is cool" 20 GOTO 10