【问题标题】:GhostDoc Context.CurrentCodeElement.HasBaseTypes always returns falseGhostDoc Context.CurrentCodeElement.HasBaseTypes 始终返回 false
【发布时间】:2016-02-05 06:06:05
【问题描述】:

关于如何使用 Ghost Doc 获取类的基本类型的任何想法?

根据当前类继承的基类,我想自定义当前类的摘要注释。

这是我目前所拥有的:

private string GetClassDescription()
    {
        string type = string.Empty;
        Words words = Context.GetWords(Context.CurrentCodeElement.Name);
        string wordsAll = (words == null ? Context.CurrentCodeElement.Name : words.All);

        if (Context.CurrentCodeElement.HasBaseTypes)
            type = Context.CurrentCodeElement.BaseTypes[0];

        if (Context.)

        switch (type)
        {
            case "DomainBase":
                return string.Format("Represents the {0} domain class.", wordsAll);

            default:
                return string.Format("Represents the {0} class.", wordsAll);
        }
    }

【问题讨论】:

  • 您目前使用的 GhostDoc 版本是什么?源文件是什么语言 - C#、VB、C++ 或 JavaScript?

标签: c# .net ghostdoc


【解决方案1】:

这是 GhostDoc - SubMain 的创建者发现的问题,并已在版本 5.1.16036 中修复。

【讨论】:

    猜你喜欢
    • 2011-11-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-22
    • 2020-10-03
    • 2017-01-18
    相关资源
    最近更新 更多