public void deleteAssets(ICollection <AutomationAsset> assetsToDelete) { bool deleteLocally = true; bool deleteFromCloud = true; // when asset is only local or only in cloud, we know where they want to delete it from. But when asset is both local and cloud, // they may not have meant to delete it from cloud, so ask them foreach (var assetToDelete in assetsToDelete) { if (assetToDelete.LastModifiedCloud != null && assetToDelete.LastModifiedLocal != null) { var messageBoxResult = System.Windows.MessageBox.Show( "At least some of the selected assets have both local and cloud versions. Do you want to also delete the cloud versions of these assets?", "Delete Confirmation", System.Windows.MessageBoxButton.YesNo ); if (messageBoxResult == MessageBoxResult.No) { deleteFromCloud = false; } else if (messageBoxResult == MessageBoxResult.Cancel) { deleteFromCloud = false; deleteLocally = false; } break; } } AutomationAssetManager.Delete(assetsToDelete, iseClient.currWorkspace, iseClient.automationManagementClient, iseClient.accountResourceGroups[iseClient.currAccount].Name, iseClient.currAccount.Name, deleteLocally, deleteFromCloud, getEncryptionCertificateThumbprint()); }
public async Task uploadAssets(ICollection <AutomationAsset> assetsToUpload) { await AutomationAssetManager.UploadToCloud(assetsToUpload, iseClient.automationManagementClient, iseClient.accountResourceGroups[iseClient.currAccount].Name, iseClient.currAccount.Name); // Since the cloud assets uploaded will have a last modified time of now, causing them to look newer than their local counterparts, // download the assets after upload to force last modified time between local and cloud to be the same, showing them as in sync (which they are) downloadAssets(assetsToUpload); }
private void createOrUpdateVariableAsset(string variableAssetName, AutomationVariable variableToEdit) { var dialog = new NewOrEditVariableDialog(variableToEdit); if (dialog.ShowDialog() == true) { var assetsToSave = new List <AutomationAsset>(); var newVariable = new AutomationVariable(variableAssetName, dialog.value, dialog.encrypted); assetsToSave.Add(newVariable); AutomationAssetManager.SaveLocally(iseClient.currWorkspace, assetsToSave, getEncryptionCertificateThumbprint()); refreshAssets(); } }
private void createOrUpdateCredentialAsset(string credentialAssetName, AutomationCredential credToEdit) { var dialog = new NewOrEditCredentialDialog(credToEdit); if (dialog.ShowDialog() == true) { var assetsToSave = new List <AutomationAsset>(); var newCred = new AutomationCredential(credentialAssetName, dialog.username, dialog.password); assetsToSave.Add(newCred); AutomationAssetManager.SaveLocally(iseClient.currWorkspace, assetsToSave, getEncryptionCertificateThumbprint()); refreshAssets(); } }
public void downloadAssets(ICollection <AutomationAsset> assetsToDownload) { AutomationAssetManager.DownloadFromCloud(assetsToDownload, iseClient.currWorkspace, iseClient.automationManagementClient, iseClient.accountResourceGroups[iseClient.currAccount].Name, iseClient.currAccount.Name, getEncryptionCertificateThumbprint()); }
public async Task downloadAllAssets() { await AutomationAssetManager.DownloadAllFromCloud(iseClient.currWorkspace, iseClient.automationManagementClient, iseClient.accountResourceGroups[iseClient.currAccount].Name, iseClient.currAccount.Name, getEncryptionCertificateThumbprint()); }
public async Task <SortedSet <AutomationAsset> > getAssetsInfo() { return((SortedSet <AutomationAsset>) await AutomationAssetManager.GetAll(iseClient.currWorkspace, iseClient.automationManagementClient, iseClient.accountResourceGroups[iseClient.currAccount].Name, iseClient.currAccount.Name, getEncryptionCertificateThumbprint())); }