Could someone please explain to me why the following interface definition compiles with error in Visual Studio 2010?
[IncompleteCodePort(SourceOriginType.Other, "This should be a GL abstraction depending on what OpenGL API will be used")]
public interface IGL
{
/// <summary>
/// Returns true if provided function is available or supported by graphics API
/// </summary>
/// <param name="funcName"></param>
/// <returns></returns>
bool IsFunctionAvailable(string funcName);
/// <summary>
/// Returns true if provided function is supported as extension by graphics API
/// </summary>
/// <param name="funcName"></param>
/// <returns></returns>
bool IsExtensionAvailable(string funcName);
}
public class IncompleteCodePortAttribute : Attribute
{
public SourceOriginType SourceOriginType { get; private set; }
public string SourceUrl { get; private set; }
public string Reason { get; private set; }
public IncompleteCodePortAttribute(SourceOriginType originType, string reason, string sourceUrl = null)
{
SourceOriginType = originType;
SourceUrl = sourceUrl;
Reason = reason;
}
}
public enum SourceOriginType
{
CodePlex,
WorldWindJdk,
StackOverflow,
Other
}
and error I am getting is:
An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type
If I remove the custom attribute, I get no compile errors.