Inheriting a .net class

Ok here's what I'm trying to do I want to write a class that inherits everything from the class ListItem

class RealListItem : ListItem
{

  public string anExtraStringINeed;

}

For some reason or another .net is treating all the members like they are private when I try to do this so my class is worthless.

I tried to do a work around and do it like this:

class RealListItem : ListItem
{
  public string anExtraStringINeed;
  public ListItem list;
}

but it still doesn't work because I need to use it in a function that uses the accepts type ListItem and RealListItem isn't playing nice like it should. I can do aRealListItem.list but that only passes the list from RealListItem I need the whole object to be passed along.

Whats with this am I doing something wrong or will microsoft just not let you inherit .net classes?

Answers


The System.Web.UI.Controls.ListItem class is "sealed"... That means you cannot inherit from it...


Need Your Help

cell.imageView not showing an image

ios objective-c swift uiimage parse.com

i have a tableView where i'm trying to show a image in the cell.imageView, but whatever i do it wont show an image. the subclass of the imageView is a PFImageView. i've checked that the PFFile and

regex.Match runs slow

c# regex

I have a program extracting some information from a lot of large html pages. I found that the last line (myRegex.Match(detailPage)) takes most of the execution time. Is the regex pattern optimized?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.