示例#1
0
 public IAsyncOperation <StorageResult> closeDatabase(string parameters)
 {
     return(AsyncInfo.Run((token) =>
                          Task.Run <StorageResult>(() =>
     {
         try
         {
             JSONStore.closeAllCollections();
             return new StorageResult(Status.OK, JSONStoreConstants.JSON_STORE_RC_OK);
         }
         catch (JSONStoreException jsonException)
         {
             // catch a JSONStore specific exception and return the error code
             return new StorageResult(Status.ERROR, jsonException.errorCode);
         }
         catch (Exception)
         {
             return new StorageResult(Status.ERROR, JSONStoreConstants.JSON_STORE_PERSISTENT_STORE_FAILURE);
         }
     }, token)));
 }