mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-23 19:49:43 +01:00
okay, so yes, if an extension implements this by crashing, we'll throw an exception, that makes sense
This commit is contained in:
@@ -148,7 +148,7 @@ public partial class MastodonExtensionActionsProvider : CommandProvider
|
||||
}
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "This is sample code")]
|
||||
public partial class MastodonPostForm : IForm
|
||||
public partial class MastodonPostForm : Form
|
||||
{
|
||||
private readonly MastodonStatus post;
|
||||
|
||||
@@ -157,7 +157,7 @@ public partial class MastodonPostForm : IForm
|
||||
this.post = post;
|
||||
}
|
||||
|
||||
public string DataJson()
|
||||
public override string DataJson()
|
||||
{
|
||||
return $$"""
|
||||
{
|
||||
@@ -171,11 +171,9 @@ public partial class MastodonPostForm : IForm
|
||||
""";
|
||||
}
|
||||
|
||||
public string StateJson() => throw new NotImplementedException();
|
||||
public override ICommandResult SubmitForm(string payload) => CommandResult.Dismiss();
|
||||
|
||||
public ICommandResult SubmitForm(string payload) => CommandResult.Dismiss();
|
||||
|
||||
public string TemplateJson()
|
||||
public override string TemplateJson()
|
||||
{
|
||||
var img_block = string.Empty;
|
||||
if (post.MediaAttachments.Count > 0)
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
|
||||
namespace Microsoft.CmdPal.Extensions.Helpers;
|
||||
|
||||
public class Form : IForm
|
||||
public abstract class Form : IForm
|
||||
{
|
||||
public string Data { get; set; } = string.Empty;
|
||||
public virtual string Data { get; set; } = string.Empty;
|
||||
|
||||
public string State { get; set; } = string.Empty;
|
||||
public virtual string State { get; set; } = string.Empty;
|
||||
|
||||
public string Template { get; set; } = string.Empty;
|
||||
public virtual string Template { get; set; } = string.Empty;
|
||||
|
||||
public virtual string DataJson() => Data;
|
||||
|
||||
@@ -18,5 +18,5 @@ public class Form : IForm
|
||||
|
||||
public virtual string TemplateJson() => Template;
|
||||
|
||||
public virtual ICommandResult SubmitForm(string payload) => throw new NotImplementedException();
|
||||
public abstract ICommandResult SubmitForm(string payload);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
namespace Microsoft.CmdPal.Extensions.Helpers;
|
||||
|
||||
public partial class FormPage : Page, IFormPage
|
||||
public abstract partial class FormPage : Page, IFormPage
|
||||
{
|
||||
public virtual IForm[] Forms() => throw new NotImplementedException();
|
||||
public abstract IForm[] Forms();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user