Metoda DataCollection.CommentMarkProfile —
Metoda CommentMarkProfile wstawia znacznik numeryczne i ciąg tekstowy w pliku .vsp.Profilowanie wątku zawierająca funkcję CommentMarkProfile musi mieć wartość ON dla tego znaku i komentarz do wstawienia.
Przestrzeń nazw: Microsoft.VisualStudio.Profiler
Zestaw: Microsoft.VisualStudio.Profiler (w Microsoft.VisualStudio.Profiler.dll)
Składnia
'Deklaracja
Public Shared Function CommentMarkProfile ( _
markId As Integer, _
markText As String _
) As MarkOperationResult
public static MarkOperationResult CommentMarkProfile(
int markId,
string markText
)
public:
static MarkOperationResult CommentMarkProfile(
int markId,
String^ markText
)
static member CommentMarkProfile :
markId:int *
markText:string -> MarkOperationResult
public static function CommentMarkProfile(
markId : int,
markText : String
) : MarkOperationResult
Parametry
markId
Typ: Int32Znacznik numeryczny do wstawienia.Znacznik musi być większy lub równy 0 (zero).
markText
Typ: StringWskaźnik do ciągu tekstowego do wstawienia.Ciąg musi być mniejszy niż 256 znaków, włączając terminator NULL.
Wartość zwracana
Typ: Microsoft.VisualStudio.Profiler.MarkOperationResult
Wartość zwracana, MarkOperationResult, jest typ wyliczeniowy.
Uwagi
Stan profilowania dla wątku, który zawiera funkcję profilu znak musi być na, gdy znaczniki i komentarze wstawione za pomocą polecenia znak VSInstr lub z Microsoft.VisualStudio.Profiler.DataCollection funkcje składowe (CommentMarkAtProfile, CommentMarkProfile lub MarkProfile).
Znaczniki profilowania mają zakres globalny.Na przykład znacznik profilu wstawione w jednym wątku można oznaczyć początek lub koniec segmentu danych w jednym z wątków w pliku .vsp.
![]() |
---|
CommentMarkProfile metody powinny być używane z tylko instrumentacji. |
Przykłady
Poniższy przykład ilustruje metodę MarkOperationResult.
public void ExerciseMarkOperationResult()
{
// Declare and initialize variables to pass to
// MarkProfile. The values of these parameters
// are assigned based on the needs of the code;
// and for the sake of simplicity in this example,
// the variables are assigned arbitrary values.
int markID = 4;
// Declare enumeration to hold return value of
// call to MarkProfile.
MarkOperationResult result;
result = DataCollection.MarkProfile(markID);
// Compare result to MarkOperationResult value.
// In this case, the property value of
// MarkOperationResult is "OK".
if (result == MarkOperationResult.OK)
{
Console.WriteLine("PASS -- Test {0}", result);
}
else
{
Console.WriteLine("FAIL -- MarkProfile Returned code {0} with normal input", result.ToString());
}
}
Zabezpieczenia programu .NET Framework
- Pełne zaufanie do bezpośredniego wywołującego. Tego elementu członkowskiego nie można używać w kodzie częściowo zaufanym. Aby uzyskać więcej informacji, zobacz Używanie bibliotek pochodzących z częściowo zaufanego kodu.