About the Server spatial query server object extension Sample
[C#]
PropertyPage.cs
namespace SpatialQuerySOE.ArcCatalog
{
[System.Runtime.InteropServices.Guid("2EAD4A98-BB8C-4b88-A323-48F53653ACBF")]
public class PropertyPage : SOEUtilities.SOEPropertyPage
{
#region Member Variables
private ESRI.ArcGIS.esriSystem.IPropertySet m_extensionProperties;
private ESRI.ArcGIS.esriSystem.IPropertySet m_serverObjectProperties;
private string m_extensionType;
private string m_serverObjectType;
#endregion
private PropertyForm propertyPage;
public PropertyPage()
{
propertyPage = new PropertyForm();
m_serverObjectType = "MapServer";
// Must be the same name used when registering the SOE
m_extensionType = "SpatialQuerySOE";
}
~PropertyPage()
{
propertyPage.Dispose();
propertyPage = null;
}
#region SOEPropertyPage Members
#region Inherited from IComPropertyPage - Activate, Show, Hide, PageSite
/// <summary>
/// PageSite permits accessed to the PageChanged method, which, when fired, enables the Apply button on the property page
/// </summary>
public override ESRI.ArcGIS.Framework.IComPropertyPageSite PageSite
{
set { propertyPage.PageSite = value; }
}
/// <summary>
/// Displays the form defining the property page's UI
/// </summary>
public override void Show()
{
propertyPage.Show();
}
/// <summary>
/// Fired when the property page is activated
/// </summary>
/// <returns>the handle of the form containing the property page's UI</returns>
public override int Activate()
{
return propertyPage.getHWnd();
}
/// <summary>
/// Hides the form containing the property page's UI
/// </summary>
public override void Hide()
{
propertyPage.Hide();
}
public override void Deactivate()
{
base.Deactivate();
}
#endregion
#region Inherited from IAGSSOEParameterPage - ServerObjectProperties, ExtensionProperties, ServerObjectExtensionType, ServerObjectType
/// <summary>
/// Properties of the server object on which the extension is configured.
/// </summary>
public override ESRI.ArcGIS.esriSystem.IPropertySet ServerObjectProperties
{
get { return m_serverObjectProperties; }
set
{
// Pass the location of the map document underlying the current server object to the property form
m_serverObjectProperties = value;
propertyPage.SetMap(m_serverObjectProperties.GetProperty("FilePath").ToString());
}
}
/// <summary>
/// Properties of the extension for the current server object.
/// </summary>
public override ESRI.ArcGIS.esriSystem.IPropertySet ExtensionProperties
{
get
{
// Checking the SOE in ArcCatalog adds the following properties into the
// map server cfg file -or- existing properties are updated
m_extensionProperties.SetProperty("LayerName", propertyPage.Layer);
m_extensionProperties.SetProperty("FieldName", propertyPage.Field);
return m_extensionProperties;
}
set
{
// Pass the extension properties to the property form
m_extensionProperties = value;
propertyPage.Layer = m_extensionProperties.GetProperty("LayerName").ToString();
propertyPage.Field = m_extensionProperties.GetProperty("FieldName").ToString();
}
}
/// <summary>
/// The type of the SOE. This must match the name of the SOE as defined when it is
/// registered with the SOM.
/// </summary>
public override string ServerObjectExtensionType { get { return m_extensionType; } }
/// <summary>
/// The type of server object that the SOE extends. This SOE extends MapServer server objects.
/// </summary>
public override string ServerObjectType { get { return m_serverObjectType; } }
#endregion
#endregion
}
}
[Visual Basic .NET]
PropertyPage.vb
Imports Microsoft.VisualBasic
Imports System
Namespace SpatialQuerySOE.ArcCatalog_VBNet
<System.Runtime.InteropServices.Guid("2378B5DC-BF24-498c-B0A2-6E8C43628EA3")> _
Public Class PropertyPage
Inherits SOEUtilities.SOEPropertyPage
#Region "Member Variables"
Private m_extensionProperties As ESRI.ArcGIS.esriSystem.IPropertySet
Private m_serverObjectProperties As ESRI.ArcGIS.esriSystem.IPropertySet
Private m_extensionType As String
Private m_serverObjectType As String
#End Region
Private property_Page As PropertyForm
Public Sub New()
property_Page = New PropertyForm()
m_serverObjectType = "MapServer"
' Must be the same name used when registering the SOE
m_extensionType = "SpatialQuerySOE_VBNet"
End Sub
Protected Overrides Sub Finalize()
property_Page.Dispose()
property_Page = Nothing
End Sub
#Region "SOEPropertyPage Members"
#Region "Inherited from IComPropertyPage - Activate, Show, Hide, PageSite"
''' <summary>
''' PageSite permits accessed to the PageChanged method, which, when fired, enables the Apply button on the property page
''' </summary>
Public Overrides WriteOnly Property PageSite() As ESRI.ArcGIS.Framework.IComPropertyPageSite
Set(ByVal value As ESRI.ArcGIS.Framework.IComPropertyPageSite)
property_Page.PageSite = value
End Set
End Property
''' <summary>
''' Displays the form defining the property page's UI
''' </summary>
Public Overrides Sub Show()
property_Page.Show()
End Sub
''' <summary>
''' Fired when the property page is activated
''' </summary>
''' <returns>the handle of the form containing the property page's UI</returns>
Public Overrides Function Activate() As Integer
Return property_Page.getHWnd()
End Function
''' <summary>
''' Hides the form containing the property page's UI
''' </summary>
Public Overrides Sub Hide()
property_Page.Hide()
End Sub
Public Overrides Sub Deactivate()
MyBase.Deactivate()
End Sub
#End Region
#Region "Inherited from IAGSSOEParameterPage - ServerObjectProperties, ExtensionProperties, ServerObjectExtensionType, ServerObjectType"
''' <summary>
''' Properties of the server object on which the extension is configured.
''' </summary>
Public Overrides Property ServerObjectProperties() As ESRI.ArcGIS.esriSystem.IPropertySet
Get
Return m_serverObjectProperties
End Get
Set(ByVal value As ESRI.ArcGIS.esriSystem.IPropertySet)
' Pass the location of the map document underlying the current server object to the property form
m_serverObjectProperties = value
property_Page.SetMap(m_serverObjectProperties.GetProperty("FilePath").ToString())
End Set
End Property
''' <summary>
''' Properties of the extension for the current server object.
''' </summary>
Public Overrides Property ExtensionProperties() As ESRI.ArcGIS.esriSystem.IPropertySet
Get
' Checking the SOE in ArcCatalog adds the following properties into the
' map server cfg file -or- existing properties are updated
m_extensionProperties.SetProperty("LayerName", property_Page.Layer)
m_extensionProperties.SetProperty("FieldName", property_Page.Field)
Return m_extensionProperties
End Get
Set(ByVal value As ESRI.ArcGIS.esriSystem.IPropertySet)
' Pass the extension properties to the property form
m_extensionProperties = value
property_Page.Layer = m_extensionProperties.GetProperty("LayerName").ToString()
property_Page.Field = m_extensionProperties.GetProperty("FieldName").ToString()
End Set
End Property
''' <summary>
''' The type of the SOE. This must match the name of the SOE as defined when it is
''' registered with the SOM.
''' </summary>
Public Overrides ReadOnly Property ServerObjectExtensionType() As String
Get
Return m_extensionType
End Get
End Property
''' <summary>
''' The type of server object that the SOE extends. This SOE extends MapServer server objects.
''' </summary>
Public Overrides ReadOnly Property ServerObjectType() As String
Get
Return m_serverObjectType
End Get
End Property
#End Region
#End Region
End Class
End Namespace