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