private static void OnSnapshotCommitted(AsyncData asyncData) { try { ResultCode resultCode; if (!asyncData.TryGetResultCode(out resultCode)) { return; } if (resultCode == ResultCode.InvalidSnapshot) { print("Snapshot validation failed: " + GetErrorMessage(asyncData)); } else if (resultCode != ResultCode.Ok && resultCode != ResultCode.Cancelled) { print("Could not commit snapshot: " + GetErrorMessage(asyncData)); } } catch (InteractionApiException ex) { print("EyeTracking operation failed: " + ex.Message); } asyncData.Dispose(); }