![](dotnetdiagramimages/image920.png)
public sealed class ServerConnectionProjectItem : ArcGIS.Desktop.Internal.Catalog.ProjectItemInfoCrawl, ArcGIS.Desktop.Core.IMetadata, ArcGIS.Desktop.Core.IProjectItem, ArcGIS.Desktop.Core.IProjectMultiItem, System.ComponentModel.INotifyPropertyChanged
Public NotInheritable Class ServerConnectionProjectItem Inherits ArcGIS.Desktop.Internal.Catalog.ProjectItemInfoCrawl Implements ArcGIS.Desktop.Core.IMetadata, ArcGIS.Desktop.Core.IProjectItem, ArcGIS.Desktop.Core.IProjectMultiItem, System.ComponentModel.INotifyPropertyChanged
A server connection project item is a connection to an ArcGIS Server site, an OGC WMS service, or an OGC WMTS service that has been added to the current project. New server connections cannot be created, but an existing .ags, .wms, or .wmts file containing connection information can be added to a project.
/// Get all the server connections in a project
IEnumerable<ServerConnectionProjectItem> projectServers = Project.Current.GetItems<ServerConnectionProjectItem>();
IEnumerable<ServerConnectionProjectItem> newServerConnections = null; newServerConnections = project.GetItems<ServerConnectionProjectItem>(); foreach (var serverItem in newServerConnections) { //Do Something with the server connection. }
ServerConnectionProjectItem serverProjItem = Project.Current.GetItems<ServerConnectionProjectItem>().FirstOrDefault(item => item.Name.Equals("myServer"));
System.Object
ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase
ArcGIS.Desktop.Core.Item
ArcGIS.Desktop.Catalog.ServerConnectionProjectItem
Target Platforms: Windows 11, Windows 10, Windows 8.1