我有一个带有否定标志的类(“DoNot {Action}”)。我想将此标志更改为肯定的“Do”并更改代码中的所有检查,基本上否定它们。有这样的重构吗?
这是一个例子。如果我将标志 DoNotFilter 更改为 DoFilter,所有查看此标志的代码都应相应更改。
public bool DoNotFilter
{get;private set;}
更改为
public bool DoFilter
{get;private set;}
所以
if (attribute.DoNotFilter == true)
需要更改为
if (attribute.DoFilter == false)