void OnGUI() { UpdateToStartPos(); GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Cloud Kit", style); StartY+= YLableStep; if(GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Create Record")) { CK_RecordID recordId = new CK_RecordID("1"); CK_Record record = new CK_Record(recordId, "Post"); record.SetObject("PostText", "Sample point of interest"); record.SetObject("PostTitle", "My favorite point of interest"); CK_Database database = ISN_CloudKit.Instance.PrivateDB; database.SaveRecrod(record); database.ActionRecordSaved += Database_ActionRecordSaved; } StartX += XButtonStep; if(GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Delete Record")) { CK_RecordID recordId = new CK_RecordID("1"); CK_Database database = ISN_CloudKit.Instance.PrivateDB; database.DeleteRecordWithID(recordId); database.ActionRecordDeleted += Database_ActionRecordDeleted; } StartX += XButtonStep; if(GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Fetch Record")) { CK_RecordID recordId = new CK_RecordID("1"); CK_Database database = ISN_CloudKit.Instance.PrivateDB; database.FetchRecordWithID(recordId); database.ActionRecordFetchComplete += Database_ActionRecordFetchComplete; } StartX += XButtonStep; if(GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Fetch And Update")) { CK_RecordID recordId = new CK_RecordID("1"); CK_Database database = ISN_CloudKit.Instance.PrivateDB; database.FetchRecordWithID(recordId); database.ActionRecordFetchComplete += Database_ActionRecordFetchForUpdateComplete; } StartX += XButtonStep; if(GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Perform Query")) { CK_Database database = ISN_CloudKit.Instance.PrivateDB; CK_Query query = new CK_Query("TRUEPREDICATE", "Post"); database.ActionQueryComplete += Database_ActionQueryComplete; database.PerformQuery(query); } }
void OnGUI() { UpdateToStartPos(); GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Cloud Kit", style); StartY += YLableStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Create Record")) { CK_RecordID recordId = new CK_RecordID("1"); CK_Record record = new CK_Record(recordId, "Post"); record.SetObject("PostText", "Sample point of interest"); record.SetObject("PostTitle", "My favorite point of interest"); CK_Database database = ISN_CloudKit.Instance.PrivateDB; database.SaveRecrod(record); database.ActionRecordSaved += Database_ActionRecordSaved; } StartX += XButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Delete Record")) { CK_RecordID recordId = new CK_RecordID("1"); CK_Database database = ISN_CloudKit.Instance.PrivateDB; database.DeleteRecordWithID(recordId); database.ActionRecordDeleted += Database_ActionRecordDeleted; } StartX += XButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Fetch Record")) { CK_RecordID recordId = new CK_RecordID("1"); CK_Database database = ISN_CloudKit.Instance.PrivateDB; database.FetchRecordWithID(recordId); database.ActionRecordFetchComplete += Database_ActionRecordFetchComplete; } StartX += XButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Fetch And Update")) { CK_RecordID recordId = new CK_RecordID("1"); CK_Database database = ISN_CloudKit.Instance.PrivateDB; database.FetchRecordWithID(recordId); database.ActionRecordFetchComplete += Database_ActionRecordFetchForUpdateComplete; } StartX += XButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Perform Query")) { CK_Database database = ISN_CloudKit.Instance.PrivateDB; CK_Query query = new CK_Query("TRUEPREDICATE", "Post"); database.ActionQueryComplete += Database_ActionQueryComplete; database.PerformQuery(query); } }
/// <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) { }
/// <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); }