Поделиться через


DataCollection.CurrentId - свойство

Свойство CurrentId возвращает псевдо-токен для идентификатора потока или идентификатора процесса в вызове метода NameProfile, StartProfile, StopProfile, SuspendProfile и ResumeProfile.Это свойство используется, чтобы метод работал в текущем потоке или процессе, а не в специально указанном потоке или процессе.

Пространство имен:  Microsoft.VisualStudio.Profiler
Сборка:  Microsoft.VisualStudio.Profiler (в Microsoft.VisualStudio.Profiler.dll)

Синтаксис

'Декларация
Public Shared ReadOnly Property CurrentId As UInteger
public static uint CurrentId { get; }
public:
static property unsigned int CurrentId {
    unsigned int get ();
}
static member CurrentId : uint32
static function get CurrentId () : uint

Значение свойства

Тип: System.UInt32
Целое число без знака для идентификатора процесса или потока.

Примеры

В следующем примере кода демонстрируется свойство CurrentId.CurrentId передается в качестве параметра в вызове DataCollection.NameProfile для определения идентификатора текущего потока.

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

Безопасность платформы .NET Framework

См. также

Ссылки

DataCollection Класс

Microsoft.VisualStudio.Profiler - пространство имен