次の方法で共有


Debug.Indent メソッド

現在の IndentLevel を 1 だけ増やします。

名前空間: System.Diagnostics
アセンブリ: System (system.dll 内)

構文

'宣言
<ConditionalAttribute("DEBUG")> _
Public Shared Sub Indent
'使用

Debug.Indent
[ConditionalAttribute("DEBUG")] 
public static void Indent ()
[ConditionalAttribute(L"DEBUG")] 
public:
static void Indent ()
/** @attribute ConditionalAttribute("DEBUG") */ 
public static void Indent ()
ConditionalAttribute("DEBUG") 
public static function Indent ()

使用例

インデント レベルを設定し、デバッグ メッセージを出力する例を次に示します。

Debug.WriteLine("List of errors:")
Debug.Indent()
Debug.WriteLine("Error 1: File not found")
Debug.WriteLine("Error 2: Directory not found")
Debug.Unindent()
Debug.WriteLine("End of list of errors")
Debug.WriteLine("List of errors:");
Debug.Indent();
Debug.WriteLine("Error 1: File not found");
Debug.WriteLine("Error 2: Directory not found");
Debug.Unindent();
Debug.WriteLine("End of list of errors");
  
#if defined(DEBUG)
Debug::WriteLine( "List of errors:" );
Debug::Indent();
Debug::WriteLine( "Error 1: File not found" );
Debug::WriteLine( "Error 2: Directory not found" );
Debug::Unindent();
Debug::WriteLine( "End of list of errors" );
#endif
Debug.WriteLine("List of errors:");
Debug.Indent();
Debug.WriteLine("Error 1: File not found");
Debug.WriteLine("Error 2: Directory not found");
Debug.Unindent();
Debug.WriteLine("End of list of errors");
@if(@DEBUG)
Debug.WriteLine("List of errors:");
Debug.Indent();
Debug.WriteLine("Error 1: File not found");
Debug.WriteLine("Error 2: Directory not found");
Debug.Unindent();
Debug.WriteLine("End of list of errors");
@end

この例外によって、次の出力が生成されます。

List of errors
     Error 1: File not found
     Error 2: Directory not found
 End of list of errors
   

プラットフォーム

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。

バージョン情報

.NET Framework

サポート対象 : 2.0、1.1、1.0

参照

関連項目

Debug クラス
Debug メンバ
System.Diagnostics 名前空間
Unindent
IndentLevel
IndentSize