Re: Something more serious than Obsolete.
Chris Anderson <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.clr |
|---|---|
| Message-ID | <[email protected]> |
Set the error parameter to true ?
[Obsolete("This method is invalid for an empty collection.", true)]
protected override void InsertItem(int index, TDomain item)
...
> -----Original Message-----
> From: Discussion of development on the .NET platform using any managed
> language [mailto:[email protected]] On Behalf Of Peter
> Obiefuna
> Sent: 02 January 2008 23:16
> 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.");
> }
> ---------------------------
>