/// <summary> /// <para>Attempts to cancel a previously requested selection process.</para> /// <para>If selection dialog has not yet been completed by the user, this request will /// dismiss the dialog and cancel the selection process.Otherwise this /// operation will return an error.</para> /// </summary> /// <returns> /// <para>MLResult.Result will be <c>MLResult.Code.Ok</c> if selection was successfully cancelled.</para> /// <para>MLResult.Result will be <c>MLResult.Code.PrivilegeDenied</c> if permissions haven't been granted to make this call.</para> /// <para>MLResult.Result will be <c>MLResult.Code.UnspecifiedFailure</c> if there was an unexpected failure.</para> /// <para>MLResult.Result will be <c>MLResult.Code.ConnectionsCancellationPending</c> if the selection request has been found and the system is attempting to cancel the process.</para> /// <para>MLResult.Result will be <c>MLResult.Code.ConnectionsInvalidHandle</c> if input handle is invalid.</para> /// </returns> public static MLResult CancelSelection() { if (MLConnections.IsValidInstance()) { MLResult.Code resultCode = NativeBindings.MLConnectionsCancelSelection(_instance.selectionHandle); MLResult result = MLResult.Create(resultCode); if (!result.IsOk) { MLPluginLog.ErrorFormat("MLConnections.CancelSelection failed to cancel the selection requested. Reason: {0}", result); } return(result); } else { MLPluginLog.ErrorFormat("MLConnections.CancelSelection failed. Reason: No Instance for MLConnections"); return(MLResult.Create(MLResult.Code.UnspecifiedFailure, "MLConnections.CancelSelection failed. Reason: No Instance for MLConnections")); } }