Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 1.03 KB

SX1101.md

File metadata and controls

36 lines (27 loc) · 1.03 KB

SX1101

TypeName SX1101DoNotPrefixLocalMembersWithThis
CheckId SX1101
Category Readability Rules

Cause

A call to an instance member of the local class or a base class is prefixed with this..

Rule description

A violation of this rule occurs whenever the code contains a call to an instance member of the local class or a base class which is prefixed with this.. An exception is made when the name of a method parameter conflicts with identifier after the this. prefix, in that case no violation is reported. This rule is disabled by default. When enabling this rule, the SA1101 rule should be disabled.

How to fix violations

To fix a violation of this rule, remove the 'this.' prefix before the call to the class member.

How to suppress violations

#pragma warning disable SX1101 // DoNotPrefixLocalMembersWithThis
#pragma warning restore SX1101 // DoNotPrefixLocalMembersWithThis