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 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 async Task createOrUpdateVariableAsset(string variableAssetName, AutomationVariable variableToEdit, bool newAsset = false) { if (newAsset) { // Check if variable already exists before creating one. var asset = await AutomationAssetManager.GetAsset(variableAssetName, Constants.AssetType.Variable, iseClient.currWorkspace, iseClient.automationManagementClient, iseClient.accountResourceGroups[iseClient.currAccount].Name, iseClient.currAccount.Name, getEncryptionCertificateThumbprint(), connectionTypes); if (asset != null) throw new Exception("Variable with that name already exists"); } 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); try { AutomationAssetManager.SaveLocally(iseClient.currWorkspace, assetsToSave, getEncryptionCertificateThumbprint(), connectionTypes); await refreshAssets(); } catch (Exception exception) { MessageBox.Show(exception.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } } }