This article describes two related rules, IDE0003 and IDE0009.
Property
Value
Rule ID
IDE0003
Title
Removethis or Me qualification
Category
Style
Subcategory
Language rules ('this.' and 'Me.' qualifiers)
Applicable languages
C# and Visual Basic
Options
dotnet_style_qualification_for_field
dotnet_style_qualification_for_property
dotnet_style_qualification_for_method
dotnet_style_qualification_for_event
Property
Value
Rule ID
IDE0009
Title
Addthis or Me qualification
Category
Style
Subcategory
Language rules ('this.' and 'Me.' qualifiers)
Applicable languages
C# and Visual Basic
Options
dotnet_style_qualification_for_field
dotnet_style_qualification_for_property
dotnet_style_qualification_for_method
dotnet_style_qualification_for_event
Overview
These two rules define whether or not you prefer the use of this (C#) and Me. (Visual Basic) qualifiers. To enforce that the qualifiers aren't present, set the severity of IDE0003 to warning or error. To enforce that the qualifiers are present, set the severity of IDE0009 to warning or error.
For example, if you prefer qualifiers for fields and properties but not for methods or events, then you can enable IDE0009 and set the options dotnet_style_qualification_for_field and dotnet_style_qualification_for_property to true. However, this configuration would not flag methods and events that do have this and Me qualifiers. To also enforce that methods and events don't have qualifiers, enable IDE0003.
An option value of true means prefer the code symbol to be prefaced with this. in C# and Me. in Visual Basic. An option value of false means prefer the code element not to be prefaced with this. or Me..
For more information about configuring options, see Option format.
dotnet_style_qualification_for_field
Property
Value
Description
Option name
dotnet_style_qualification_for_field
Option values
true
Prefer fields to be prefaced with this. in C# or Me. in Visual Basic
false
Prefer fields not to be prefaced with this. or Me.
Bạn có thể tìm thấy nguồn cho nội dung này trên GitHub, nơi bạn cũng có thể tạo và xem lại các vấn đề và yêu cầu kéo. Để biết thêm thông tin, hãy xem hướng dẫn dành cho người đóng góp của chúng tôi.
Ý kiến phản hồi về .NET
.NET là một dự án nguồn mở. Chọn liên kết để cung cấp ý kiến phản hồi:
Tham gia chuỗi buổi gặp gỡ để xây dựng các giải pháp AI có thể mở rộng dựa trên các trường hợp sử dụng trong thế giới thực với các nhà phát triển và chuyên gia đồng nghiệp.