Project Description
The main goal of this project is create a LinQ extension to interact with the new functionality of desktop search using de advantages of the elegant and efficient programming model introduced by C# 3.0
For more information about the desktop search API please visit the official site :
http://msdn2.microsoft.com/en-us/library/aa965362.aspx
Features
- Support for the following shell objects: Audio,Computer,Core,Digital Rights Management,Document,Image,Link,Music,Note,Shell,Software. Refer to http://msdn2.microsoft.com/en-us/library/ms788673.aspx for more information about shell objects
- Support for Take, TakeWhile, Skip, SkipWhile, First , FirstOrDefault query operators
- Suppor for string functions : Contains, StartWidth, EndWidth
- Support for remote machine query (example: SELECT SystemIndex.ItemName FROM machinename.SystemIndex)
- Suppor for debugger visualizer.
- Support for lazy object materialization
Samples of use
Simple
//Select all items in system search an get a projection of unknown type with the following properties:
// string ItemName, string Author, string[] Kind, Music Music, string language
SystemIndex<SystemSearch> si = new SystemIndex<SystemSearch>();
var result = (from SystemSearch t in si
select new { t.ItemName, t.Author, t.Kind, t.Music, t.Language });
Using WHERE
//Select all folders or documents where ItemName contains "esk"
SystemIndex<SystemSearch> si = new SystemIndex<SystemSearch>();
var result = (from SystemSearch t in si
where (t.Kind == new string[] { "document" } || t.Kind == new string[] { "Folder" } ) && t.ItemName.Contains("esk")
select new { t.ItemName, t.Author, t.Kind, t.Music, t.Language });
Using Order By
//Select all folders or documents where ItemName contains "esk" ordered by Kind
SystemIndex<SystemSearch> si = new SystemIndex<SystemSearch>();
var result = (from SystemSearch t in si
where (t.Kind == new string[] { "document" } || t.Kind == new string[] { "Folder" } ) && t.ItemName.Contains("esk")
orderby t.Kind
select new { t.ItemName, t.Author, t.Kind, t.Music, t.Language });