private void PrepareCore(Display display, ScreenMirroringResolutions resolutions) { ValidateState(ScreenMirroringState.Idle); Native.SetResolution(Handle, resolutions).ThrowIfError("Failed to set resolutions."); try { SetDisplay(display); Native.Prepare(Handle).ThrowIfError("Failed to prepare."); } catch { DetachDisplay(); throw; } }
/// <summary> /// Prepares the screen mirroring with the specified display and resolutions. /// </summary> /// <remarks> /// The state must be <see cref="ScreenMirroringState.Idle"/>. /// </remarks> /// <param name="display">The display where the mirroring will be played on.</param> /// <param name="resolutions">The desired resolutions.</param> /// <exception cref="ArgumentException"> /// <paramref name="resolutions"/> contain invalid flags.<br/> /// -or-<br/> /// <paramref name="display"/> has already been assigned to another. /// </exception> /// <exception cref="ArgumentNullException"><paramref name="display"/> is null.</exception> /// <exception cref="InvalidOperationException"> /// The current state is not in the valid.<br/> /// -or-<br/> /// An internal error occurs. /// </exception> /// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception> /// <since_tizen> 4 </since_tizen> public void Prepare(Display display, ScreenMirroringResolutions resolutions) { ValidationUtil.ValidateFlagsEnum(resolutions, (ScreenMirroringResolutions)((1 << 7) - 1), nameof(resolutions)); PrepareCore(display, resolutions); }
internal static extern ScreenMirroringErrorCode SetResolution(IntPtr handle, ScreenMirroringResolutions resolution);