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
}
私が得ているエラーは次のとおりです。
属性引数は、定数式、typeof 式、または属性パラメーター タイプの配列作成式でなければなりません
カスタム属性を削除すると、コンパイル エラーは発生しません。