using Microsoft.Win32;
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 eDosStation
{
    /// <summary>
    /// Interaction logic for About.xaml
    /// </summary>
    public partial class About : Window
    {
        public About(Station station)
        {
            InitializeComponent();
            aVersion.Text = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
            stationID.Text = station.ID_Station.ToString();
            ReadAlias();
            if (station.checkUser) checkUser.Text = "Yes"; else checkUser.Text = "No";
        }

        private void RadButton_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void ReadAlias()
        {
            using (RegistryKey key = Registry.LocalMachine.OpenSubKey("SOFTWARE\\WOW6432Node\\Microsoft\\MSSQLServer\\Client\\ConnectTo",false))
            {
                remoteSql.Text = key.GetValue("eDos").ToString();
                localSql.Text = key.GetValue("eDosLocal").ToString();
            }
            
        }
    }
}
