Select to view content in your preferred language

Support file name patterns for BrowseProjectFilter in OpenItemDialog in ArcGIS Pro SDK

498
0
02-22-2022 11:09 PM
Status: Open
Labels (1)
ChristophKoschmieder
New Contributor III

Support file name patterns for BrowseProjectFilter in OpenItemDialog in ArcGIS Pro SDK:

It would be very helpful, if it would be possible to set one or more file name patterns (maybe comma separated) for BrowseProjectFilter in OpenItemDialog to filter the selectable projects in this dialog like

> browseFilter.FileNamePattern = "MyProject_*,PrivateProject_*"; < (for snippet idea see below).

As I understand, currently it is only possible to define a file extension (= last portion of a file path after the last ".") to filter the existing files.

var dlg = new OpenItemDialog();
dlg.Title = $"Open my project only...";
dlg.InitialLocation = ...;
dlg.Filter = ArcGIS.Desktop.Catalog.ItemFilters.projects;

var browseFilter = new BrowseProjectFilter();
browseFilter.BrowsingFilesMode = true;
browseFilter.FileExtension = "*.aprx"
browseFilter.Name = "My projects only! (*.aprx)";

--> browseFilter.FileNamePattern = "MyProject_*"; <--

dlg.BrowseFilter = browseFilter;

if (dlg.ShowDialog() ?? false)
{
...
}