Ejemplo n.º 1
0
        private async Task <ConnectionParams> AttachToService()
        {
            ProgressMessage = __AppServices.LocalizedString("Connecting_Service_Progress");
            IsInProgress    = true;

            ServiceAttachResult result = await __AppServices.AttachToService();

            ProgressMessage = "";
            IsInProgress    = false;

            if (result.IsError)
            {
                SetError(__AppServices.LocalizedString("ErrorCaption_IVPNServiceCouldNotStart"), result.ErrorMessage);
                return(new ConnectionParams(0, 0));
            }

            return(new ConnectionParams(result.Port, result.Secret));
        }