VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "Procedure"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit

Private p_strName           As String
Private p_strModuleName     As String
Private p_strProcText       As String
Private p_strCommentText    As String
Private p_lngProcType       As Long
Private p_lngStartLine      As Long
Private p_lngScope          As Long
Private p_blnExported       As Boolean
Private p_blnAmbiguous      As Boolean
Private p_modModule         As CallTree.Module
Private p_colCallsFrom      As CallTree.CallsFrom
Private p_colCallsTo        As CallTree.CallsTo

Public Property Let Name(strName As String)
    If Len(p_strName) = 0 Then
        p_strName = strName
    End If
End Property

Public Property Get Name() As String
    Name = p_strName
End Property

Public Property Let ModuleName(strModuleName As String)
    If Len(p_strModuleName) = 0 Then
        p_strModuleName = strModuleName
    End If
End Property

Public Property Get ModuleName() As String
    ModuleName = p_strModuleName
End Property

Public Property Let ProcType(lngProcType As vbext_ProcKind)
    ' Write-once property.
    If p_lngProcType = -1 Then
        p_lngProcType = lngProcType
    End If
End Property

Public Property Get ProcType() As vbext_ProcKind
    ProcType = p_lngProcType
End Property

Public Property Let ProcText(strProcText As String)
    If Len(p_strProcText) = 0 Then
        p_strProcText = strProcText
    End If
End Property

Public Property Get ProcText() As String
    ProcText = p_strProcText
End Property

Public Property Let CommentText(strCommentText As String)
    If Len(p_strCommentText) = 0 Then
        p_strCommentText = strCommentText
    End If
End Property

Public Property Get CommentText() As String
    Dim lngLen As Long
    ' Truncate comment to fit in text field in database.
    lngLen = Len(p_strCommentText)

    If lngLen > 255 Then
        p_strCommentText = Left(p_strCommentText, lngLen - 255)
    End If
    CommentText = p_strCommentText
End Property

Private Sub Class_Initialize()
    ' Set ProcType to -1 in order to control write-once property.
    p_lngProcType = -1
    
    ' Create new CallsFrom collection.
    Set Me.CallsFrom = New CallTree.CallsFrom
    Set Me.CallsTo = New CallTree.CallsTo
    
    Me.Exported = False
End Sub

Public Property Let Exported(blnExported As Boolean)
    p_blnExported = blnExported
End Property

Public Property Get Exported() As Boolean
    Exported = p_blnExported
End Property

Public Property Set Parent(modModule As CallTree.Module)
    Set p_modModule = modModule
End Property

Public Property Get Parent() As CallTree.Module
    ' Return Module object that is this object's parent.
    Set Parent = p_modModule
End Property

Public Property Set CallsFrom(colCallsFrom As CallTree.CallsFrom)
    Set p_colCallsFrom = colCallsFrom
End Property

Public Property Get CallsFrom() As CallTree.CallsFrom
    Set CallsFrom = p_colCallsFrom
End Property

Public Property Set CallsTo(colCallsTo As CallTree.CallsTo)
    Set p_colCallsTo = colCallsTo
End Property

Public Property Get CallsTo() As CallTree.CallsTo
    Set CallsTo = p_colCallsTo
End Property

Public Property Let StartLine(lngStartLine As Long)
    p_lngStartLine = lngStartLine
End Property

Public Property Get StartLine() As Long
    StartLine = p_lngStartLine
End Property

Public Property Let Ambiguous(blnAmbiguous As Boolean)
    p_blnAmbiguous = blnAmbiguous
End Property

Public Property Get Ambiguous() As Boolean
    Ambiguous = p_blnAmbiguous
End Property

Public Property Let Scope(lngScope As opgScope)
    p_lngScope = lngScope
End Property

Public Property Get Scope() As opgScope
    Scope = p_lngScope
End Property

