using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace FSI.BT.Tools.RadialMenu.UserInterface
{
    /// <summary>
    /// Interaktionslogik für FrmAdmin.xaml
    /// </summary>
    public partial class FrmAdmin : Window
    {

        public string[] Admins { get; set; }
        public string[] Users { get; set; }

        public FrmAdmin()
        {
            InitializeComponent();
        }

        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
#if NET472
            Admins = tbAdmins.Text.Split(new string[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
            Users = tbUsers.Text.Split(new string[] { "\r\n", "\r", "\n" },  StringSplitOptions.None);
#elif NET6_0
            Admins = tbAdmins.Text.Split(Environment.NewLine);
            Users = tbUsers.Text.Split(Environment.NewLine);
#endif
            DialogResult = true;
            Close();
        }

        private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            DialogResult = false;
            Close();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            tbAdmins.Text = String.Join(Environment.NewLine, Admins);
            tbUsers.Text = String.Join(Environment.NewLine, Users);
        }
    }
}
