Newbie question: PTracker sample - ProjectSelect and ResourceSelect difference

Newbie question: PTracker sample - ProjectSelect and ResourceSelect difference

Old forum URL: forums.lhotka.net/forums/t/5854.aspx


vbbojan posted on Saturday, November 22, 2008

Hi to all.

This is probably non CSLA question, but I am really curious regarding
following:

In ProjectSelect and ResourceSelect classes (forms) we have
two similar methods AcceptValue and following two lines makes me
scratch my head few hours.

ProjectSelect line:
_projectID = CType(Me.ProjectListListBox.SelectedValue, Guid)

ResourceSelect line:
_resourceId = CType(Me.ResourceListListBox.SelectedValue, ResourceInfo).Id

I understand purpose and mechanics of these methods, but I do not understand following:

Why we can not convert

ProjectListListBox.SelectedValue to ProjectInfo type,

as we can convert

ResourceListListBox.SelectedValue to ResourceInfo.

I checked types and found that ProjectListListBox.SelectedValue is of Guid type and
ResourceListListBox.SelectedValue is of ResourceInfo type.

What makes these difference?
ResourceInfo, ProjectInfo are almost same classes, also
ResourceList and ProjectList are functionally same classes too.

Probably I am missing something very obvious. But I am stucked,
and I hate when I do not understand something.

I tried to find answer my self but with any success, probably because I do not
know where to start looking.

Thanks in advance and regards,

Bojan

Copyright (c) Marimer LLC