/// <summary> /// Creates a new <see cref="MobileSyncClientHandle"/> from a <see cref="IntPtr"/>. /// </summary> /// <param name="unsafeHandle"> /// The underlying <see cref="IntPtr"/> /// </param> /// <param name="ownsHandle"> /// <see langword="true"/> to reliably release the handle during the finalization phase; <see langword="false"/> to prevent reliable release (not recommended). /// </param> /// <returns> /// </returns> public static MobileSyncClientHandle DangerousCreate(System.IntPtr unsafeHandle, bool ownsHandle) { MobileSyncClientHandle safeHandle = new MobileSyncClientHandle(ownsHandle); safeHandle.SetHandle(unsafeHandle); return(safeHandle); }
/// <summary> /// Receives any remapped identifiers reported after the device merged submitted changes. /// MOBILESYNC_E_SUCCESS on success /// MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid /// MOBILESYNC_E_PLIST_ERROR if the received plist is not of valid /// form /// MOBILESYNC_E_WRONG_DIRECTION if the current sync direction does /// not permit this call /// MOBILESYNC_E_CANCELLED if the device explicitly cancelled the /// session /// </summary> /// <param name="client"> /// The mobilesync client /// </param> /// <param name="mapping"> /// A pointer to an array plist containing a dict of identifier remappings /// </param> public virtual MobileSyncError mobilesync_remap_identifiers(MobileSyncClientHandle client, out PlistHandle mapping) { MobileSyncError returnValue; returnValue = MobileSyncNativeMethods.mobilesync_remap_identifiers(client, out mapping); mapping.Api = this.Parent; return(returnValue); }
/// <summary> /// Polls the device for mobilesync data. /// </summary> /// <param name="client"> /// The mobilesync client /// </param> /// <param name="plist"> /// A pointer to the location where the plist should be stored /// </param> /// <returns> /// an error code /// </returns> public virtual MobileSyncError mobilesync_receive(MobileSyncClientHandle client, out PlistHandle plist) { MobileSyncError returnValue; returnValue = MobileSyncNativeMethods.mobilesync_receive(client, out plist); plist.Api = this.Parent; return(returnValue); }
/// <summary> /// Receives changed entitites of the currently set data class from the device /// MOBILESYNC_E_SUCCESS on success /// MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid /// MOBILESYNC_E_CANCELLED if the device explicitly cancelled the /// session /// </summary> /// <param name="client"> /// The mobilesync client /// </param> /// <param name="entities"> /// A pointer to store the changed entity records as a PLIST_DICT /// </param> /// <param name="is_last_record"> /// A pointer to store a flag indicating if this submission is the last one /// </param> /// <param name="actions"> /// A pointer to additional flags the device is sending or NULL to ignore /// </param> public virtual MobileSyncError mobilesync_receive_changes(MobileSyncClientHandle client, out PlistHandle entities, ref char isLastRecord, out PlistHandle actions) { MobileSyncError returnValue; returnValue = MobileSyncNativeMethods.mobilesync_receive_changes(client, out entities, ref isLastRecord, out actions); entities.Api = this.Parent; actions.Api = this.Parent; return(returnValue); }
public static MobileSyncError mobilesync_start(MobileSyncClientHandle client, byte[] dataClass, MobileSyncAnchorsHandle anchors, ulong computerDataClassVersion, ref MobileSyncSyncType syncType, ref ulong deviceDataClassVersion, out string errorDescription) { System.Runtime.InteropServices.ICustomMarshaler errorDescriptionMarshaler = NativeStringMarshaler.GetInstance(null); System.IntPtr errorDescriptionNative = System.IntPtr.Zero; MobileSyncError returnValue = MobileSyncNativeMethods.mobilesync_start(client, dataClass, anchors, computerDataClassVersion, ref syncType, ref deviceDataClassVersion, out errorDescriptionNative); errorDescription = ((string)errorDescriptionMarshaler.MarshalNativeToManaged(errorDescriptionNative)); errorDescriptionMarshaler.CleanUpNativeData(errorDescriptionNative); return(returnValue); }
public static extern MobileSyncError mobilesync_clear_all_records_on_device(MobileSyncClientHandle client);
public static extern MobileSyncError mobilesync_receive_changes(MobileSyncClientHandle client, out PlistHandle entities, ref char isLastRecord, out PlistHandle actions);
/// <summary> /// Creates a new <see cref="MobileSyncClientHandle"/> from a <see cref="IntPtr"/>. /// </summary> /// <param name="unsafeHandle"> /// The underlying <see cref="IntPtr"/> /// </param> /// <returns> /// </returns> public static MobileSyncClientHandle DangerousCreate(System.IntPtr unsafeHandle) { return(MobileSyncClientHandle.DangerousCreate(unsafeHandle, true)); }
/// <summary> /// Finish a synchronization session of a data class on the device. /// A session must have previously been started using mobilesync_start(). /// MOBILESYNC_E_SUCCESS on success /// MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid /// MOBILESYNC_E_PLIST_ERROR if the received plist is not of valid /// form /// </summary> /// <param name="client"> /// The mobilesync client /// </param> public virtual MobileSyncError mobilesync_finish(MobileSyncClientHandle client) { return(MobileSyncNativeMethods.mobilesync_finish(client)); }
public static extern MobileSyncError mobilesync_client_new(iDeviceHandle device, LockdownServiceDescriptorHandle service, out MobileSyncClientHandle client);
public static extern MobileSyncError mobilesync_receive(MobileSyncClientHandle client, out PlistHandle plist);
/// <summary> /// Starts a new mobilesync service on the specified device and connects to it. /// </summary> /// <param name="device"> /// The device to connect to. /// </param> /// <param name="client"> /// Pointer that will point to a newly allocated /// mobilesync_client_t upon successful return. Must be freed using /// mobilesync_client_free() after use. /// </param> /// <param name="label"> /// The label to use for communication. Usually the program name. /// Pass NULL to disable sending the label in requests to lockdownd. /// </param> /// <returns> /// MOBILESYNC_E_SUCCESS on success, or an MOBILESYNC_E_* error /// code otherwise. /// </returns> public virtual MobileSyncError mobilesync_client_start_service(iDeviceHandle device, out MobileSyncClientHandle client, string label) { MobileSyncError returnValue; returnValue = MobileSyncNativeMethods.mobilesync_client_start_service(device, out client, label); client.Api = this.Parent; return(returnValue); }
public static extern MobileSyncError mobilesync_send_changes(MobileSyncClientHandle client, PlistHandle entities, char isLastRecord, PlistHandle actions);
/// <summary> /// Cancels a running synchronization session with a device at any time. /// MOBILESYNC_E_SUCCESS on success /// MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid /// </summary> /// <param name="client"> /// The mobilesync client /// </param> /// <param name="reason"> /// The reason to supply to the device for cancelling /// </param> public virtual MobileSyncError mobilesync_cancel(MobileSyncClientHandle client, string reason) { return(MobileSyncNativeMethods.mobilesync_cancel(client, reason)); }
/// <summary> /// Connects to the mobilesync service on the specified device. /// MOBILESYNC_E_SUCCESS on success /// MOBILESYNC_E_INVALID_ARG if one or more parameters are invalid /// DEVICE_LINK_SERVICE_E_BAD_VERSION if the mobilesync version on /// the device is newer. /// </summary> /// <param name="device"> /// The device to connect to. /// </param> /// <param name="service"> /// The service descriptor returned by lockdownd_start_service. /// </param> /// <param name="client"> /// Pointer that will be set to a newly allocated /// #mobilesync_client_t upon successful return. /// </param> public virtual MobileSyncError mobilesync_client_new(iDeviceHandle device, LockdownServiceDescriptorHandle service, out MobileSyncClientHandle client) { MobileSyncError returnValue; returnValue = MobileSyncNativeMethods.mobilesync_client_new(device, service, out client); client.Api = this.Parent; return(returnValue); }
/// <summary> /// Sends changed entities of the currently set data class to the device /// MOBILESYNC_E_SUCCESS on success /// MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid, /// MOBILESYNC_E_WRONG_DIRECTION if the current sync direction does /// not permit this call /// </summary> /// <param name="client"> /// The mobilesync client /// </param> /// <param name="entities"> /// The changed entity records as a PLIST_DICT /// </param> /// <param name="is_last_record"> /// A flag indicating if this submission is the last one /// </param> /// <param name="actions"> /// Additional actions for the device created with mobilesync_actions_new() /// or NULL if no actions should be passed /// </param> public virtual MobileSyncError mobilesync_send_changes(MobileSyncClientHandle client, PlistHandle entities, char isLastRecord, PlistHandle actions) { return(MobileSyncNativeMethods.mobilesync_send_changes(client, entities, isLastRecord, actions)); }
/// <summary> /// Verifies if the device is ready to receive changes from the computer. /// This call changes the synchronization direction so that mobilesync_send_changes() /// can be used to send changes to the device. /// MOBILESYNC_E_SUCCESS on success /// MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid /// MOBILESYNC_E_PLIST_ERROR if the received plist is not of valid form /// MOBILESYNC_E_WRONG_DIRECTION if the current sync direction does /// not permit this call /// MOBILESYNC_E_CANCELLED if the device explicitly cancelled the /// session /// MOBILESYNC_E_NOT_READY if the device is not ready to start /// receiving any changes /// </summary> /// <param name="client"> /// The mobilesync client /// </param> public virtual MobileSyncError mobilesync_ready_to_send_changes_from_computer(MobileSyncClientHandle client) { return(MobileSyncNativeMethods.mobilesync_ready_to_send_changes_from_computer(client)); }
/// <summary> /// Acknowledges to the device that the changes have been merged on the computer /// MOBILESYNC_E_SUCCESS on success /// MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid /// </summary> /// <param name="client"> /// The mobilesync client /// </param> public virtual MobileSyncError mobilesync_acknowledge_changes_from_device(MobileSyncClientHandle client) { return(MobileSyncNativeMethods.mobilesync_acknowledge_changes_from_device(client)); }
public static extern MobileSyncError mobilesync_acknowledge_changes_from_device(MobileSyncClientHandle client);
public static extern MobileSyncError mobilesync_send(MobileSyncClientHandle client, PlistHandle plist);
public static extern MobileSyncError mobilesync_ready_to_send_changes_from_computer(MobileSyncClientHandle client);
public static extern MobileSyncError mobilesync_start(MobileSyncClientHandle client, byte[] dataClass, MobileSyncAnchorsHandle anchors, ulong computerDataClassVersion, ref MobileSyncSyncType syncType, ref ulong deviceDataClassVersion, out System.IntPtr errorDescription);
public static extern MobileSyncError mobilesync_remap_identifiers(MobileSyncClientHandle client, out PlistHandle mapping);
/// <summary> /// Requests starting synchronization of a data class with the device /// MOBILESYNC_E_SUCCESS on success /// MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid /// MOBILESYNC_E_PLIST_ERROR if the received plist is not of valid form /// MOBILESYNC_E_SYNC_REFUSED if the device refused to sync /// MOBILESYNC_E_CANCELLED if the device explicitly cancelled the /// sync request /// </summary> /// <param name="client"> /// The mobilesync client /// </param> /// <param name="data_class"> /// The data class identifier to sync /// </param> /// <param name="anchors"> /// The anchors required to exchange with the device. The anchors /// allow the device to tell if the synchronization information on the computer /// and device are consistent to determine what sync type is required. /// </param> /// <param name="computer_data_class_version"> /// The version of the data class storage on the computer /// </param> /// <param name="sync_type"> /// A pointer to store the sync type reported by the device_anchor /// </param> /// <param name="device_data_class_version"> /// The version of the data class storage on the device /// </param> /// <param name="error_description"> /// A pointer to store an error message if reported by the device /// </param> public virtual MobileSyncError mobilesync_start(MobileSyncClientHandle client, byte[] dataClass, MobileSyncAnchorsHandle anchors, ulong computerDataClassVersion, ref MobileSyncSyncType syncType, ref ulong deviceDataClassVersion, out string errorDescription) { return(MobileSyncNativeMethods.mobilesync_start(client, dataClass, anchors, computerDataClassVersion, ref syncType, ref deviceDataClassVersion, out errorDescription)); }
public static extern MobileSyncError mobilesync_client_start_service(iDeviceHandle device, out MobileSyncClientHandle client, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string label);
public static extern MobileSyncError mobilesync_finish(MobileSyncClientHandle client);
public object MarshalNativeToManaged(System.IntPtr nativeData) { return(MobileSyncClientHandle.DangerousCreate(nativeData, false)); }
public static extern MobileSyncError mobilesync_get_all_records_from_device(MobileSyncClientHandle client);
public static extern MobileSyncError mobilesync_cancel(MobileSyncClientHandle client, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string reason);
/// <summary> /// Requests the device to delete all records of the current data class /// MOBILESYNC_E_SUCCESS on success /// MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid /// MOBILESYNC_E_PLIST_ERROR if the received plist is not of valid form /// </summary> /// <param name="client"> /// The mobilesync client /// </param> /// <remarks> /// The operation must be called after starting synchronization. /// </remarks> public virtual MobileSyncError mobilesync_clear_all_records_on_device(MobileSyncClientHandle client) { return(MobileSyncNativeMethods.mobilesync_clear_all_records_on_device(client)); }