ArcObjects Library Reference  

SOEPropertyPage

About the Server spatial query server object extension Sample

[C#]

SOEPropertyPage.cs

using System;
using System.Collections.Generic;
using System.Text;

namespace SOEUtilities
{
    /// <summary>
    /// Class to simplify implementation of a custom SOE property page for ArcCatalog.  Abstracts away COM registration and members that
    /// are unnecessary in a custom property page implemenation.
    /// </summary>
    [System.Runtime.InteropServices.GuidAttribute("5514323A-02F8-48d3-B7BA-5BF07AD36F49")]
    public abstract class SOEPropertyPage : ESRI.ArcGIS.Framework.IComPropertyPage, ESRI.ArcGIS.CatalogUI.IAGSSOEParameterPage
    {
    #region Component Category Registration
        [System.Runtime.InteropServices.ComRegisterFunction()]
        [System.Runtime.InteropServices.ComVisible(false)]
        static void RegisterFunction(Type registerType)
        {
            string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID);
            ESRI.ArcGIS.ADF.CATIDs.AGSSOEParameterPages.Register(regKey);
        }

        [System.Runtime.InteropServices.ComUnregisterFunction()]
        [System.Runtime.InteropServices.ComVisible(false)]
        static void UnregisterFunction(Type registerType)
        {
            string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID);
            ESRI.ArcGIS.ADF.CATIDs.AGSSOEParameterPages.Unregister(regKey);
        }        
        
        #endregion

		#region IComPropertyPage Members

        #region Abstract (Must Implement) Members - PageSite, Activate, Show, Hide

        public abstract ESRI.ArcGIS.Framework.IComPropertyPageSite PageSite { set; }

        public abstract int Activate();

        public abstract void Show();

        public abstract void Hide();

        #endregion

        #region Virtual (Overrideable) Methods - Height, Deactivate

        public virtual int Height { get { return 0; } }

        public virtual void Deactivate() { }

        #endregion

        #region Non-Overridable Members - Not Invoked by ArcCatalog

        public bool IsPageDirty { get { return false; } }

        public string Title
        {
            get { return null; }
            set { }
        }

        public int Priority
        {
            get { return 0; }
            set { }
        }

        public string HelpFile { get { return null; } }

        public int Width { get { return 0; } }



        public void Apply() { }

        public void Cancel() { }

        public int get_HelpContextID(int controlID) { return 0; }

        public void SetObjects(ESRI.ArcGIS.esriSystem.ISet objects) { }

        public bool Applies(ESRI.ArcGIS.esriSystem.ISet objects) { return false; }

        #endregion

		#endregion
	
		#region IAGSSOEParameterPage Members - All must be implemented
           
		public abstract ESRI.ArcGIS.esriSystem.IPropertySet ServerObjectProperties { get; set; }

		public abstract ESRI.ArcGIS.esriSystem.IPropertySet ExtensionProperties { get; set; }

		public abstract string ServerObjectExtensionType { get; }

		public abstract string ServerObjectType { get; }

		#endregion
    }
}

[Visual Basic .NET]

SOEPropertyPage.vb

Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.Text

Namespace SOEUtilities
	''' <summary>
	''' Class to simplify implementation of a custom SOE property page for ArcCatalog.  Abstracts away COM registration and members that
	''' are unnecessary in a custom property page implemenation.
	''' </summary>
  <System.Runtime.InteropServices.Guid("B1F2FD28-04AB-4653-8C5F-7C65B355AC1D")> _
 Public MustInherit Class SOEPropertyPage
    Implements ESRI.ArcGIS.Framework.IComPropertyPage, ESRI.ArcGIS.CatalogUI.IAGSSOEParameterPage

#Region "Component Category Registration"
    <System.Runtime.InteropServices.ComRegisterFunction(), System.Runtime.InteropServices.ComVisible(False)> _
    Private Shared Sub RegisterFunction(ByVal registerType As Type)
      Dim regKey As String = String.Format("HKEY_CLASSES_ROOT\CLSID\{{{0}}}", registerType.GUID)
      ESRI.ArcGIS.ADF.CATIDs.AGSSOEParameterPages.Register(regKey)
    End Sub

    <System.Runtime.InteropServices.ComUnregisterFunction(), System.Runtime.InteropServices.ComVisible(False)> _
    Private Shared Sub UnregisterFunction(ByVal registerType As Type)
      Dim regKey As String = String.Format("HKEY_CLASSES_ROOT\CLSID\{{{0}}}", registerType.GUID)
      ESRI.ArcGIS.ADF.CATIDs.AGSSOEParameterPages.Unregister(regKey)
    End Sub

#End Region

#Region "IComPropertyPage Members"

#Region "Abstract (Must Implement) Members - PageSite, Activate, Show, Hide"

    Public MustOverride WriteOnly Property PageSite() As ESRI.ArcGIS.Framework.IComPropertyPageSite Implements ESRI.ArcGIS.Framework.IComPropertyPage.PageSite

    Public MustOverride Function Activate() As Integer Implements ESRI.ArcGIS.Framework.IComPropertyPage.Activate

    Public MustOverride Sub Show() Implements ESRI.ArcGIS.Framework.IComPropertyPage.Show

    Public MustOverride Sub Hide() Implements ESRI.ArcGIS.Framework.IComPropertyPage.Hide
#End Region
   
#Region "Virtual (Overrideable) Methods - Height, Deactivate"

    Public Overridable ReadOnly Property Height() As Integer Implements ESRI.ArcGIS.Framework.IComPropertyPage.Height
      Get
        Return 0
      End Get
    End Property

    Public Overridable Sub Deactivate() Implements ESRI.ArcGIS.Framework.IComPropertyPage.Deactivate
    End Sub

#End Region

#Region "Non-Overridable Members - Not Invoked by ArcCatalog"

    Public ReadOnly Property IsPageDirty() As Boolean Implements ESRI.ArcGIS.Framework.IComPropertyPage.IsPageDirty
      Get
        Return False
      End Get
    End Property

    Public Property Title() As String Implements ESRI.ArcGIS.Framework.IComPropertyPage.Title
      Get
        Return Nothing
      End Get
      Set(ByVal value As String)
      End Set
    End Property

    Public Property Priority() As Integer Implements ESRI.ArcGIS.Framework.IComPropertyPage.Priority
      Get
        Return 0
      End Get
      Set(ByVal value As Integer)
      End Set
    End Property

    Public ReadOnly Property HelpFile() As String Implements ESRI.ArcGIS.Framework.IComPropertyPage.HelpFile
      Get
        Return Nothing
      End Get
    End Property

    Public ReadOnly Property Width() As Integer Implements ESRI.ArcGIS.Framework.IComPropertyPage.Width
      Get
        Return 0
      End Get
    End Property
    Public Sub Apply() Implements ESRI.ArcGIS.Framework.IComPropertyPage.Apply
    End Sub

    Public Sub Cancel() Implements ESRI.ArcGIS.Framework.IComPropertyPage.Cancel
    End Sub
    Public ReadOnly Property HelpContextID(ByVal controlID As Integer) As Integer Implements ESRI.ArcGIS.Framework.IComPropertyPage.HelpContextID
      Get
        Return 0
      End Get
    End Property
    'Public Function get_HelpContextID(ByVal controlID As Integer) As Integer Implements ESRI.ArcGIS.Framework.IComPropertyPage
    '  Return 0
    'End Function
    Public Sub SetObjects(ByVal objects As ESRI.ArcGIS.esriSystem.ISet) Implements ESRI.ArcGIS.Framework.IComPropertyPage.SetObjects
    End Sub

    Public Function Applies(ByVal objects As ESRI.ArcGIS.esriSystem.ISet) As Boolean Implements ESRI.ArcGIS.Framework.IComPropertyPage.Applies
      Return False
    End Function

#End Region

#End Region

#Region "IAGSSOEParameterPage Members - All must be implemented"

    Public MustOverride Property ServerObjectProperties() As ESRI.ArcGIS.esriSystem.IPropertySet Implements ESRI.ArcGIS.CatalogUI.IAGSSOEParameterPage.ServerObjectProperties

    Public MustOverride Property ExtensionProperties() As ESRI.ArcGIS.esriSystem.IPropertySet Implements ESRI.ArcGIS.CatalogUI.IAGSSOEParameterPage.ExtensionProperties

    Public MustOverride ReadOnly Property ServerObjectExtensionType() As String Implements ESRI.ArcGIS.CatalogUI.IAGSSOEParameterPage.ServerObjectExtensionType

    Public MustOverride ReadOnly Property ServerObjectType() As String Implements ESRI.ArcGIS.CatalogUI.IAGSSOEParameterPage.ServerObjectType

#End Region


  End Class
End Namespace