私は、MonoDevelop 2.4.2をOS X(Unity 3.4.1に付属しているバージョン)用に使用しており、基本クラスまたはプロパティからコメントを継承する方法があるかどうか疑問に思っていました。オーバーライドプロパティのXMLコメント
例:私は、彼らがこの時点でエディタでどのように動作するかで、ほとんど心配が
public class Foo
{
/// <summary>
/// The describes the ABC property
/// </summary>
public virtual int ABC
{
get { return _abc; }
set { _abc = value; }
}
protected int _abc;
/// <summary>
/// The describes the XYZ property
/// </summary>
public virtual int XYZ
{
get { return _xyz; }
set { _xyz = value; }
}
protected int _xyz;
}
public class Bar : Foo
{
public override int ABC
{
set
{
// DO SOMETHING
base.ABC = value;
}
}
}
Bar bar = new Bar();
// In MonoDevelop 2.4.2 (OS X), the ABC property doesn't show the comments
// in the autocomplete popup or when you hover the mouse over the property.
int abc = bar.ABC;
// ... but they do show up for XYZ, because it doesn't override
int xyz = bar.XYZ;
この質問は、 Comment Inheritance for C# (actually any language)と少し似ているようだが、これはMonoDevelopのに固有のものです。
MonoDevelopのに有効であると表示されません(または私はそれを悪用しています)、およびGhostdocは、Visual Studio用です< inheritdoc/>、呼ばその問題の解決策の一部。
唯一の解決策は、継承されたクラスのプロパティコメントを複製することだと思われます。選択肢はありますか?
私は、//何かのためにオーバーライド可能なOnABCChanged()関数を使用します。 – CodingBarfield