Cosmos/source/Cosmos.IL2CPU/CompilerExtensionAttribute.cs
José Pedro 3db5ce43bb Compiler fixes.
Compiler fixes.
Updated project.json files.
Removed *.lock.json files and updated gitignore to ignore them.
Updated some Cosmos.Debug projects.
2017-01-08 14:54:29 +00:00

24 lines
699 B
C#

using System;
using System.Reflection;
namespace Cosmos.IL2CPU
{
[AttributeUsage(AttributeTargets.Assembly, Inherited=false, AllowMultiple=true)]
public class CompilerExtensionAttribute: Attribute
{
public readonly Type Type;
public CompilerExtensionAttribute(Type type)
{
if (type == null)
{
throw new ArgumentNullException("type");
}
if (!type.GetTypeInfo().IsSubclassOf(typeof(CompilerExtensionBase)))
{
throw new ArgumentException("CompilerExtensions should inherit from CompilerExtensionBase!", "type");
}
Type = type;
}
}
}