ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Catalog Namespace / SaveItemDialog Class / ShowDialog Method
Example

In This Topic
    ShowDialog Method (SaveItemDialog)
    In This Topic
    Displays the Browse dialog box to identify the location and name of an item that will be saved to the active portal or to a local or network disk.
    Syntax
    public override Nullable<bool> ShowDialog()
    Public Overrides NotOverridable Function ShowDialog() As Nullable(Of Boolean)

    Return Value

    A boolean indicating if the Browse dialog was dismissed by pressing OK or Cancel.
    Remarks
    You can either configure the Browse dialog box properties first then display it with the ShowDialog method, or display the dialog box and then set its properties.
    Example
    Show_OpenItemDialog
    OpenItemDialog addToProjectDialog = new OpenItemDialog();
    addToProjectDialog.Title = "Add To Project";
    addToProjectDialog.InitialLocation = @"C:\Data\NewYork\Counties\Maps";
    addToProjectDialog.MultiSelect = true;
    addToProjectDialog.Filter = ItemFilters.Composite_Maps_Import;
    
    bool? ok = addToMapDialog.ShowDialog();
    
    if (ok == true)
    {
      IEnumerable<Item> selectedItems = addToMapDialog.Items;
      foreach (Item selectedItem in selectedItems)
        MapFactory.Instance.CreateMapFromItem(selectedItem);
    }
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also