Metoda DataCollection.CommentMarkProfile —
Metoda CommentMarkProfile wstawia znacznik numeryczne i ciąg tekstowy w pliku .vsp.Profilowanie dla wątku, zawierającą funkcję CommentMarkProfile musi być na znak i komentarz ma zostać wstawiony.
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: System.Int32
Numeryczne Wstaw znacznik.Znacznik musi większa lub równa 0 (zero).
- markText
Typ: System.String
Wskaźnik ciąg tekstowy do wstawienia.Ciąg musi być mniejsza niż 256 znaków, łącznie z NULL terminator.
Wartość zwracana
Typ: Microsoft.VisualStudio.Profiler.MarkOperationResult
Wartość zwracana, MarkOperationResult, jest wyliczeniem.
Uwagi
Stan profilowania dla wątku, który zawiera funkcję profilu znak musi być gdy znaczniki i komentarze wstawiane za pomocą polecenia VSInstr znaku lub z funkcji elementów członkowskich Microsoft.VisualStudio.Profiler.DataCollection (CommentMarkAtProfile, CommentMarkProfile lub MarkProfile).
Profil znaki są globalne w zakresie.Na przykład znak profilu, dodaje się w jednym wątku można oznaczyć początek lub koniec segmentu danych w dowolnym wątku w pliku .vsp.
![]() |
---|
CommentMarkProfile metody należy używać z Instrumentacji tylko. |
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 Przy użyciu bibliotek z częściowo zaufanego kodu..