Inverter instrução ifInvert if statement
Esta refatoração aplica-se a:This refactoring applies to:
- C#C#
- Visual BasicVisual Basic
O que: Permite inverter if
uma if else
instrução or sem alterar o significado do código.What: Lets you invert an if
or if else
statement without changing the meaning of the code.
Quando: Quando você tem uma if
if else
instrução ou que seria melhor entendida quando invertida.When: When you have an if
or if else
statement that would be better understood when inverted.
Por que: Inverter if
uma if else
instrução or manualmente pode levar muito mais tempo e possivelmente introduzir erros.Why: Inverting an if
or if else
statement by hand can take much longer and possibly introduce errors. Essa correção de código ajuda você a fazer a refatoração automaticamente.This code fix helps you do this refactoring automatically.
Refatoração de inverter instrução ifInvert if statement refactoring
Coloque o cursor em uma instrução
if
ouif else
.Place your cursor in anif
orif else
statement.Pressione Ctrl + .Press Ctrl+. para acionar o menu Ações e Refatorações Rápidas.to trigger the Quick Actions and Refactorings menu.
Selecione Inverter if.Select Invert if.