FakeDeck/FakeeDeck/ButtonType/Button.cs

48 lines
1.6 KiB
C#
Raw Normal View History

2024-09-09 18:48:57 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FakeeDeck.ButtonType
{
internal class Button
{
2024-09-09 22:38:22 +00:00
public static string getButtonHTML(string icon, string image, string name, string action, Dictionary<string, string> parameters = null)
2024-09-09 18:48:57 +00:00
{
2024-09-09 22:38:22 +00:00
string body = "";
body += "<div class=\"m-2\">";
2024-09-09 20:56:27 +00:00
body += "<form style=\"margin-bottom: 0px;\" method=\"post\" action=\"" + action + "\">";
2024-09-09 22:38:22 +00:00
if (parameters is not null)
2024-09-09 20:56:27 +00:00
{
2024-09-09 22:38:22 +00:00
foreach (var parameter in parameters)
{
body += "<input type=\"hidden\" name=\"" + parameter.Key + "\" value=\"" + parameter.Value + "\">";
}
2024-09-09 20:56:27 +00:00
}
body += "<button type=\"submit\" value=\"submit\" style=\"background-size: cover; " + (!string.IsNullOrEmpty(image) ? "background-image: url('" + image + "');" : "") + " width: 150px;height: 150px; background-color: aquamarine;\" >";
body += (!string.IsNullOrEmpty(icon) ? "<i class=\"fa-solid " + icon + "\"></i>" : name);
body += "</button>";
2024-09-09 22:38:22 +00:00
2024-09-09 20:56:27 +00:00
body += "</form>";
body += "</div>";
2024-09-09 22:38:22 +00:00
2024-09-09 20:56:27 +00:00
return body;
2024-09-09 18:48:57 +00:00
}
2024-09-09 20:56:27 +00:00
public static string getButton(string Key)
{
2024-09-09 22:38:22 +00:00
return getButtonHTML(null, "https://docs.itego.cz/uploads/images/system/2022-04/OdRTPJ4iTTInmhdP-jagq7dfjpi2lilfg-imageedit-2-6604933313.gif", "Test", "test/test");
2024-09-09 20:56:27 +00:00
}
2024-09-09 22:38:22 +00:00
2024-09-09 18:48:57 +00:00
public static bool invokeAction(string Key)
{
return false;
}
}
}