属性摘要

时间:2015-04-27 19:43:41

标签: c# c#-4.0

这是我的代码:

[AttributeUsage(AttributeTargets.Property)]
public class EncryptAttribute : Attribute
{
    /// <summary>
    /// If you use this attribute, database attribute size must be caclulated as such: 
    /// dbAttributeSize = (Math.Floor(fieldLength / 16) + 1) * 32
    /// </summary>
    public EncryptAttribute()
    {

    }
}

如您所见,如果用户选择使用Encrypt属性,我希望在VisualStudio的Intellisense中向用户显示一个公式。

但是,摘要不会出现。我错过了什么?

感谢。

1 个答案:

答案 0 :(得分:2)

在类级别应用摘要,而不是构造函数级别。

/// <summary>
/// If you use this attribute, database attribute size must be calculated as such: 
/// dbAttributeSize = (Math.Floor(fieldLength / 16) + 1) * 32
/// </summary>
[AttributeUsage(AttributeTargets.Property)]
public class EncryptAttribute : Attribute
{
    public EncryptAttribute()
    {    
    }
}

此外,您拼错了caclulated,应该是calculated