Muokkaa

Jaa


ViewSources Qualifier

All view classes must have a string array qualifier called ViewSources. The ViewSources qualifier contains the source queries that define the source instances used in the view class. The value of the ViewSources qualifier is a string array containing WMI Query Language (WQL) queries. You can define source classes and restrict the source instances your view class uses with the Querying with WQLWHERE Clause to create a filtered view.

The View Provider matches the source queries in the ViewSources qualifier to the namespaces listed in the ViewSpaces qualifier in the order the queries and namespaces are listed. The number of source queries must match the number of namespaces listed in the ViewSpaces qualifier. The order in which you list the source queries determines the namespaces from which the source instances are drawn.

The following example selects only instances of the LocalDisk class where the value of the FileSystem property is "NTFS" and instances of the RemoteDisk class where the value of the FreeSpace property is greater than 45 megabytes:

ViewSources{
"SELECT __Namespace, 
   Description, 
   DeviceID, 
   FileSystem, 
   FreeSpace, 
   VolumeName FROM LocalDisk 
 WHERE FileSystem = \"NTFS\"", 
   "SELECT __Namespace, 
   Description,
   DeviceID, 
   FileSystem, 
   FreeSpace, 
   VolumeName FROM RemoteDisk 
 WHERE FreeSpace > 45000000"}

Note

The number of source queries you can define for join view classes depends on the number of instances these queries return and how many ways these instances can be joined. The number of possible combinations of source instances for view classes grows exponentially, so keep source queries for join view classes as simple as possible.

Requirements

Requirement Value
Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008

See also

Qualifiers Specific to the View Provider