可能性の重複:次のサンプルコードで
How to force indentation of C# conditional directives?
Can visual studio automatically indent/format preprocessing directives?#if指令をコードにインデントする方法は?
が#if
ディレクティブがあるが、インデントの欠如に気づく:
else
{
#if DEBUG
Debug.Print(ex.Message);
#endif
return null;
}
私はこれを知っていますおそらくこれのようなものです純粋な開発練習ですが、正直なところVS.NET内では気にせず、自分のコードに合わせることを好みます。 #
ディレクティブがVS.NETのコードの残りの部分とインラインで自動的に字下げされるようにする方法はありますか?
ありがとうございます!
可能な重複:http://stackoverflow.com/questions/10548319/can-visual-studio-automatically-indent-format-preprocessing-directives、http://stackoverflow.com/questions/1321228/how-to-コンストレインド・オブ・Cシャープ・コンディション・ディレクティブ –
また、ConditionalAttribute(http://stackoverflow.com/questions/3786827/alternatives-to-conditional-compilation-in-c-sharp)を使用して検討する必要があります – Surfbutler