Click here to Skip to main content
15,923,281 members
Home / Discussions / C#
   

C#

 
AnswerRe: Exiting app in Catch Pin
Stefan Troschuetz11-Aug-06 10:47
Stefan Troschuetz11-Aug-06 10:47 
GeneralRe: Exiting app in Catch Pin
Stick^11-Aug-06 10:58
Stick^11-Aug-06 10:58 
GeneralRe: Exiting app in Catch Pin
Ennis Ray Lynch, Jr.11-Aug-06 11:08
Ennis Ray Lynch, Jr.11-Aug-06 11:08 
GeneralRe: Exiting app in Catch Pin
Stefan Troschuetz11-Aug-06 20:40
Stefan Troschuetz11-Aug-06 20:40 
GeneralRe: Exiting app in Catch Pin
Stick^11-Aug-06 23:26
Stick^11-Aug-06 23:26 
AnswerRe: Exiting app in Catch Pin
Glen Harvy11-Aug-06 10:54
Glen Harvy11-Aug-06 10:54 
GeneralRe: Exiting app in Catch Pin
Stick^11-Aug-06 10:59
Stick^11-Aug-06 10:59 
GeneralWrong forum by accident...please ignore! Pin
leckey11-Aug-06 9:51
leckey11-Aug-06 9:51 
Okay, this is pretty complicated so let me see if I can try to explain my problem.

First I have an enumeration:
Enum BracingMemberTypes As Integer<br />
        FirstItem = 0<br />
        Diagonal = 0<br />
        Horizontal = 1<br />
        Internal = 2<br />
        SubDiagonal = 3<br />
        SubHorizontal = 4<br />
        SubInternal = 5<br />
        TopDiagonal = 6<br />
        BottomDiagonal = 7<br />
        TopSubHorizontal = 8<br />
        BottomSubHorizontal = 9<br />
        LastItem = 9<br />
    End Enum


I have a file called clsSection with this declaration:
Protected m_BracingMembers As New clsBracingMemberDictionary
In the same file I also have some properties. I'll only show a couple:

ReadOnly Property Diag() As clsBracingMember<br />
        Get<br />
<br />
            '10-Aug-2006 Changed to use the dictionary LLS (1 of 10)<br />
            If m_BracingMembers(BracingMemberTypes.Diagonal) Is Nothing Then<br />
                m_BracingMembers(BracingMemberTypes.Diagonal) = New clsBracingMember(Me, BracingMemberTypes.Diagonal)<br />
<br />
            End If<br />
            Return m_BracingMembers(BracingMemberTypes.Diagonal)<br />
        End Get<br />
    End Property<br />
<br />
    ReadOnly Property TopDiag() As clsBracingMember<br />
        Get<br />
            '10-Aug-2006 Changed to use the dictionary LLS (2 of 10)<br />
            If m_BracingMembers(BracingMemberTypes.TopDiagonal) Is Nothing Then<br />
                m_BracingMembers(BracingMemberTypes.TopDiagonal) = New clsBracingMember(Me, BracingMemberTypes.TopDiagonal)<br />
            End If<br />
            Return m_BracingMembers(BracingMemberTypes.TopDiagonal)<br />
        End Get<br />
    End Property


I need to create a copy function so I can have two objects and compare them. This is what I have thus far:
For i As Integer = BracingMemberTypes.FirstItem To BracingMemberTypes.LastItem
If Not .BracingMembers(i) Is Nothing Then
m_BracingMembers(i).Copy(.BracingMembers(i))

End If

Next

Basically what I am doing is looking up the bracing information. There are different bracing configurations such as X. The problem is that in the X bracing, some of the types of the enumeration do not exist. It has a diagonal (0), horizontal (1) but once it gets to internal (2) I get the null reference object error which makes sense.

This is not my code, my boss wanted me to change the code using a dictionary object.

Any ideas how to fix this short of using if statements based on the bracing configuration?

Is there a real benefit to using dictionaries? (VB programming dictionaries before the jokes come in. Smile | :) )


-- modified at 17:48 Friday 11th August, 2006
AnswerRe: Null reference object error/enumeration problem Pin
Judah Gabriel Himango11-Aug-06 10:00
sponsorJudah Gabriel Himango11-Aug-06 10:00 
GeneralRe: Null reference object error/enumeration problem Pin
leckey11-Aug-06 11:46
leckey11-Aug-06 11:46 
GeneralDatagridViewComboCell Issues. Pin
ssp2011-Aug-06 9:49
ssp2011-Aug-06 9:49 
QuestionInterop.Excel x the memory could not be read Pin
ARLUNSQUI11-Aug-06 8:53
ARLUNSQUI11-Aug-06 8:53 
QuestionHow can a control always be on top Pin
sas949111-Aug-06 7:57
sas949111-Aug-06 7:57 
AnswerRe: How can a control always be on top Pin
Ryomin11-Aug-06 8:25
professionalRyomin11-Aug-06 8:25 
GeneralRe: How can a control always be on top Pin
sas949111-Aug-06 9:14
sas949111-Aug-06 9:14 
GeneralRe: How can a control always be on top [modified] Pin
Ryomin11-Aug-06 9:20
professionalRyomin11-Aug-06 9:20 
GeneralRe: How can a control always be on top Pin
sas949111-Aug-06 9:27
sas949111-Aug-06 9:27 
GeneralRe: How can a control always be on top Pin
Ennis Ray Lynch, Jr.11-Aug-06 9:41
Ennis Ray Lynch, Jr.11-Aug-06 9:41 
Questionaccess database on a server via a windows application? Pin
keroed_edmond11-Aug-06 4:20
keroed_edmond11-Aug-06 4:20 
AnswerRe: access database on a server via a windows application? Pin
Not Active11-Aug-06 4:32
mentorNot Active11-Aug-06 4:32 
GeneralRe: access database on a server via a windows application? Pin
Guffa11-Aug-06 8:06
Guffa11-Aug-06 8:06 
GeneralRe: access database on a server via a windows application? Pin
Not Active11-Aug-06 8:30
mentorNot Active11-Aug-06 8:30 
GeneralRe: access database on a server via a windows application? Pin
Guffa11-Aug-06 9:48
Guffa11-Aug-06 9:48 
AnswerRe: access database on a server via a windows application? Pin
Paul Conrad11-Aug-06 4:53
professionalPaul Conrad11-Aug-06 4:53 
GeneralRe: access database on a server via a windows application? Pin
Guffa11-Aug-06 8:11
Guffa11-Aug-06 8:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.