Proprietà DataCollection.CurrentId

La proprietà CurrentId restituisce lo pseudo-token dell'ID processo o dell'ID thread in una chiamata a NameProfile, StartProfile, StopProfile, SuspendProfile e ResumeProfile. Utilizzare questa proprietà per fare in modo che il metodo operi nel thread o nel processo corrente anziché in uno specificamente indicato.

Spazio dei nomi:  Microsoft.VisualStudio.Profiler
Assembly:  Microsoft.VisualStudio.Profiler (in Microsoft.VisualStudio.Profiler.dll)

Sintassi

'Dichiarazione
Public Shared ReadOnly Property CurrentId As UInteger
    Get
public static uint CurrentId { get; }
public:
static property unsigned int CurrentId {
    unsigned int get ();
}
static member CurrentId : uint32
static function get CurrentId () : uint

Valore proprietà

Tipo: System.UInt32
Integer senza segno per l'identificatore del processo o del thread.

Esempi

Nell'esempio di codice riportato di seguito viene illustrata la proprietà CurrentId. La proprietà CurrentId viene passata come parametro nella chiamata DataCollection.NameProfile per indicare l'identificatore del thread corrente.

        public void ExerciseCommentMarkAtProfile()
        {
            // Declare and initalize variables to pass to 
            // CommentMarkAtProfile.  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.
            long timestamp = 0x1111;
            int markId = 01;
            string markText = "Exercising CommentMarkAtProfile...";

            // Declare MarkOperationResult Enumerator.  
            // Holds return value from call to CommentMarkAtProfile.
            MarkOperationResult markResult;

            markResult = DataCollection.CommentMarkAtProfile(
                timestamp,
                markId,
                markText);

            // Check result of CommentMarkAtProfile call.
            Console.WriteLine("CommentMarkAtProfile returned {0}",
                markResult); 
        }

Sicurezza di .NET Framework

Vedere anche

Riferimenti

DataCollection Classe

Spazio dei nomi Microsoft.VisualStudio.Profiler