C#


ROSLYN.DESIGN.CA1043 : Use Integral Or String Argument For Indexers (C#)

See Roslyn-Detected C# Warning Classes for more information.

要旨

Indexers, that is, indexed properties, should use integer or string types for the index. These types are typically used for indexing data structures and increase the usability of the library. Use of the Object type should be restricted to those cases where the specific integer or string type cannot be specified at design time. If the design requires other types for the index, reconsider whether the type represents a logical data store. If it does not represent a logical data store, use a method.

この指摘はRoslynのCA1043に該当します。ルール詳細につい ては、下記リンクを参照してください。 CA1043

プロパティ

クラス名 Use Integral Or String Argument For Indexers (C#)
日本語クラス名 Use Integral Or String Argument For Indexers (C#)
クラス分類 信頼性 (reliability)
ニーモニック ROSLYN.DESIGN.CA1043
カテゴリー なし
対応言語 C# で利用可能です。
有効/無効設定 このワーニングクラスのチェックはデフォルトで無効になっています。チェックを有効にするにはプロジェクト設定ファイル (configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += allow class="Use Integral Or String Argument For Indexers (C#)"

関連のある設定ファイルパラメータ

設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。