Default Property

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Shawn B.

    #1

    Default Property

    How do I set a default property in C#? In VB we use the default keyword
    before the property.


    Thanks,
    Shawn


  • Frank Oquendo

    #2
    Re: Default Property

    Shawn B. wrote:[color=blue]
    > How do I set a default property in C#? In VB we use the default
    > keyword before the property.[/color]

    ..NET does not support default properties.

    --
    There are 10 kinds of people. Those who understand binary and those who
    don't.




    Comment

    • Mattias Sjögren

      #3
      Re: Default Property

      Shawn,
      [color=blue]
      >How do I set a default property in C#? In VB we use the default keyword
      >before the property.[/color]

      You use indexer syntax:

      public string this[int idx]
      {
      get { ... }
      set { ... }
      }



      Mattias

      --
      Mattias Sjögren [MVP] mattias @ mvps.org

      Please reply only to the newsgroup.

      Comment

      Working...