2016-02-05 234 views
0

有关如何使用Ghost Doc获取类的基类型的任何想法?GhostDoc Context.CurrentCodeElement.HasBaseTypes总是返回false

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

这是我到目前为止有:

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); 
     } 
    } 
+0

你目前使用的是什么版本的GhostDoc?源文件是什么语言 - C#,VB,C++或JavaScript? – sergeb

回答

0

这是由GhostDoc的创造者认可的一个问题 - SubMain并有固定的版本5.1.16036问题。