Find Domain Reference
DomainFinder.cls

' Copyright 2008 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 use restrictions at <your ArcGIS install location>/developerkit/userestrictions.txt.
' 




Option Explicit

Implements ICommand

Private m_pApp As IGxApplication  'Application variable
Private m_pBitmap As IPictureDisp

Private Sub Class_Initialize()
9:   Set m_pBitmap = LoadResPicture(102, vbResBitmap)
End Sub

Private Sub Class_Terminate()
13:   Set m_pBitmap = Nothing
14:   Set m_pApp = Nothing
End Sub

Private Property Get ICommand_Bitmap() As esriSystem.OLE_HANDLE
18:   ICommand_Bitmap = m_pBitmap
End Property

Private Property Get ICommand_Caption() As String
22:   ICommand_Caption = "Find Domain References"
End Property

Private Property Get ICommand_Category() As String
26:   ICommand_Category = "Developer Samples"
End Property

Private Property Get ICommand_Checked() As Boolean

End Property

Private Property Get ICommand_Enabled() As Boolean
On Error GoTo ErrHand:
  Dim pGxObj As IGxObject, pGxDatabase As IGxDatabase2
36:   Set pGxObj = m_pApp.SelectedObject
37:   If pGxObj Is Nothing Then
38:     ICommand_Enabled = False
39:   Else
40:     If TypeOf pGxObj Is IGxDatabase Then
41:       Set pGxDatabase = pGxObj
42:       If pGxDatabase.Workspace.Type = esriFileSystemWorkspace Then
43:         ICommand_Enabled = False
44:       Else
45:         ICommand_Enabled = True
46:       End If
47:     Else
48:       ICommand_Enabled = False
49:     End If
50:   End If
  
  Exit Property
ErrHand:
54:   MsgBox "DomainFinderPrj_Enabled - " & Erl & " - " & Err.Description
End Property

Private Property Get ICommand_HelpContextID() As Long

End Property

Private Property Get ICommand_HelpFile() As String

End Property

Private Property Get ICommand_Message() As String
66:   ICommand_Message = "Find Domain References"
End Property

Private Property Get ICommand_Name() As String
70:   ICommand_Name = "DomainFinderPrj.DomainFinder"
End Property

Private Sub ICommand_OnClick()
On Error GoTo ErrHand:
  
76:   Set frmDomainFinder.m_GxApp = m_pApp
77:   frmDomainFinder.Show vbModal
  
  Exit Sub
ErrHand:
81:   MsgBox "OnClick - " & Err.Description
End Sub

Private Sub ICommand_OnCreate(ByVal hook As Object)
85:   Set m_pApp = hook
End Sub

Private Property Get ICommand_Tooltip() As String
89:   ICommand_Tooltip = "Find Domain Reference"
End Property