Show / Hide Table of Contents

Method CreateAsync

CreateAsync()

Creates asynchronously a new instance of the ArcGISPortal class that represents ArcGIS Online (i.e https://www.arcgis.com as Portal Uri).

Declaration
public static Task<ArcGISPortal> CreateAsync()
Returns
Type Description
System.Threading.Tasks.Task<ArcGISPortal>

The task object representing the asynchronous create operation. The value of the task result is a ArcGISPortal object.

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.7
.NET100.13 - 200.7
.NET Windows100.13 - 200.7
.NET Android200.0 - 200.7
.NET iOS200.0 - 200.7
.NET Framework100.0 - 200.7
Xamarin.Android100.0 - 100.15
Xamarin.iOS100.0 - 100.15
UWP100.0 - 200.7
Relevant samples
Display KML: Display KML from a URL, portal item, or local KML file.

CreateAsync(CancellationToken)

Creates asynchronously a new instance of the ArcGISPortal class that represents ArcGIS Online (i.e https://www.arcgis.com as Portal Uri).

Declaration
public static Task<ArcGISPortal> CreateAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
System.Threading.CancellationToken cancellationToken

A System.Threading.CancellationToken with which to cancel the operation if required.

Returns
Type Description
System.Threading.Tasks.Task<ArcGISPortal>

The task object representing the asynchronous create operation. The value of the task result is a ArcGISPortal object.

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.7
.NET100.13 - 200.7
.NET Windows100.13 - 200.7
.NET Android200.2 - 200.7
.NET iOS200.0 - 200.7
.NET Framework100.0 - 200.7
Xamarin.Android100.0 - 100.14
Xamarin.iOS100.0 - 100.15
UWP100.0 - 200.7
Relevant samples
Access load status: Determine the map's load status which can be `NotLoaded`, `FailedToLoad`, `Loading`, `Loaded`.
Add an integrated mesh layer: View an integrated mesh layer from a scene service.
Add ENC exchange set: Display nautical charts per the ENC specification.
Create, delete, and update features: Add, delete, and update features (geometry and attributes) in a feature layer.

CreateAsync(Uri)

Creates asynchronously a new instance of the ArcGISPortal class from the specified portal Uri.

Declaration
public static Task<ArcGISPortal> CreateAsync(Uri portalUri)
Parameters
Type Name Description
System.Uri portalUri

The portal URI.

Returns
Type Description
System.Threading.Tasks.Task<ArcGISPortal>

The task object representing the asynchronous create operation. The value of the task result is a ArcGISPortal object.

Remarks

If the URI is null, ArcGIS Online is used by default (https://www.arcgis.com). Access is to the portal resources is anonymous.

The supported URL formats are:

  • The URL of the portal (Example: http://www.arcgis.com).
  • The URL of the portal REST endpoint (Example: http://www.arcgis.com/sharing/rest).
  • The URL of the deprecated portal REST endpoint (Example: http://www.arcgis.com/sharing).

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.7
.NET100.13 - 200.7
.NET Windows100.13 - 200.7
.NET Android200.2 - 200.7
.NET iOS200.0 - 200.7
.NET Framework100.0 - 200.7
Xamarin.Android100.0 - 100.14
Xamarin.iOS100.0 - 100.15
UWP100.0 - 200.7
Relevant samples
Map reference scale: Set the map's reference scale and which feature layers should honor the reference scale.

CreateAsync(Uri, CancellationToken)

Creates asynchronously a new instance of the ArcGISPortal class from the specified portal Uri. If the URI is null, ArcGIS Online is used by default (https://www.arcgis.com).

Declaration
public static Task<ArcGISPortal> CreateAsync(Uri portalUri, CancellationToken cancellationToken)
Parameters
Type Name Description
System.Uri portalUri

The portal URI.

System.Threading.CancellationToken cancellationToken

A System.Threading.CancellationToken with which to cancel the operation if required.

Returns
Type Description
System.Threading.Tasks.Task<ArcGISPortal>

The task object representing the asynchronous create operation. The value of the task result is a ArcGISPortal object.

Remarks

Use this method to create a portal from a URI and a cancellation token.

The supported URL formats are:

  • The URL of the portal (Example: http://www.arcgis.com).
  • The URL of the portal rest end point (Example: http://www.arcgis.com/sharing/rest).
  • The URL of the deprecated portal rest end point (Example: http://www.arcgis.com/sharing).

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.7
.NET100.13 - 200.7
.NET Windows100.13 - 200.7
.NET Android200.2 - 200.7
.NET iOS200.0 - 200.7
.NET Framework100.0 - 200.7
Xamarin.Android100.0 - 100.14
Xamarin.iOS100.0 - 100.15
UWP100.0 - 200.7

CreateAsync(Uri, CultureInfo)

Creates asynchronously a new instance of the ArcGISPortal class from the specified portal Uri. If the URI is null, ArcGIS Online is used by default (https://www.arcgis.com).

Declaration
public static Task<ArcGISPortal> CreateAsync(Uri portalUri, CultureInfo culture)
Parameters
Type Name Description
System.Uri portalUri

The portal URI.

System.Globalization.CultureInfo culture

The culture for the portal.

Returns
Type Description
System.Threading.Tasks.Task<ArcGISPortal>

The task object representing the asynchronous create operation. The value of the task result is a ArcGISPortal object.

Remarks

Use this method to create a portal from a URI and an ArcGIS portal culture.

The supported URL formats are:

  • The URL of the portal (Example: http://www.arcgis.com).
  • The URL of the portal rest end point (Example: http://www.arcgis.com/sharing/rest).
  • The URL of the deprecated portal rest end point (Example: http://www.arcgis.com/sharing).

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.7
.NET100.13 - 200.7
.NET Windows100.13 - 200.7
.NET Android200.2 - 200.7
.NET iOS200.0 - 200.7
.NET Framework100.0 - 200.7
Xamarin.Android100.0 - 100.14
Xamarin.iOS100.0 - 100.15
UWP100.0 - 200.7

CreateAsync(Uri, CultureInfo, CancellationToken)

Creates asynchronously a new instance of the ArcGISPortal class from the specified portal Uri. If the URI is null, ArcGIS Online is used by default (https://www.arcgis.com).

Declaration
public static Task<ArcGISPortal> CreateAsync(Uri portalUri, CultureInfo culture, CancellationToken cancellationToken)
Parameters
Type Name Description
System.Uri portalUri

The portal URI.

System.Globalization.CultureInfo culture

The culture for the portal.

System.Threading.CancellationToken cancellationToken

A System.Threading.CancellationToken with which to cancel the operation if required.

Returns
Type Description
System.Threading.Tasks.Task<ArcGISPortal>

The task object representing the asynchronous create operation. The value of the task result is a ArcGISPortal object.

Remarks

Use this method to create a portal from a URI, an ArcGIS portal culture, and a cancellation token.

The supported URL formats are:

  • The URL of the portal (Example: http://www.arcgis.com).
  • The URL of the portal rest end point (Example: http://www.arcgis.com/sharing/rest).
  • The URL of the deprecated portal rest end point (Example: http://www.arcgis.com/sharing).

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.7
.NET100.13 - 200.7
.NET Windows100.13 - 200.7
.NET Android200.2 - 200.7
.NET iOS200.0 - 200.7
.NET Framework100.0 - 200.7
Xamarin.Android100.0 - 100.14
Xamarin.iOS100.0 - 100.15
UWP100.0 - 200.7

CreateAsync(Uri, Boolean)

Creates asynchronously a new instance of the ArcGISPortal class. If the URI is null, ArcGIS Online is used by default (https://www.arcgis.com).

Declaration
public static Task<ArcGISPortal> CreateAsync(Uri portalUri, bool loginRequired)
Parameters
Type Name Description
System.Uri portalUri

The portal URI.

System.Boolean loginRequired

Login required flag. Use true to force user login, false to only login if required by the portal.

Returns
Type Description
System.Threading.Tasks.Task<ArcGISPortal>

The task object representing the asynchronous create operation. The value of the task result is a ArcGISPortal object.

Remarks

Use this method to create a portal from a URI and a login required boolean.

The supported URL formats are:

  • The URL of the portal (Example: http://www.arcgis.com).
  • The URL of the portal rest end point (Example: http://www.arcgis.com/sharing/rest).
  • The URL of the deprecated portal rest end point (Example: http://www.arcgis.com/sharing).

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.7
.NET100.13 - 200.7
.NET Windows100.13 - 200.7
.NET Android200.2 - 200.7
.NET iOS200.0 - 200.7
.NET Framework100.2.1 - 200.7
Xamarin.Android100.2.1 - 100.14
Xamarin.iOS100.2.1 - 100.15
UWP100.2.1 - 200.7

CreateAsync(Uri, Boolean, CancellationToken)

Creates asynchronously a new instance of the ArcGISPortal class. If the URI is null, ArcGIS Online is used by default (https://www.arcgis.com).

Declaration
public static Task<ArcGISPortal> CreateAsync(Uri portalUri, bool loginRequired, CancellationToken cancellationToken)
Parameters
Type Name Description
System.Uri portalUri

The portal URI.

System.Boolean loginRequired

Login required flag. Use true to force user login, false to only login if required by the portal.

System.Threading.CancellationToken cancellationToken

A System.Threading.CancellationToken with which to cancel the operation if required.

Returns
Type Description
System.Threading.Tasks.Task<ArcGISPortal>

The task object representing the asynchronous create operation. The value of the task result is a ArcGISPortal object.

Remarks

Use this method to create a portal from a URI, a login required boolean, and a cancellation token.

The supported URL formats are:

  • The URL of the portal (Example: http://www.arcgis.com).
  • The URL of the portal rest end point (Example: http://www.arcgis.com/sharing/rest).
  • The URL of the deprecated portal rest end point (Example: http://www.arcgis.com/sharing).

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.7
.NET100.13 - 200.7
.NET Windows100.13 - 200.7
.NET Android200.2 - 200.7
.NET iOS200.0 - 200.7
.NET Framework100.2.1 - 200.7
Xamarin.Android100.2.1 - 100.14
Xamarin.iOS100.2.1 - 100.15
UWP100.2.1 - 200.7

CreateAsync(Uri, Boolean, CultureInfo)

Creates asynchronously a new instance of the ArcGISPortal class. If the URI is null, ArcGIS Online is used by default (https://www.arcgis.com).

Declaration
public static Task<ArcGISPortal> CreateAsync(Uri portalUri, bool loginRequired, CultureInfo culture)
Parameters
Type Name Description
System.Uri portalUri

The portal URI.

System.Boolean loginRequired

Login required flag. Use true to force user login, false to only login if required by the portal.

System.Globalization.CultureInfo culture

The culture for the portal.

Returns
Type Description
System.Threading.Tasks.Task<ArcGISPortal>

The task object representing the asynchronous create operation. The value of the task result is a ArcGISPortal object.

Remarks

Use this method to create a portal from a URI, a login required boolean and an ArcGIS portal culture.

The supported URL formats are:

  • The URL of the portal (Example: http://www.arcgis.com).
  • The URL of the portal rest end point (Example: http://www.arcgis.com/sharing/rest).
  • The URL of the deprecated portal rest end point (Example: http://www.arcgis.com/sharing).

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.7
.NET100.13 - 200.7
.NET Windows100.13 - 200.7
.NET Android200.2 - 200.7
.NET iOS200.0 - 200.7
.NET Framework100.2.1 - 200.7
Xamarin.Android100.2.1 - 100.14
Xamarin.iOS100.2.1 - 100.15
UWP100.2.1 - 200.7

CreateAsync(Uri, Boolean, CultureInfo, CancellationToken)

Creates asynchronously a new instance of the ArcGISPortal class. If the URI is null, ArcGIS Online is used by default (https://www.arcgis.com).

Declaration
public static async Task<ArcGISPortal> CreateAsync(Uri portalUri, bool loginRequired, CultureInfo culture, CancellationToken cancellationToken)
Parameters
Type Name Description
System.Uri portalUri

The portal URI.

System.Boolean loginRequired

Login required flag. Use true to force user login, false to only login if required by the portal.

System.Globalization.CultureInfo culture

The culture for the portal.

System.Threading.CancellationToken cancellationToken

A System.Threading.CancellationToken with which to cancel the operation if required.

Returns
Type Description
System.Threading.Tasks.Task<ArcGISPortal>

The task object representing the asynchronous create operation. The value of the task result is a ArcGISPortal object.

Remarks

Use this method to create a portal from a URI, a login required boolean, an ArcGIS portal culture, and a cancellation token.

The supported URL formats are:

  • The URL of the portal (Example: http://www.arcgis.com).
  • The URL of the portal rest end point (Example: http://www.arcgis.com/sharing/rest).
  • The URL of the deprecated portal rest end point (Example: http://www.arcgis.com/sharing).

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.7
.NET100.13 - 200.7
.NET Windows100.13 - 200.7
.NET Android200.2 - 200.7
.NET iOS200.0 - 200.7
.NET Framework100.2.1 - 200.7
Xamarin.Android100.2.1 - 100.14
Xamarin.iOS100.2.1 - 100.15
UWP100.2.1 - 200.7
In This Article
Back to top Copyright © 2022 Esri.