Files
Relaunch-Process/DiscordSettings.cs
2024-05-22 11:11:47 +03:00

52 lines
1.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using RelaunchProcess.Properties;
namespace RelaunchProcess
{
public partial class DiscordSettings : Form
{
public DiscordSettings()
{
InitializeComponent();
}
private void BtnCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
private void BtnOk_Click(object sender, EventArgs e)
{
if (Uri.IsWellFormedUriString(textDwhURL.Text, UriKind.Absolute)||textDwhURL.Text=="")
{
if (textDwhURL.Text=="")
{
chbxDiscordEnabled.Checked = false;
}
Settings.Default.Save();
DialogResult = DialogResult.OK;
Close();
}
else
{
//TODO обработать ситуацию с неверным УРЛом
MessageBox.Show("Неверный формат URL.", "URL", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void BtnClearUrlField_Click(object sender, EventArgs e)
{
textDwhURL.Text = "";
}
}
}