代码之家  ›  专栏  ›  技术社区  ›  ActiveX

指定要在其中自定义属性的内联数组VB.NET版

  •  0
  • ActiveX  · 技术社区  · 15 年前

    我想知道是否有任何方法可以指定一个内联数组(比如说字符串)

    我有下面的例子,没有编译在vb.net版(.net 1.1):

    Attributes.ManyToOne(New String() {"a", "b", "c"})> _
    Public Property PaymentTerms() As PaymentTerms
    

    该属性在另一个程序集中定义为:

    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
     public class ManyToOne : System.Attribute
     {
      private string[] _columns;
    
    
      public ManyToOne(string[] columns)
      {
       _columns = columns;
      }
    
      public string[] Columns
      {
       get { return _columns; }
       set { _columns = value; }
      }
     }
    

    1 回复  |  直到 15 年前
        1
  •  1
  •   ActiveX    15 年前