From: Richard B. <rb...@us...> - 2004-12-17 00:29:32
|
Update of /cvsroot/jcframework/FrameworkMapper/AFMappingClasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18233/AFMappingClasses Modified Files: CAssociationEntry.vb Log Message: Fixed an issue with drag and drop for associations Index: CAssociationEntry.vb =================================================================== RCS file: /cvsroot/jcframework/FrameworkMapper/AFMappingClasses/CAssociationEntry.vb,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CAssociationEntry.vb 10 Dec 2004 04:31:13 -0000 1.1 +++ CAssociationEntry.vb 17 Dec 2004 00:29:17 -0000 1.2 @@ -101,30 +101,42 @@ #Region "IDataErrorInfo" <Browsable(False)> Public ReadOnly Property [Error]() As String Implements System.ComponentModel.IDataErrorInfo.Error Get - If _fromAttribute Is Nothing Then - Return "Missing FromAttribute" - End If - If _toAttribute Is Nothing Then - Return "Missing ToAttribute" - End If - If _parentAssociation Is Nothing Then - Return "Missing Association" - End If + 'If _fromAttribute Is Nothing Then + ' Return "Missing FromAttribute" + 'End If + 'If _toAttribute Is Nothing Then + ' Return "Missing ToAttribute" + 'End If + 'If _parentAssociation Is Nothing Then + ' Return "Missing Association" + 'End If Dim found As Integer = 0 - For Each ae As CAssociationEntry In _parentAssociation.Entries - If _fromAttribute.Name = ae.fromAttribute.Name Then - found += 1 - End If - Next + Try + For Each ae As CAssociationEntry In _parentAssociation.Entries + If _fromAttribute.Name = ae.fromAttribute.Name Then + found += 1 + End If + Next + Catch + End Try + If Not _fromAttribute Is Nothing And found = 0 Then + Return "From Attribute is not in the From Class" + End If If found > 1 Then Return "From Attribute appears more than once" End If found = 0 - For Each ae As CAssociationEntry In _parentAssociation.Entries - If _toAttribute.Name = ae.toAttribute.Name Then - found += 1 - End If - Next + Try + For Each ae As CAssociationEntry In _parentAssociation.Entries + If _toAttribute.Name = ae.toAttribute.Name Then + found += 1 + End If + Next + Catch + End Try + If Not _toAttribute Is Nothing And found = 0 Then + Return "To Attribute is not in the ToClass" + End If If found > 1 Then Return "To Attribute appears more than once" End If |