ArcGIS Spatial Query Server Object Extension
ArcGIS_Spatial_Query_SOE_CSharp\SpatialQuerySOE.ArcCatalog_CSharp\SOEPropertyPage.cs
// Copyright 2009 ESRI
// 
// All rights reserved under the copyright laws of the United States
// and applicable international laws, treaties, and conventions.
// 
// You may freely redistribute and use this sample code, with or
// without modification, provided you include the original copyright
// notice and use restrictions.
// 
// See the use restrictions.
// 

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
        // Automatically register with ArcCatalog as a component, use categories.exe -> AGS Extension Parameter Pages to view 
        [System.Runtime.InteropServices.ComRegisterFunction()]
        static void RegisterFunction(String regKey)
        {
            Microsoft.Win32.Registry.ClassesRoot.CreateSubKey(regKey.Substring(18) + "\\Implemented Categories\\" + "{A585A585-B58B-4560-80E3-87A411859379}");
        }

        [System.Runtime.InteropServices.ComUnregisterFunction()]
        static void UnregisterFunction(String regKey)
        {
            Microsoft.Win32.Registry.ClassesRoot.DeleteSubKeyTree(regKey.Substring(18));
        }
        #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
    }
}