private void btnBrowseAliasDir_Click(object sender, EventArgs e) { using (var picker = new UnmanagedFileBrowser(_fs.CurrentConnection.ResourceService)) { picker.SelectFoldersOnly = true; if (picker.ShowDialog() == DialogResult.OK) { txtPath.Text = picker.SelectedItem; } } }
public override void Run() { var wb = Workbench.Instance; var exp = wb.ActiveSiteExplorer; var mgr = ServiceRegistry.GetService<ServerConnectionManager>(); var conn = mgr.GetConnection(exp.ConnectionName); var picker = new UnmanagedFileBrowser(conn.ResourceService); if (picker.ShowDialog(wb) == System.Windows.Forms.DialogResult.OK) { MessageService.ShowMessage(picker.SelectedItem); } else { MessageService.ShowMessage(Strings.Cancelled); } }
private void browseAliasedFolderToolStripMenuItem_Click(object sender, EventArgs e) { using (var picker = new UnmanagedFileBrowser(_service.ResourceService)) { picker.AllowMultipleSelection = false; picker.SelectFoldersOnly = true; if (picker.ShowDialog() == DialogResult.OK) { List<string> files = new List<string>(); var folder = picker.SelectedItem; if (!string.IsNullOrEmpty(folder)) { folder = folder.Replace("%MG_DATA_PATH_ALIAS[", "[") //NOXLATE .Replace("]%", "]"); //NOXLATE } var list = _service.ResourceService.EnumerateUnmanagedData(folder, string.Empty, false, UnmanagedDataTypes.Files); var extensions = new List<string>(new string[] { ".png", //NOXLATE ".jpg", //NOXLATE ".jpeg", //NOXLATE ".tif", //NOXLATE ".tiff", //NOXLATE ".ecw", //NOXLATE ".sid", //NOXLATE ".dem", //NOXLATE ".gif", //NOXLATE ".bmp" //NOXLATE }); foreach (var f in list.Items) { var file = f as OSGeo.MapGuide.ObjectModels.Common.UnmanagedDataListUnmanagedDataFile; if (file != null) { foreach (var ext in extensions) { if (file.FileName.ToLower().EndsWith(ext)) { var leftpart = file.UnmanagedDataId.Substring(0, file.UnmanagedDataId.IndexOf("]")); //NOXLATE var rightpart = file.UnmanagedDataId.Substring(file.UnmanagedDataId.IndexOf("]") + 1); //NOXLATE var item = "%MG_DATA_PATH_ALIAS" + leftpart + "]%" + rightpart; //NOXLATE files.Add(item); break; } } } } DoUpdateConfiguration(files.ToArray(), new string[0], true); } } }
private void browseAliasedFileToolStripMenuItem_Click(object sender, EventArgs e) { using (var picker = new UnmanagedFileBrowser(_service.ResourceService)) { picker.AllowMultipleSelection = true; if (picker.ShowDialog() == DialogResult.OK) { DoUpdateConfiguration(picker.SelectedItems, new string[0], true); } } }
private void btnBrowseAlias_Click(object sender, EventArgs e) { using (var picker = new UnmanagedFileBrowser(_service.ResourceService)) { picker.Extensions = GetUnmanagedFileExtensions(); picker.SelectFoldersOnly = false; if (picker.ShowDialog() == DialogResult.OK) { txtAlias.Text = picker.SelectedItem; } } }
private void pickAnAliasedFileToolStripMenuItem_Click(object sender, EventArgs e) { if (grdConnectionParameters.SelectedCells.Count != 1) return; var cell = grdConnectionParameters.SelectedCells[0]; using (var dlg = new UnmanagedFileBrowser(_service.ResourceService)) { if (dlg.ShowDialog() == DialogResult.OK) { cell.Value = dlg.SelectedItem; } } }
private void btnBrowseAlias_Click(object sender, EventArgs e) { using (var picker = new UnmanagedFileBrowser(_resSvc)) { if (picker.ShowDialog() == DialogResult.OK) { txtFilePath.Text = picker.SelectedItem; } } }