更新 : 2007 年 11 月
ResumeProfile メソッドは、指定されたプロファイル レベルの保留/再開カウンタをデクリメントします。
名前空間 : Microsoft.VisualStudio.Profiler
アセンブリ : Microsoft.VisualStudio.Profiler (Microsoft.VisualStudio.Profiler.dll 内)
構文
'宣言
Public Shared Function ResumeProfile ( _
profileLevel As ProfileLevel, _
elementId As UInteger _
) As ProfileOperationResult
'使用
Dim profileLevel As ProfileLevel
Dim elementId As UInteger
Dim returnValue As ProfileOperationResult
returnValue = DataCollection.ResumeProfile(profileLevel, _
elementId)
public static ProfileOperationResult ResumeProfile(
ProfileLevel profileLevel,
uint elementId
)
public:
static ProfileOperationResult ResumeProfile(
ProfileLevel profileLevel,
unsigned int elementId
)
public static function ResumeProfile(
profileLevel : ProfileLevel,
elementId : uint
) : ProfileOperationResult
パラメータ
profileLevel
型 : Microsoft.VisualStudio.Profiler.ProfileLevelelementId で指定されている 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);
}
アクセス許可
- 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。