/// <summary>
    /// Initializes and returns a new record ID with the specified name in the default zone.
    ///
    /// Use this method when you are creating or searching for records in the default zone.
    /// </summary>
    /// <param name="recordName">The name to use to identify the record. The string must contain only ASCII characters and must not exceed 255 characters. If you specify nil or an empty string for this parameter, this method throws an exception.</param>
    public CK_RecordID(string recordName)
    {
        _internalId = SA.Common.Util.IdFactory.NextId;
        _Name       = recordName;

        ISN_CloudKit.CreateRecordId_Object(_internalId, _Name);
        _Ids.Add(_internalId, this);
    }
Beispiel #2
0
    //--------------------------------------
    // Internal Use Only
    //--------------------------------------


    public void UpdateRecord()
    {
        List <string> keys   = new List <string>();
        List <string> values = new List <string>();

        foreach (KeyValuePair <string, string> pair in _Data)
        {
            keys.Add(pair.Key);
            values.Add(pair.Value);
        }
        ISN_CloudKit.UpdateRecord_Object(Internal_Id, Type, SA.Common.Data.Converter.SerializeArray(keys.ToArray()), SA.Common.Data.Converter.SerializeArray(values.ToArray()), Id.Internal_Id);
    }
Beispiel #3
0
 /// <summary>
 /// Deletes the specified record asynchronously from the current database.
 ///
 /// Deleting a record may trigger additional deletions if the record was referenced by other records.
 /// This method reports only the ID of the record you asked to delete.
 /// CloudKit does not report deletions triggered by owning relationships between records.
 /// </summary>
 /// <param name="recordId">The ID of the record you want to delete.</param>
 public void DeleteRecordWithID(CK_RecordID recordId)
 {
     ISN_CloudKit.DeleteRecord(_InternalId, recordId.Internal_Id);
 }
Beispiel #4
0
 /// <summary>
 /// Fetches one record asynchronously from the current database.
 ///
 /// Use this method to fetch records that are not urgent to your app’s execution.
 /// This method fetches the record with a low priority, which may cause the task to execute after higher-priority tasks.
 /// </summary>
 /// <param name="recordId">The ID of the record you want to fetch.</param>
 public void FetchRecordWithID(CK_RecordID recordId)
 {
     ISN_CloudKit.FetchRecord(_InternalId, recordId.Internal_Id);
 }
Beispiel #5
0
 /// <summary>
 /// Saves one record asynchronously to the current database.
 ///
 /// This method saves the record only if it has never been saved before or if it is newer than the version on the server.
 /// You cannot use this method to overwrite newer versions of a record on the server.
 /// </summary>
 /// <param name="record">The record object you attempted to save.</param>
 public void SaveRecrod(CK_Record record)
 {
     record.UpdateRecord();
     ISN_CloudKit.SaveRecord(_InternalId, record.Internal_Id);
 }
Beispiel #6
0
 /// <summary>
 /// Searches the specified zone asynchronously for records that match the query parameters.
 ///
 /// Do not use this method when the number of returned records is potentially more than a few hundred records.
 /// For efficiency, all queries automatically limit the number of returned records based on current conditions.
 /// If your query hits the maximum value, this method returns only the first portion of the overall results.
 /// The number of returned records should be sufficient in most cases.
 /// </summary>
 /// <param name="query">The ID of the record you want to delete.</param>
 public void PerformQuery(CK_Query query)
 {
     ISN_CloudKit.PerformQuery(_InternalId, query.Predicate, query.RecordType);
 }