Exemplo n.º 1
0
        public void SetAutomaticServerSelection(ServerSelectionType serverSelectionType)
        {
            foreach (var s in Service.Servers.ServersList)
            {
                s.IsSelected = false;
            }

            IsAutomaticServerSelected = true;
            ServerSelectionType       = serverSelectionType;
        }
Exemplo n.º 2
0
        public void SetSelectedServer(ServerLocation server, ServerSelectionType serverSelectionType)
        {
            foreach (var s in Service.Servers.ServersList)
            {
                s.IsSelected = false;
            }

            if (server != null)
            {
                var serverToSelect = Service.Servers.ServersList.FirstOrDefault(s => s.VpnServer.GatewayId == server.VpnServer.GatewayId);
                if (serverToSelect != null)
                {
                    serverToSelect.IsSelected = true;
                }
            }

            ServerSelectionType       = serverSelectionType;
            IsAutomaticServerSelected = false;
        }
        private void UpdateCaptionText(ServerSelectionType serverSelectionType)
        {
            if (SelectServerText == null)
            {
                return;
            }

            switch (serverSelectionType)
            {
            case ServerSelectionType.SingleServer:
                SelectServerText.StringValue = LocalizedStrings.Instance.LocalizedString("Button_SelectServer");
                break;

            case ServerSelectionType.EntryServer:
                SelectServerText.StringValue = LocalizedStrings.Instance.LocalizedString("Button_SelectEntryServer");
                break;

            case ServerSelectionType.ExitServer:
                SelectServerText.StringValue = LocalizedStrings.Instance.LocalizedString("Button_SelectExitServer");
                break;
            }

            SelectServerText.SizeToFit();
        }