Below are examples of WinCE framework use.
Create a settings object:
var hhiveState = new HyperHiveState();
hhiveState.Environment = "<environment>";
hhiveState.Project = "<project>";
hhiveState.Host = "<url>";
hhiveState.DeviceId = "<deviceId>";
Create a framework class instance:
var instance = new HHive(hhiveState);
Connect to server:
if (!instance.Auth(username, password).Success)
throw new Exception("Can't connect to server");
Create a local resource storage based on SQLite:
var sqliteStorage = new SQLiteDataResourceStorage(“<fileName>”, FileMode.Create);
Create an object to work with the storage:
var storage = new Storage(instance, sqliteStorage);
Get a list of available resources:
var extResources = storage.ExternalResources;
Get an object to work with resource:
var resource = storage.GetResource(“<resourceName>”);
Get resource cache by parameters:
var resourceCache = resource.GetCache(parameters);
Request to update data to the latest version:
resourceCache.Update();
Get data from local cache:
var values = resourceCache.Get(new string[] { “<column 1>”, “<column 2>”}, null, null, null, null, null);
See also:
WinCE Framework | Initializing and Setting Up WinCE Framework | Calling WinCE Framework Methods | Describing WinCE Framework Methods