質問

私の訪問の一部古いコードがかなりの数のイベントで宣言された代表者を手動でEventHandler<T>このよう:

/// <summary>
/// Delegate for event Added
/// </summary>
/// <param name="index">Index of the item</param>
/// <param name="item">The item itself</param>
public delegate void ItemAdded(int index, T item);

/// <summary>
/// Added is raised whenever an item is added to the collection
/// </summary>
public event ItemAdded Added;

カフェまでも使用でどの図書館かしなXMLコメントに加えるとともに、発生するイベントの宣言です。いってみようと、私の思いは次のいずれかに

  • 取得設を無視し、自動生成された民間分野に黙っても無視するすべての民間分野の全て

または

  • XMLの取得のコメントが生成され、民間分野

その実現のことなくリファクタリングのコードを眺めるようになります:

/// <summary>
/// Delegate for event <see cref="Added"/>
/// </summary>
/// <param name="index">Index of the item</param>
/// <param name="item">The item itself</param>
public delegate void ItemAdded(int index, T item);

/// <summary>
/// Private storage for the event firing delegate for the <see cref="Added"/> event
/// </summary>
private ItemAdded _added;

/// <summary>
/// Added is raised whenever an item is added to the collection
/// </summary>
public event ItemAdded Added
{
    add
    {
        _added += value;
    }
    remove
    {
        _added -= value;
    }
}
役に立ちましたか?

解決

次善ますが、私は手動でこれらの線に沿って、プロジェクトの名前空間レベルのドキュメントが含まれているファイルにXMLコメントを入れてあった、これを回避する方法を見つけます:

<member name="F:myCompany.Common.Collections.Generic.EventableCollection`1.Added">
  <summary>
    Auto-generated backing field for the <see cref="E:myCompany.Common.Collections.Generic.EventableSortedList`1.Added">Added</see> event
  </summary>
</member>

これは、私は必要なものおおよそ与えます。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top