Re: Something more serious than Obsolete.

Adam Sills <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.clr
Message-ID <[email protected]>
[Obsolete( "message", true )]

Will provide a compiler error instead of a warning.

-----Original Message-----
From: Discussion of development on the .NET platform using any managed language [mailto:[email protected]] On Behalf Of Peter Obiefuna
Sent: Wednesday, January 02, 2008 5:03 PM
To: [email protected]
Subject: [DOTNET-CLR] Something more serious than Obsolete.

Hi,
Hope everyone is having a happy new year so far!

I intend to block compile-time access to some inherited methods. My
preference would be a method Attribute that throws a compile-time error.
Does anyone know of any?

----------------------------
 [Obsolete("This method is invalid for an empty collection.")]
 protected  override void InsertItem(int index, TDomain item)
 {
     throw new InvalidOperationException(
        "This method is invalid for an empty collection.");
 }
---------------------------

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.