private VpnState WithFallbackRemoteIp(VpnState state, string remoteIp) { if (state.Status == VpnStatus.Disconnecting || state.Status == VpnStatus.Disconnected || !string.IsNullOrEmpty(state.RemoteIp)) { return(state); } return(state.WithRemoteIp(remoteIp)); }
private VpnState WithFallbackRemoteServer(VpnState state, VpnHost remoteServer) { if (state.Status == VpnStatus.Disconnecting || state.Status == VpnStatus.Disconnected || !string.IsNullOrEmpty(state.RemoteIp)) { return(state); } return(state.WithRemoteIp(remoteServer.Ip, remoteServer.Label)); }