Files
2026-06-17 11:50:06 +02:00

132 lines
4.0 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Configuration;
namespace $safeprojectname$
{
public partial class settingsForm : Form
{
public settingsForm()
{
InitializeComponent();
divider1.BackColor = Properties.Settings.Default.myColor;
divider2.BackColor = Properties.Settings.Default.myColor;
divider3.BackColor = Properties.Settings.Default.myColor;
if (Properties.Settings.Default.cryptType == "CBC")
{
cbcButton.Checked = true;
}
if (Properties.Settings.Default.cryptType == "ECB")
{
ecbButton.Checked = true;
}
if (Properties.Settings.Default.cryptType == "CTR")
{
ctrButton.Checked = true;
}
}
private void blueColorButton_Click(object sender, EventArgs e)
{
Properties.Settings.Default.myColor = SystemColors.Highlight;
Properties.Settings.Default.Save();
Application.Restart();
}
private void redColorButton_Click(object sender, EventArgs e)
{
Properties.Settings.Default.myColor = Color.Firebrick;
Properties.Settings.Default.Save();
Application.Restart();
}
private void greenColorButton_Click(object sender, EventArgs e)
{
Properties.Settings.Default.myColor = Color.ForestGreen;
Properties.Settings.Default.Save();
Application.Restart();
}
private void purpleColorButton_Click(object sender, EventArgs e)
{
Properties.Settings.Default.myColor = Color.BlueViolet;
Properties.Settings.Default.Save();
Application.Restart();
}
private void orangeColorButton_Click(object sender, EventArgs e)
{
Properties.Settings.Default.myColor = Color.Peru;
Properties.Settings.Default.Save();
Application.Restart();
}
private void yellowColorButton_Click(object sender, EventArgs e)
{
Properties.Settings.Default.myColor = Color.Goldenrod;
Properties.Settings.Default.Save();
Application.Restart();
}
private void tealColorButton_Click(object sender, EventArgs e)
{
Properties.Settings.Default.myColor = Color.Teal;
Properties.Settings.Default.Save();
Application.Restart();
}
private void turquoiseColorButton_Click(object sender, EventArgs e)
{
Properties.Settings.Default.myColor = Color.LightSeaGreen;
Properties.Settings.Default.Save();
Application.Restart();
}
private void cbcButton_CheckedChanged(object sender, EventArgs e)
{
changeCryptType();
}
private void ecbButton_CheckedChanged(object sender, EventArgs e)
{
changeCryptType();
}
private void ctrButton_CheckedChanged(object sender, EventArgs e)
{
changeCryptType();
}
private Boolean changeCryptType()
{
if (cbcButton.Checked)
{
Properties.Settings.Default.cryptType = "CBC";
Properties.Settings.Default.Save();
}
if (ecbButton.Checked)
{
Properties.Settings.Default.cryptType = "ECB";
Properties.Settings.Default.Save();
}
if (ctrButton.Checked)
{
Properties.Settings.Default.cryptType = "CTR";
Properties.Settings.Default.Save();
}
return true;
}
}
}