0

clsFileには2つの辞書がありますが、コンストラクターでは最初の辞書は常に作成されますが、2番目の辞書はNothingになります

辞書は同一です (Of Long、clsEmployee)。しかし、以前は2番目のもの(Long、clsCondition)と(Of String、clsCondoition)を作成しようとしましたが、役に立ちませんでした。クラス clsEmployee および clsCondition もコード内のオブジェクトです。

clsFile のコード:

Option Explicit On
Imports System.Data.OleDb
Imports System.Data.SqlClient
Imports System.Text.RegularExpressions


Public Class clsFile


'-- CLASS LOCAL VARIABLES DECLARATION
Private cnDB As SqlConnection
Private m_Number As String
Private m_Auditor As clsEmployee
Private m_User As clsEmployee
Private m_Reviewer As clsEmployee
Private m_FileTypeId As Long
Private m_ReviewStatusId As Long
Private m_ActionDTTM As Date
Private m_SelectDTTM As Date
Private m_ReviewDTTM As Date

Private m_inAudit As Boolean
Private m_ReviewersDict As Dictionary(Of Long, clsEmployee)
Private m_ConditionsDict As Dictionary(Of Long, clsEmployee)


**************************************PROPERTIES***********************************

  Public Property Reviewers() As Dictionary(Of Long, clsEmployee)
    Get
        Reviewers = m_ReviewersDict

    End Get

    Set(ByVal ReviewersDict As Dictionary(Of Long, clsEmployee))
        m_ReviewersDict = ReviewersDict
    End Set
End Property

Public Property Conditions() As Dictionary(Of Long, clsEmployee)
    Get
        Conditions = m_ConditionsDict

    End Get

    Set(ByVal ConditionsDict As Dictionary(Of Long, clsEmployee))
        m_ConditionsDict = Conditions
    End Set
End Property

* ** * ** * ** * ** * *コンストラクター* ** * ** * ** * ** * ** * ** *

 Public Sub New(*arguments provided*)
    number= strLoanNumber

    Me.Reviewer = New clsEmployee(RVWR_ID)
    Me.Reviewer.Dept.Id = RBW_Dept_ID
    Me.Auditor = New clsEmployee(AUD_ID)
    Me.User = New clsEmployee(USR_ID)

    Me.Reviewers = New Dictionary(Of Long, clsEmployee)
    Me.Conditions = New Dictionary(Of Long, clsEmployee) 

    cnDB = SQLcn


End Sub

` コードをステップ実行するとき - Me.Conditions = コンストラクターが実行された後でも何もありません。私はVB.net、VS2005を使用しています。

理由はありますか?ありがとう!

4

1 に答える 1

2

もちろん

Set(ByVal ConditionsDict As Dictionary(Of Long, clsEmployee))
        m_ConditionsDict = Conditions
End Set

する必要があります

Set(ByVal ConditionsDict As Dictionary(Of Long, clsEmployee))
        m_ConditionsDict = ConditionsDict
End Set

?

于 2013-01-23T20:54:19.050 に答える