API Reference
HybridWmiClient
Hybrid client that prefers CIM where available but falls back to classic WMI.
Inheritance
- Object
- HybridWmiClient
Constructors
public HybridWmiClient() #Creates a hybrid client with default implementations (CIM first, WMI fallback).
public HybridWmiClient(IWmiClient cimClient, IWmiClient wmiClient) #Creates a hybrid client with explicit inner clients.
Parameters
- cimClient ComputerX.Wmi.IWmiClient
- Client used for CIM queries.
- wmiClient ComputerX.Wmi.IWmiClient
- Client used for classic WMI queries.
Methods
public virtual IReadOnlyList<WmiRow> Query(String computer, String namespace, String query, WmiOptions options, CancellationToken ct = null) #IReadOnlyList<WmiRow>Executes a query preferring CIM first and falling back to WMI on failure.
Parameters
- computer System.String
- Target computer name or IP.
- namespace System.String
- Target namespace (e.g., root\\cimv2).
- query System.String
- WQL query text.
- timeout System.Nullable{System.TimeSpan} = null
- Optional per-query timeout.
- ct System.Threading.CancellationToken = null
- Cancellation token.
Query(System.String computer, System.String namespace, System.String query, ComputerX.Wmi.WmiOptions options, System.Threading.CancellationToken ct) #Executes a query with options, honoring PreferCimFirst for initial transport.
Parameters
- computer System.String
- Target computer name or IP.
- namespace System.String
- Target namespace (e.g., root\\cimv2).
- query System.String
- WQL query text.
- options ComputerX.Wmi.WmiOptions
- Query options such as credentials and timeout.
- ct System.Threading.CancellationToken
- Cancellation token.
public virtual async Task<IReadOnlyList<WmiRow>> QueryAsync(String computer, String namespace, String query, WmiOptions options, CancellationToken ct = null) #Task<IReadOnlyList<WmiRow>>Executes a query asynchronously preferring CIM first and falling back to WMI on failure.
Parameters
- computer System.String
- Target computer name or IP.
- namespace System.String
- Target namespace (e.g., root\\cimv2).
- query System.String
- WQL query text.
- timeout System.Nullable{System.TimeSpan} = null
- Optional per-query timeout.
- ct System.Threading.CancellationToken = null
- Cancellation token.
QueryAsync(System.String computer, System.String namespace, System.String query, ComputerX.Wmi.WmiOptions options, System.Threading.CancellationToken ct) #Executes a query asynchronously with options, honoring PreferCimFirst for initial transport.
Parameters
- computer System.String
- Target computer name or IP.
- namespace System.String
- Target namespace (e.g., root\\cimv2).
- query System.String
- WQL query text.
- options ComputerX.Wmi.WmiOptions
- Query options such as credentials and timeout.
- ct System.Threading.CancellationToken
- Cancellation token.
public virtual T QuerySingle<T>(String computer, String namespace, String query, Func<WmiRow, T> projector, WmiOptions options, CancellationToken ct = null) #TType Parameters
- T
Parameters
- computer String
- namespace String
- query String
- projector Func<WmiRow, T>
- timeout Nullable<TimeSpan> = null
- ct CancellationToken = null
public virtual async Task<T> QuerySingleAsync<T>(String computer, String namespace, String query, Func<WmiRow, T> projector, WmiOptions options, CancellationToken ct = null) #Task<T>Type Parameters
- T
Parameters
- computer String
- namespace String
- query String
- projector Func<WmiRow, T>
- timeout Nullable<TimeSpan> = null
- ct CancellationToken = null
QuerySingleAsync``1(System.String computer, System.String namespace, System.String query, System.Func{ComputerX.Wmi.WmiRow,``0} projector, System.Nullable{System.TimeSpan} timeout, System.Threading.CancellationToken ct) #Executes a query asynchronously and projects the first row using a hybrid CIM→WMI approach.
Type Parameters
- T
- Result type produced by the projector.
Parameters
- computer System.String
- Target computer name or IP.
- namespace System.String
- Target namespace (e.g., root\\cimv2).
- query System.String
- WQL query text.
- projector System.Func{ComputerX.Wmi.WmiRow,``0}
- Projection function for the first row.
- timeout System.Nullable{System.TimeSpan}
- Optional per-query timeout.
- ct System.Threading.CancellationToken
- Cancellation token.
QuerySingleAsync``1(System.String computer, System.String namespace, System.String query, System.Func{ComputerX.Wmi.WmiRow,``0} projector, ComputerX.Wmi.WmiOptions options, System.Threading.CancellationToken ct) #Executes a query asynchronously with options and projects the first row using a hybrid approach.
Type Parameters
- T
- Result type produced by the projector.
Parameters
- computer System.String
- Target computer name or IP.
- namespace System.String
- Target namespace (e.g., root\\cimv2).
- query System.String
- WQL query text.
- projector System.Func{ComputerX.Wmi.WmiRow,``0}
- Projection function for the first row.
- options ComputerX.Wmi.WmiOptions
- Query options such as credentials and timeout.
- ct System.Threading.CancellationToken
- Cancellation token.
QuerySingle``1(System.String computer, System.String namespace, System.String query, System.Func{ComputerX.Wmi.WmiRow,``0} projector, System.Nullable{System.TimeSpan} timeout, System.Threading.CancellationToken ct) #Executes a query and projects the first row using a hybrid CIM→WMI approach.
Type Parameters
- T
- Result type produced by the projector.
Parameters
- computer System.String
- Target computer name or IP.
- namespace System.String
- Target namespace (e.g., root\\cimv2).
- query System.String
- WQL query text.
- projector System.Func{ComputerX.Wmi.WmiRow,``0}
- Projection function for the first row.
- timeout System.Nullable{System.TimeSpan}
- Optional per-query timeout.
- ct System.Threading.CancellationToken
- Cancellation token.
QuerySingle``1(System.String computer, System.String namespace, System.String query, System.Func{ComputerX.Wmi.WmiRow,``0} projector, ComputerX.Wmi.WmiOptions options, System.Threading.CancellationToken ct) #Executes a query with options and projects the first row using a hybrid approach.
Type Parameters
- T
- Result type produced by the projector.
Parameters
- computer System.String
- Target computer name or IP.
- namespace System.String
- Target namespace (e.g., root\\cimv2).
- query System.String
- WQL query text.
- projector System.Func{ComputerX.Wmi.WmiRow,``0}
- Projection function for the first row.
- options ComputerX.Wmi.WmiOptions
- Query options such as credentials and timeout.
- ct System.Threading.CancellationToken
- Cancellation token.
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object