Beispiel #1
0
        public MainWindow()
        {
            InitializeComponent();

            DataContext = this;
            Config.ReadConfig();
            ViewModel = Globals.Settings;
            SetPasswordBoxes();
            ObservableCollection <RasEntry> vpnConnections = RasEntry.LoadPhoneBookEntries();
            int i = 0;

            foreach (RasEntry entry in vpnConnections)
            {
                i++;
                ViewModel.VpnConnections.Add(entry.FriendlyName);
                if (!string.IsNullOrEmpty(ViewModel.SelectedVpnFriendlyName))
                {
                    if (entry.FriendlyName.ToUpper() == ViewModel.SelectedVpnFriendlyName.ToUpper())
                    {
                        comboVpnConnections.SelectedIndex = i;
                    }
                }
            }
            Title = string.Format(Title, System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString());
            InitContextMenu();
            Hide();
            if (ViewModel.ServerMode)
            {
                StartListening();
            }
        }