Get Assembly Copyright - CSharp System.Reflection

CSharp examples for System.Reflection:Assembly

Description

Get Assembly Copyright

Demo Code

// The MIT License
using System.Runtime.InteropServices;
using System.Reflection;
using System.Linq;
using System;//  www.j  a va2  s .  c o  m

public class Main{
        public static string GetAssemblyCopyright(this Assembly assembly)
        {
            var query = from copyrights in assembly.GetCustomAttributes<AssemblyCopyrightAttribute>()
                        select copyrights;

            if(1 == query.Count())
            {
                return query.First().Copyright;
            }

            return "";
        }
}

Related Tutorials