Skip to content

Commit

Permalink
Update Essentials Flashlight API Docs (#12144)
Browse files Browse the repository at this point in the history
Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com>
  • Loading branch information
github-actions[bot] and jfversluis committed Dec 15, 2022
1 parent 260491a commit 6d49f7e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 61 deletions.
57 changes: 0 additions & 57 deletions src/Essentials/docs/en/Xamarin.Essentials/Flashlight.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace Microsoft.Maui.Devices
{
/// <include file="../../docs/Microsoft.Maui.Essentials/Flashlight.xml" path="Type[@FullName='Microsoft.Maui.Essentials.Flashlight']/Docs/*" />
class FlashlightImplementation : IFlashlight
{
public Task TurnOnAsync() =>
Expand Down
28 changes: 25 additions & 3 deletions src/Essentials/src/Flashlight/Flashlight.shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,48 @@

namespace Microsoft.Maui.Devices
{
/// <summary>
/// The Flashlight API has the ability to turn on or off the device's camera flash to turn it into a flashlight.
/// </summary>
public interface IFlashlight
{
/// <summary>
/// Turns the camera flashlight on.
/// </summary>
/// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns>
Task TurnOnAsync();

/// <summary>
/// Turns the camera flashlight off.
/// </summary>
/// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns>
Task TurnOffAsync();
}

/// <include file="../../docs/Microsoft.Maui.Essentials/Flashlight.xml" path="Type[@FullName='Microsoft.Maui.Essentials.Flashlight']/Docs/*" />
/// <summary>
/// The Flashlight API has the ability to turn on or off the device's camera flash to turn it into a flashlight.
/// </summary>
public static partial class Flashlight
{
/// <include file="../../docs/Microsoft.Maui.Essentials/Flashlight.xml" path="//Member[@MemberName='TurnOnAsync']/Docs/*" />
/// <summary>
/// Turns the camera flashlight on.
/// </summary>
/// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns>
public static Task TurnOnAsync() =>
Default.TurnOnAsync();

/// <include file="../../docs/Microsoft.Maui.Essentials/Flashlight.xml" path="//Member[@MemberName='TurnOffAsync']/Docs/*" />
/// <summary>
/// Turns the camera flashlight off.
/// </summary>
/// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns>
public static Task TurnOffAsync() =>
Default.TurnOffAsync();

static IFlashlight? defaultImplementation;

/// <summary>
/// Provides the default implementation for static usage of this API.
/// </summary>
public static IFlashlight Default =>
defaultImplementation ??= new FlashlightImplementation();

Expand Down

0 comments on commit 6d49f7e

Please sign in to comment.