ResumeProfile メソッドは、指定されたプロファイル レベルの保留/再開カウンターをデクリメントします。
名前空間: Microsoft.VisualStudio.Profiler
アセンブリ: Microsoft.VisualStudio.Profiler (Microsoft.VisualStudio.Profiler.dll 内)
構文
'宣言
Public Shared Function ResumeProfile ( _
profileLevel As ProfileLevel, _
elementId As UInteger _
) As ProfileOperationResult
public static ProfileOperationResult ResumeProfile(
ProfileLevel profileLevel,
uint elementId
)
public:
static ProfileOperationResult ResumeProfile(
ProfileLevel profileLevel,
unsigned int elementId
)
static member ResumeProfile :
profileLevel:ProfileLevel *
elementId:uint32 -> ProfileOperationResult
public static function ResumeProfile(
profileLevel : ProfileLevel,
elementId : uint
) : ProfileOperationResult
パラメーター
- profileLevel
型: Microsoft.VisualStudio.Profiler.ProfileLevel
elementId で指定された ID の実行レベルを指定します。
- elementId
型: System.UInt32
システムによって生成される、プロセスまたはスレッドの ID。
戻り値
型: Microsoft.VisualStudio.Profiler.ProfileOperationResult
戻り値の ProfileOperationResult は列挙型です。
解説
保留/再開カウンターの初期値は 0 です。 SuspendProfile を呼び出すたびに、保留/再開数に 1 が加算されます。ResumeProfile を呼び出すたびに、1 が減算されます。
保留/再開数が 0 よりも大きい場合、そのレベルの保留/再開状態はオフになります。 保留/再開数が 0 以下の場合、保留/再開状態はオンになります。
開始/停止状態と保留/再開状態の両方がオンの場合、そのレベルのプロファイル状態はオンです。 プロファイルの対象となるスレッドでは、グローバル レベル状態、プロセス レベル状態、スレッド レベル状態がすべてオンである必要があります。
例
次に ResumeProfile メソッドの例を示します。 この例は、DataCollection.CurrentId で識別される同じスレッドまたはプロセスに対して、SuspendProfile メソッドが既に呼び出されていることを前提としています。
void ExerciseResumeProfile()
{
// The initial value of the Suspend/Resume counter is 0.
// Each call to SuspendProfile adds 1 to the Suspend/Resume
// count; each call to ResumeProfile subtracts 1.
// Variables used to print output.
HRESULT hResult;
TCHAR tchBuffer[256];
// Declare enumeration to hold result of call to ResumeProfile
PROFILE_COMMAND_STATUS profileResult;
profileResult = ResumeProfile(
PROFILE_GLOBALLEVEL,
PROFILE_CURRENTID);
// Format and print result.
LPCTSTR pszFormat = TEXT("%s %d.\0");
TCHAR* pszTxt = TEXT("ResumeProfile returned");
hResult = StringCchPrintf(tchBuffer, 256, pszFormat,
pszTxt, profileResult);
}
.NET Framework セキュリティ
- 直前の呼び出し元に対する完全な信頼。 このメンバーは、部分的に信頼されているコードから使用することはできません。 詳細については、「部分信頼コードからのライブラリの使用」を参照してください。