47 lines
1.2 KiB
C#
47 lines
1.2 KiB
C#
namespace RconGUI
|
|||
|
|
{
|
||
|
|
public partial class MainPage : ContentPage
|
||
|
|
{
|
||
|
|
int count = 0;
|
||
|
|
|
||
|
|
public ServerContext Server { get; private set; }
|
||
|
|
|
||
|
|
public MainPage(ServerContext serverContext)
|
||
|
|
{
|
||
|
|
Server = serverContext;
|
||
|
|
this.BindingContext = Server;
|
||
|
|
InitializeComponent();
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
private void OnConnectClicked(object sender, EventArgs e)
|
||
|
|
{
|
||
|
|
Server.Connect();
|
||
|
|
|
||
|
|
//SemanticScreenReader.Announce(CounterBtn.Text);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
private async void OnActionClicked(object sender, EventArgs e) {
|
||
|
|
var btn = (Button)sender;
|
||
|
|
RconScript ctx = (RconScript)btn.BindingContext;
|
||
|
|
await Server.RunCommands(ctx.Commands);
|
||
|
|
}
|
||
|
|
|
||
|
|
private async void OnMapClicked(object sender, EventArgs e) {
|
||
|
|
var btn = (Button)sender;
|
||
|
|
RconScript ctx = (RconScript)btn.BindingContext;
|
||
|
|
await Server.RunCommands(ctx.Commands);
|
||
|
|
}
|
||
|
|
|
||
|
|
private async void OnCmdClicked(object sender, EventArgs e) {
|
||
|
|
var btn = (Button)sender;
|
||
|
|
var ctx = (ConsoleObject)btn.BindingContext;
|
||
|
|
await Server.RunCommand("echo 1");
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|