/// <summary> /// Shows the repository folder browser and sets URL cell value to the selected url /// </summary> /// <param name="row"></param> private void SelectRepositoryFolder(DataGridViewRow row) { IAnkhServiceProvider context = Context; if (context != null) { using (RepositoryExplorer.RepositoryFolderBrowserDialog rfbd = new RepositoryExplorer.RepositoryFolderBrowserDialog()) { // do not show files in repo browser rfbd.ShowFiles = false; string selectedUriString = row.Cells[0].Value as string; // set the current URL value as the initial selection Uri selectedUri; if (!string.IsNullOrEmpty(selectedUriString) && Uri.TryCreate(selectedUriString, UriKind.Absolute, out selectedUri) ) { rfbd.SelectedUri = selectedUri; } if (DialogResult.OK == rfbd.ShowDialog(context)) { Uri uri = rfbd.SelectedUri; // set the Url cell value to the selected Url row.Cells[0].Value = uri == null ? string.Empty : uri.AbsoluteUri; } } } }