Click or drag to resize

ThreadInfoProvider Class

Process Thread Information Provider.
Inheritance Hierarchy
SystemObject
  Xcalibur.WMI.FrameworkWmiModelBaseIThreadInfo, ThreadInfo
    Xcalibur.WMI.FrameworkWmiPullModelBaseIThreadInfo, ThreadInfo
      Xcalibur.WMI.ProcessesThreadInfoProvider

Namespace:  Xcalibur.WMI.Processes
Assembly:  Xcalibur.WMI (in Xcalibur.WMI.dll) Version: 3.0.0.0 (3.0.1.0)
Syntax
public sealed class ThreadInfoProvider : WmiPullModelBase<IThreadInfo, ThreadInfo>, 
	IThreadInfoProvider, IWmiPullModelBase<IThreadInfo>, IWmiModelBase<IThreadInfo>, 
	IDisposable

The ThreadInfoProvider type exposes the following members.

Constructors
  NameDescription
Public methodCode exampleThreadInfoProvider
Initializes a new instance of the ThreadInfoProvider class.
Top
Properties
  NameDescription
Public propertyId
Gets or sets the id.
(Inherited from WmiModelBaseTData, TDataModel.)
Public propertyQuery
Gets or sets the query.
(Inherited from WmiPullModelBaseTData, TDataModel.)
Public propertyQueryBuilder
Gets or sets the query items.

Note: This is only used for Pull implementations.

(Inherited from WmiModelBaseTData, TDataModel.)
Public propertyResults
List of results from GetResults or GetResultsAsync. This has been made public in the event that an alternate method will be used outside of this class.
(Inherited from WmiModelBaseTData, TDataModel.)
Public propertySearcher
The ManagementSeacherObject affiliates with the specific WMI class used when pulling data.
(Inherited from WmiPullModelBaseTData, TDataModel.)
Public propertyWmiClass
WMI class that corresponds to the searcher.
(Inherited from WmiModelBaseTData, TDataModel.)
Top
Methods
  NameDescription
Public methodDispose
Implement IDisposable. Do not make this method virtual. A derived class should not be able to override this method.
(Inherited from WmiModelBaseTData, TDataModel.)
Public methodDispose(Boolean)
Dispose(bool disposing) executes in two distinct scenarios. If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. If disposing equals false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed.
(Inherited from WmiPullModelBaseTData, TDataModel.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGet
Gets the specified object.
(Inherited from WmiModelBaseTData, TDataModel.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodPull
Gets the results.
(Inherited from WmiPullModelBaseTData, TDataModel.)
Public methodRefresh
Performs a Get operation on the current data based on a user specified override.
(Inherited from WmiPullModelBaseTData, TDataModel.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUpdate(Int32)
Updates this instance.
(Inherited from WmiPullModelBaseTData, TDataModel.)
Public methodUpdateTConfig(TConfig, Int32)
Updates the specified configuration.
(Inherited from WmiModelBaseTData, TDataModel.)
Top
Examples
C#
 1// Main
 2private static void Main()
 3{
 4    // Make a connection to the local machine
 5    const string computer = ".";
 6    var managementScope = new ManagementScope($@"\\{computer}\root\cimv2", new ConnectionOptions
 7    {
 8        Impersonation = ImpersonationLevel.Impersonate,
 9        Authentication = AuthenticationLevel.Connect
10    });
11    managementScope.Connect();
12
13    // Process thread information
14    var provider = new ThreadInfoProvider(managementScope, -1, 2644);
15
16    // Fetch data
17    provider.Refresh();
18
19    // Print first 5 threads for chrome.exe instance
20    foreach (var info in provider.Results.Take(5))
21    {
22        Console.WriteLine($"{info.IdThread}, \t{info.StartAddress}, {info.Name}");
23    }
24
25    // Read
26    Console.Read();
27}
28
29/* Results: 
30 * 
31 * 552,    2622418848, chrome/0#18
32 * 16120,  2622418848, chrome/1#18
33 * 10932,  2622418848, chrome/2#17
34 * 2876,   2622418848, chrome/3#17
35 * 14876,  2622418848, chrome/4#17
36 * 
37 */
See Also