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