This documentation is archived and is not being maintained.

DataCollection.CurrentId Property

The CurrentId property returns the pseudo-token for the thread id or process id, in a call to NameProfile, StartProfile, StopProfile, SuspendProfile, and ResumeProfile. Use this property to cause the method to operate on the current thread or process, rather than a specifically indicated one.

Namespace: Microsoft.VisualStudio.Profiler
Assembly: Microsoft.VisualStudio.Profiler (in microsoft.visualstudio.profiler.dll)

public static uint CurrentId { get; }
/** @property */
public static UInt32 get_CurrentId ()

public static function get CurrentId () : uint

Property Value

An unsigned integer value for the process or thread identifier.

The following code example demonstrates the CurrentId property. CurrentId is passed as a parameter in the DataCollection.NameProfile call to identify the current thread identifier.

        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); 
        }
Show: