Skip To Content

Portal.Add (.NET)

The Portal.Add method adds the specified portal to the list of managed portals and returns its portal properties. To sign in to the portal, use Portal.SignInAsync.

Declaration

public Dictionary<string, object> Esri.ArcGISForAutoCAD.Portal.Add(Uri portalUri)

Parameters

TypeNameDescriptionRequired

Uri

portalUri

The URI of the portal to be added.

Required

Returns

TypeDescription

Dictionary<string, object>

A dictionary of portal properties. Keys and values of the dictionary are described in the table below.

The dictionary may contain the following values:

KeyTypeValue Description

"IsActivePortal"

bool

Specifies whether the portal is the active portal.

"IsSignedIn"

bool

Specifies whether the portal is signed in.

"OrganizationName"

string

The name of the organization.

"Name"

string

The name of the portal.

"PortalUrl"

Uri

The URL of the portal.

Remarks on error conditions

This method may throw an exception or return null if a parameter is invalid.

Example

Add the specified portal and print its properties.

// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;
var portalUri = new Uri("https://cadteam.esri.com/portal");  

// Add the portal
var addedPortalProperties = Esri.ArcGISForAutoCAD.Portal.Add(portalUri);

// Print the portal properties
foreach (var property in addedPortalProperties)
{
  doc.Editor.WriteMessage("\n{0}: {1}", property.Key, property.Value);
}

/* Example output 
IsActivePortal: False
IsSignedIn: False
OrganizationName:
Name: cadteam.esri.com 
PortalUrl: https://cadteam.esri.com/portal
*/

See also

Portal.SignInAsync—A .NET method that prompts the user to sign in to the specified portal.

esri_portal_add—An AutoLISP function that adds the specified portal to the list of managed portals.