我想给我的类添加一个类属性向导,在类上面点右键,没看到添加类属性向导,我看VS.NET2003的教程里面就这么操作的,请高手指点一下.

解决方案 »

  1.   

    如果你说的是给class 添加Attribute
    那么你可以试试用 ctrl+k+ ctrl+x 导出 snippt 然后选择C#的Attribute,就会出现Attribute模板了。效果如下:
        [global::System.AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = true)]
        sealed class MyAttribute : Attribute
        {
            // See the attribute guidelines at 
            //  http://go.microsoft.com/fwlink/?LinkId=85236
            readonly string positionalString;        // This is a positional argument
            public MyAttribute(string positionalString)
            {
                this.positionalString = positionalString;            // TODO: Implement code here
                throw new NotImplementedException();
            }        public string PositionalString { get; private set; }        // This is a named argument
            public int NamedInt { get; set; }
        }
      

  2.   

    如果你说的是给你的class中间添加property
    那么直接在字段(field)上右键重构-->封装字段就可以了。