using System;
using System.Windows.Forms;
using System.Collections.Generic;

using FilterAPI.External;

namespace FilterEncrypter
{
    public partial class Main : Form
    {
        public Main() { InitializeComponent(); }

        private void Main_Shown(Object Sender, EventArgs Args)
        {
            List<String> FilterExEHashes = new List<String>();
            FilterExEHashes.Add("Enabled: True");
            FilterExEHashes.Add(String.Format("FilterCentral: {0}", ExecutingHash.GetMD5OfExE(String.Format("{0}FilterCentral.exe", AppDomain.CurrentDomain.BaseDirectory))));
            FilterExEHashes.Add(String.Format("FilterLauncher: {0}", ExecutingHash.GetMD5OfExE(String.Format("{0}FilterLauncher.exe", AppDomain.CurrentDomain.BaseDirectory))));
            FilterExEHashes.Add(String.Format("FilterRest: {0}", ExecutingHash.GetMD5OfExE(String.Format("{0}FilterRest.exe", AppDomain.CurrentDomain.BaseDirectory))));
            FilterExEHashes.Add(String.Format("FilterTimers: {0}", ExecutingHash.GetMD5OfExE(String.Format("{0}FilterTimers.exe", AppDomain.CurrentDomain.BaseDirectory))));
            FilterExEHashes.Add(String.Format("FilterLogin: {0}", ExecutingHash.GetMD5OfExE(String.Format("{0}FilterLogin.exe", AppDomain.CurrentDomain.BaseDirectory))));
            FilterExEHashes.Add(String.Format("FilterManager: {0}", ExecutingHash.GetMD5OfExE(String.Format("{0}FilterManager.exe", AppDomain.CurrentDomain.BaseDirectory))));
            FilterExEHashes.Add(String.Format("FilterZone: {0}", ExecutingHash.GetMD5OfExE(String.Format("{0}FilterZone.exe", AppDomain.CurrentDomain.BaseDirectory))));

            ExEHashes.Lines = FilterExEHashes.ToArray();
        }

        private void Encrypt_Click(Object Sender, EventArgs Args) { Config.Lines = Encryption.EncryptStringArray(Config.Lines, "KGDQIN5B42lY2HoLQrusdehnyCcMoM4Xo2EZIiL0B96nhNo7sAIAtkrHwXNJ8Gk3"); }

        private void Decrypt_Click(Object Sender, EventArgs Args) { Config.Lines = Encryption.DecryptStringArray(Config.Lines, "KGDQIN5B42lY2HoLQrusdehnyCcMoM4Xo2EZIiL0B96nhNo7sAIAtkrHwXNJ8Gk3"); }
    }
}
