Cref to Inherited Property.

Apr 29, 2010 at 9:53 AM

Hi. I', not able to create a cref to a inherited property, by refering the ChildClass.Propertyname in <see cref="ChildClass.Propertyname"/>
Can anyone please explain to me what I'm doing wrong in the example below?

Regards
Frode.

Example:

    /// <summary>
    /// The base class
    /// </summary>
    public abstract class Base
    {
        /// <summary>
        /// Gets or sets the ID.
        /// </summary>
        /// <value>The ID.</value>
        public int ID { get; set; }

        /// <summary>
        /// Does some thing.
        /// </summary>
        public abstract void DoSomeThing();
    }

    /// <summary>
    /// Implementation of <see cref="Base"/>.
    /// <br/>
    /// Cref to the <see cref="Implementation1.ID"/> don't work, Compiler Warning (level 1) CS1574.
    /// <br/>
    /// Creaf to the <see cref="Base.ID"/> works, but links to the base class.
    /// <br/>
    /// Cref to the <see cref="P:Implementation1.ID"/> seems to work but result in broken link after SandCastle build.
    /// </summary>
    public class Implementation1 : Base
    {
        /// <summary>
        /// Does some thing.
        /// </summary>
        /// <remarks>
        /// Cref to the <see cref="Implementation1.ID"/> don't work, Compiler Warning (level 1) CS1574.
        /// <br/>
        /// Cref to the <see cref="P:Implementation1.ID"/> and <see cref="P;ID"/>, seems to work but result in broken link after SandCastle build.
        /// <br/>
        /// Cref to the <see cref="Base.ID"/> works.
        /// </remarks>
        public override void DoSomeThing()
        {
            throw new NotImplementedException();
        }
    }

 

 

Coordinator
Apr 29, 2010 at 3:14 PM

The ID property does not physically exist in the derived class, only in the base class.  As such, you can only link to the base class for documentation for it.  Inherited members show up on the member list pages of derived classes but it will not duplicate entries in the TOC for derived members.

Eric