相关疑难解决方法(0)

C#属性必需属性

我已经创建了属性

    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
    [Serializable]
    public class TestPropertyAttribute : System.Attribute
    {
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }string _name;
    }
Run Code Online (Sandbox Code Playgroud)

我应该将"名称"标记为此属性的强制属性.怎么做?

.net c# attributes

4
推荐指数
1
解决办法
9682
查看次数

标签 统计

.net ×1

attributes ×1

c# ×1