private async Task <bool> TrySendFastClipboard(string text, object rs, string deviceName) { if (rs is NormalizedRemoteSystem) { return(await AndroidRomePackageManager.QuickClipboard(text, rs as NormalizedRemoteSystem, SecureKeyStorage.GetUserId(), deviceName)); } else { if (ShouldPrioritizeRomePackageManager(rs as RemoteSystem)) { var result = await MainPage.Current.PackageManager.QuickClipboard(text, rs as RemoteSystem, deviceName, "roamit://clipboard"); if (!result) { // Try using Cloud Service for that instead if (CloudServiceRomePackageManager.Instance.IsInitialized) { return(await CloudServiceRomePackageManager.Instance.QuickClipboardForWindowsDevice(text, (rs as RemoteSystem).DisplayName, deviceName)); } return(false); } return(true); } else { var result = await CloudServiceRomePackageManager.Instance.QuickClipboardForWindowsDevice(text, (rs as RemoteSystem).DisplayName, deviceName); if (result) { return(true); } else { // If launching via cloud service failed, fall back to local Project Rome SDK. return(await MainPage.Current.PackageManager.QuickClipboard(text, rs as RemoteSystem, deviceName, "roamit://clipboard")); } } } }
private async Task LaunchUri(object rs) { ViewModel.ProgressPercentIndicatorVisibility = Visibility.Collapsed; RomeRemoteLaunchUriStatus launchResult; if (rs is NormalizedRemoteSystem) { launchResult = await AndroidRomePackageManager.LaunchUri(SendDataTemporaryStorage.LaunchUri, rs as NormalizedRemoteSystem, SecureKeyStorage.GetUserId()); } else { if (ShouldPrioritizeRomePackageManager(rs as RemoteSystem)) { launchResult = await MainPage.Current.PackageManager.LaunchUri(SendDataTemporaryStorage.LaunchUri, rs, false); if (launchResult == RomeRemoteLaunchUriStatus.RemoteSystemUnavailable) { // 1809 bug, will try cloud service if available if (CloudServiceRomePackageManager.Instance.IsInitialized) { launchResult = await CloudServiceRomePackageManager.Instance.LaunchUri(((RemoteSystem)rs).DisplayName, SendDataTemporaryStorage.LaunchUri); } } } else { launchResult = await CloudServiceRomePackageManager.Instance.LaunchUri(((RemoteSystem)rs).DisplayName, SendDataTemporaryStorage.LaunchUri); // If launching via cloud service failed, fall back to local Project Rome SDK. if (launchResult != RomeRemoteLaunchUriStatus.Success) { launchResult = await MainPage.Current.PackageManager.LaunchUri(SendDataTemporaryStorage.LaunchUri, rs, false); } } } string status; if (launchResult == RomeRemoteLaunchUriStatus.Success) { status = ""; } else { status = launchResult.ToString(); } SendTextFinished(status); }
private async Task <bool> TrySendFastClipboard(string text, object rs, string deviceName) { if (rs is NormalizedRemoteSystem) { return(await AndroidRomePackageManager.QuickClipboard(text, rs as NormalizedRemoteSystem, SecureKeyStorage.GetUserId(), deviceName)); } else { return(await MainPage.Current.PackageManager.QuickClipboard(text, rs as RemoteSystem, deviceName, "roamit://clipboard")); } }