ArcGIS Pro 3.6 API Reference Guide
ArcGIS.Desktop.Core Namespace / ICatalogWindow Interface / SetSecondaryPortalContentTypeAsync Method
Example

In This Topic
    SetSecondaryPortalContentTypeAsync Method
    In This Topic
    Sets the catalog secondary portal content type to be shown in the catalog dock pane. This method must be called on the UI thread.
    Syntax
    void SetSecondaryPortalContentTypeAsync( 
       CatalogSecondaryPortalContentType secondaryPortalContentType
    )
    Sub SetSecondaryPortalContentTypeAsync( _
       ByVal secondaryPortalContentType As CatalogSecondaryPortalContentType _
    ) 

    Parameters

    secondaryPortalContentType
    Exceptions
    ExceptionDescription
    The calling thread cannot access this object because a different thread owns it
    Remarks
    Specify the catalog secondary portal content type to be set. The catalog dockpane must be the current active window and the current content type must be CatalogContentType.Portal or the request is ignored. If the catalog dockpane is already showing the specified secondary portal content type, the request is ignored. Attempting to set the secondary portal content type to CatalogSecondaryPortalContentType.UserContent with no signed on user will, instead, change the secondary portal content type to the default portal content type for a non signed-on user, typically CatalogSecondaryPortalContentType.AllContent. Note: This method must be invoked on the UI thread or an System.InvalidOperationException can be thrown.
    This method returns void and cannot be awaited.
    Example
    Set the secondary portal catalog content
    //Gets the Catalog pane
    var catalogWindow = Project.GetCatalogPane() as ICatalogWindow;
    if (!catalogWindow.IsActiveWindow)
        return; //catalog dockpane must be the active window
    
    var catContentType = catalogWindow.GetCurrentContentType();
    //Is portal content being shown?
    if (catContentType == CatalogContentType.Portal)
    {
        //check what is the portal content type being shown...
        var portalContentType = (int)catalogWindow.GetCurrentSecondaryPortalContentType();
        //advance to the next tab
        portalContentType++;
        if (portalContentType > (int)CatalogSecondaryPortalContentType.LivingAtlas)
            portalContentType = (int)CatalogSecondaryPortalContentType.UserContent;
    
        //set the secondary portal content type
        //Must be on the UI - no QueuedTask!
        catalogWindow.SetSecondaryPortalContentTypeAsync(
            (CatalogSecondaryPortalContentType)portalContentType);
    }
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.6 or higher.
    See Also