ServerConnectionProjectItem Class
Get ServerConnectionProjectItems
/// Get all the server connections in a project
IEnumerable<ServerConnectionProjectItem> projectServers = Project.Current.GetItems<ServerConnectionProjectItem>();
Get all "ServerConnectionProjectItems"
IEnumerable<ServerConnectionProjectItem> newServerConnections = null;
newServerConnections = project.GetItems<ServerConnectionProjectItem>();
foreach (var serverItem in newServerConnections)
{
//Do Something with the server connection.
}
Get a specific "ServerConnectionProjectItem"
ServerConnectionProjectItem serverProjItem = Project.Current.GetItems<ServerConnectionProjectItem>().FirstOrDefault(item => item.Name.Equals("myServer"));
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3.0 or higher.