Continuing my development on CERapi, I have added some functionality to this managed RAPI library:
- Implemented CEFileSystem class that allows you to copy and move files from the desktop to the Windows CE device.
- Implemented CEFolder class that encapsulates a Windows CE device's folder to easily retrieve folder details like contained files, sub folders, create/delete subfolders, etc. The following code illustrates its use:
// Working with device folders
CEFolder rootFolder =
new CEFolder("\\My Documents\\Demo");
Console.WriteLine("Path: {0}",rootFolder.Path);
Console.WriteLine("Total Files: {0}",rootFolder.TotalFileCount);
Console.WriteLine("Total SubFolders: {0}",rootFolder.TotalSubFolderCount);
string[] arrFolders = rootFolder.SubFolders;
foreach(string strFolder in arrFolders)
Console.WriteLine("SubFolder: {0} ",strFolder);
Console.WriteLine("");
string[] arrFiles = rootFolder.Files;
foreach(string strFile in arrFiles)
Console.WriteLine("File: {0} ",strFile);
Console.WriteLine("");
Console.WriteLine("Parent Folder: {0}", rootFolder.ParentFolder);
Console.WriteLine("Archived: {0}",rootFolder.IsArchive.ToString());
Console.WriteLine("Created on: {0}",rootFolder.CreationTime.ToString());
Console.WriteLine("Last Access on: {0}",rootFolder.LastAccessTime.ToString());
Console.WriteLine("Last Written to on: {0}",rootFolder.LastWriteTime.ToString());
Console.WriteLine("Size: {0}",rootFolder.Size.ToString());
Console.WriteLine("Object ID: {0}",rootFolder.OID.ToString());
Console.WriteLine("CreateFolder: {0}",rootFolder.CreateFolder("SubFolder").ToString());
Console.WriteLine("DeleteFolder: {0}",rootFolder.DeleteFolder("SubFolder").ToString());
I am beginning work on CEFile class that will represent a file in a folder on the device. Will keep you posted.