ArcGIS Runtime SDK for WPF - Library Reference
GetItemsTaskAsync Method
See Also 
ESRI.ArcGIS.Client.Portal Namespace > ArcGISPortalUser Class : GetItemsTaskAsync Method

Gets the items of the user that are stored at the root folder.

Syntax

Visual Basic (Declaration) 
Public Function GetItemsTaskAsync() As Task(Of IEnumerable(Of ArcGISPortalItem))
C# 
public Task<IEnumerable<ArcGISPortalItem>> GetItemsTaskAsync()

Remarks

The purpose of this Method is to obtain the items that belong to a particular authenticated user in ArcGIS Online (AGOL) and ArcGIS Portal. This method performs an asynchronous request to obtain an IEnumerable of Portal.ArcGISPortalItem objects for the credentialed logged in user via the IdentityManager. You cannot use anonymous access to obtain a Portal.ArcGISPortalUser object and use this Method to obtain valid results. As AGOL/ArcGIS Portal require the use of long term tokens to access secured information user information you should remember to set the IdentityManager.TokenGenerationReferer Property to the correct string required by your development platform.

It is a recommended best practice to call the Portal.ArcGISPortal.InitializeTaskAsync Method to initialize the Portal.ArcGISPortal object such that the credentialed Portal.ArcGISPortal.CurrentUser can be obtained for using this method. Other Methods and Properties (ex: Portal.ArcGISPortal.SearchUsersTaskAsync, Portal.ArcGISPortalGroup.GetGroupUsersTaskAsync, Portal.ArcGISPortalInfo.QueryUsersTaskAsync, etc.) that return a list/collection of Portal.ArcGISPortalUser objects are not appropriate for using this Method because they are not authenticated credentialed users.

The Portal.ArcGISPortalItem objects that are returned from this Method must exist on the root level of the user account on AGOL/ArcGIS Portal. Items that are nested in sub-folders of the user account cannot be accessed with this Method; use the Portal.ArcGISPortalUser.GetFoldersTaskAsync Method instead. The IEnumerable of Portal.ArcGISPortalFolder objects returned from the Portal.ArcGISPortalUser.GetFoldersAsync Method can be interrogated further via the Portal.ArcGISPortalFolder.GetItemsTaskAsync Method call to get the Portal.ArcGISPortalItems objects in the nested sub-folders.

Requirements

Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows 7, Windows 8

See Also

© ESRI, Inc. All Rights Reserved.