access parent class?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Justin Rich

    #1

    access parent class?

    i have a class Workstations which inherits collectionbase.
    basically Workstations is a collection of Workstation's

    my workstations collection has a property called ValidatedCount

    the workstation class has a method called Validate()

    what i would like to do is use the Workstations class to have a count
    (inherited from collectionbase) and have a ValidatedCount. ..

    how do i access the parent class to increase the ValidatedCount property
    from the Workstion object in the Workstations class?

    Thanks
    Justin


  • Jon Skeet [C# MVP]

    #2
    Re: access parent class?

    On Sep 11, 2:24 pm, "Justin Rich" <jrich...@yahoo .spam.comwrote:
    i have a class Workstations which inherits collectionbase.
    basically Workstations is a collection of Workstation's
    >
    my workstations collection has a property called ValidatedCount
    >
    the workstation class has a method called Validate()
    >
    what i would like to do is use the Workstations class to have a count
    (inherited from collectionbase) and have a ValidatedCount. ..
    >
    how do i access the parent class to increase the ValidatedCount property
    from the Workstion object in the Workstations class?
    There's no natural concept of a "parent" in this case - after all,
    unless you've specifically precluded it, a Workstation could be part
    of multiple Workstations collections.

    Does it take long to validate a Workstation instance? If not, I'd just
    make the ValidateCount iterate through all the Workstation instances
    in the collection and call Validate on each of them.

    Jon

    Comment

    Working...