-
Obsolete Attribute
I want to apply an Attribute to a method which is obsolete. Is this the proper way to do this. I don't have Visual Basic .Net yet so im guessing. Thanks. :p
Code:
Public Class Boo
Private String strMentalState
<Obsolete("Scare is obsolete, Use Startle instead")>Public Property Scare() As String
Get
Return strmMentalState
End Get
Set(ByVal strMentalState As String)
Me.strMentalState = strMentalState
End Property
Public Function Startle() As String
End Function
Sub Main()
Dim b Boo = New Boo()
b.Scare("arghhhhh")
End Sub
End Class
-
-
Thanks Musician i wasn't too sure. One more thing if the class is marked with <System.ObsoleteAttribute("")> would that make every method contained within the class obsolete? Thanks :)
-
I only know of Obsolete and System.Obsolete is just the full namespace of the attribute - i.e. they are the same thing. You should search on msdn but it doesn't seem to be very well documented.