How To Display The Inheritance Hierarchy For Interfaces In CSharp

Topics: User Forum
Oct 9, 2009 at 3:02 AM

Hi,

I defined a lot of classes and interfaces for my project. The classes or abstract classes does have Inheritance Hierarchy on the bottom of each class's main page, however, all the interfaces will not, even their definition is not correct.

For example:

 

/// <summary>
/// SerializeIn interface
/// </summary>
public interface ISerializeIn
{
    /// <summary>
    /// A SerializeIn function with specific archive and version number
    /// </summary>
    /// <param name="ar">The specific archive</param>
    /// <param name="version">The version number</param>
    void SerializeIn(IArchiveIn ar, uint version);
}

/// <summary>
/// SerializeOut interface
/// </summary>
public interface ISerializeOut
{
    /// <summary>
    /// A SerializeOut function with specific archive
    /// </summary>
    /// <param name="ar">The specific archive</param>
    void SerializeOut(IArchiveOut ar);

    /// <summary>
    /// Get the Lee-based type
    /// </summary>
    CacTypeID TypeID { get; }
}

/// <summary>
/// Serialize interface
/// </summary>
public interface ISerialize : ISerializeIn, ISerializeOut
{
    
}

/// <summary>
/// Lee object interface
/// </summary>
public interface ILeeObject : ISerialize
{
    /// <summary>
    /// Database ID at the server side
    /// </summary>
    long Dbid { get; set; }
}


 

I will get this in the *.chm file:

 

public interface ILeeObject : ISerialize, 
	ISerializeIn, ISerializeOut

 

however, what I need is:

public interface ILeeObject : ISerialize

And there is no Inheritance Hierarchy on the bottom of each interface's main page.

Are there any flag to set for the interface to make it work like class (for the interface's Inheritance Hierarchy)?

Thx a million.

Peter Lee

Coordinator
Oct 19, 2009 at 8:29 PM
Edited Oct 19, 2009 at 8:34 PM

It lists all three interfaces because that info comes from the <implements> elements of the reflection information.  Technically, it is correct since the class does implement all three interfaces.  It just doesn't make the distinction that the one implements the other two as well.  Looking at the assembly in Reflector, you'll see it does the same thing on the class disassembly and shows all three interfaces.

There is no ancestor information for interfaces in the reflection information file which is why there's no inheritance hierarchy in the topics.  Whether that's an oversight or by design, I can't say.

Eric