Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Essentials Flashlight API Docs #11920

Merged
merged 1 commit into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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