using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Pilz.Updating.Administration.Discord;
using Telerik.WinControls.UI;

namespace Pilz.Updating.Administration.GUI
{
    public partial class DiscordBotSettingsWindow : RadForm
    {
        private readonly DiscordBotConfig config = null;

        public DiscordBotSettingsWindow(DiscordBotConfig config)
        {
            this.config = config;

            InitializeComponent();

            radTextBoxControl_BotToken.Text = config.DiscordBotToken;
            radTextBoxControl_DefaultProgramName.Text = config.DefaultAppName;
            radRichTextEditor_DefaultMessage.Text = config.DefaultUpdateMessage;
            radToggleSwitch_UseProxy.Value = config.UseProxy;
        }

        private void ButtonX_Okay_Click(object sender, EventArgs e)
        {
            config.DefaultUpdateMessage = radTextBoxControl_BotToken.Text.Trim();
            config.DefaultAppName = radTextBoxControl_DefaultProgramName.Text.Trim();
            config.DiscordBotToken = radRichTextEditor_DefaultMessage.Text.Trim();
            config.UseProxy = radToggleSwitch_UseProxy.Value;
        }
    }
}