1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-22 20:58:34 +01:00

clarify OpenLinkOrFile usage documentation

This commit is contained in:
Ell 2021-04-23 14:34:59 +02:00
parent b48ed479a0
commit f71f998508

View file

@ -4,6 +4,7 @@ using System.Reflection;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Input;
using MLEM.Formatting.Codes;
namespace MLEM.Misc { namespace MLEM.Misc {
/// <summary> /// <summary>
@ -40,7 +41,8 @@ namespace MLEM.Misc {
public abstract void AddTextInputListener(GameWindow window, TextInputCallback callback); public abstract void AddTextInputListener(GameWindow window, TextInputCallback callback);
/// <summary> /// <summary>
/// A method that should be executed to open a link in the browser or a file explorer /// A method that should be executed to open a link in the browser or a file explorer.
/// This method is currently used only by MLEM.Ui's implementation of the <see cref="LinkCode"/> formatting code.
/// </summary> /// </summary>
public abstract void OpenLinkOrFile(string link); public abstract void OpenLinkOrFile(string link);
@ -131,8 +133,8 @@ namespace MLEM.Misc {
/// See <see cref="MlemPlatform.Mobile"/> class documentation for more detailed information. /// See <see cref="MlemPlatform.Mobile"/> class documentation for more detailed information.
/// </summary> /// </summary>
/// <param name="openOnScreenKeyboard">The function that is used to display the on-screen keyboard</param> /// <param name="openOnScreenKeyboard">The function that is used to display the on-screen keyboard</param>
/// <param name="openLink">The action that is invoked to open the </param> /// <param name="openLink">The action that is invoked to open a link in the browser, which is used for <see cref="LinkCode"/></param>
public Mobile(OpenOnScreenKeyboardDelegate openOnScreenKeyboard, Action<string> openLink) { public Mobile(OpenOnScreenKeyboardDelegate openOnScreenKeyboard, Action<string> openLink = null) {
this.openOnScreenKeyboard = openOnScreenKeyboard; this.openOnScreenKeyboard = openOnScreenKeyboard;
this.openLink = openLink; this.openLink = openLink;
} }
@ -148,7 +150,7 @@ namespace MLEM.Misc {
/// <inheritdoc /> /// <inheritdoc />
public override void OpenLinkOrFile(string link) { public override void OpenLinkOrFile(string link) {
this.openLink(link); this.openLink?.Invoke(link);
} }
/// <summary> /// <summary>