Click here to Skip to main content
15,899,754 members
Home / Discussions / C#
   

C#

 
AnswerRe: When changing a variable inside an object the similar variables in other objects do change to the same value Pin
Luc Pattyn13-Aug-09 12:58
sitebuilderLuc Pattyn13-Aug-09 12:58 
AnswerRe: When changing a variable inside an object the similar variables in other objects do change to the same value Pin
Scott Dorman13-Aug-09 13:55
professionalScott Dorman13-Aug-09 13:55 
GeneralRe: When changing a variable inside an object the similar variables in other objects do change to the same value Pin
suresh_kumar_s13-Aug-09 19:36
suresh_kumar_s13-Aug-09 19:36 
QuestionQuestions about inheritance Pin
mtbikerj13-Aug-09 12:30
mtbikerj13-Aug-09 12:30 
AnswerRe: Questions about inheritance Pin
Scott Dorman13-Aug-09 13:58
professionalScott Dorman13-Aug-09 13:58 
AnswerRe: Questions about inheritance Pin
mtbikerj13-Aug-09 14:04
mtbikerj13-Aug-09 14:04 
GeneralRe: Questions about inheritance Pin
mtbikerj13-Aug-09 14:08
mtbikerj13-Aug-09 14:08 
GeneralRe: Questions about inheritance Pin
Scott Dorman13-Aug-09 14:39
professionalScott Dorman13-Aug-09 14:39 
Ok...that makes a bit more sense. There are several possibilities to accomplish this.

One option is to derive concrete collections for your course list and assignment list (CourseList : List<Course> and AssignmentList : List<StudentAssignment>) and in those concrete collections override the Add/Insert/etc. methods to raise events that your other classes can then respond to and ensure that they update their appropriate fields.

A similar option would be to derive from BindingList<T>, where T is Course and StudentAssignment, and have your other classes respond to the ListChanged event.

Yet another option is to simply use List<T> like you have and either provide your own methods to do the Add/Insert/etc. and when you take an action on one list be sure that you take the appropriate action on the other list at the same time.

There are probably other ways to achieve this, but these are the ones I can think of off-hand. Each has benefits and drawbacks and one is not necessarily any better than another.

Scott Dorman
Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA

[Blog][Articles][Forum Guidelines]
Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai

GeneralRe: Questions about inheritance Pin
mtbikerj27-Aug-09 7:22
mtbikerj27-Aug-09 7:22 
AnswerRe: Questions about inheritance Pin
PIEBALDconsult13-Aug-09 14:18
mvePIEBALDconsult13-Aug-09 14:18 
QuestionDatagrid print location help Pin
spankyleo12313-Aug-09 9:28
spankyleo12313-Aug-09 9:28 
AnswerRe: Datagrid print location help [REPOST attempt to bump] Pin
Henry Minute13-Aug-09 9:45
Henry Minute13-Aug-09 9:45 
GeneralRe: Datagrid print location help [REPOST attempt to bump] Pin
spankyleo12313-Aug-09 10:10
spankyleo12313-Aug-09 10:10 
GeneralRe: Datagrid print location help [REPOST attempt to bump] Pin
0x3c013-Aug-09 10:13
0x3c013-Aug-09 10:13 
GeneralRe: Datagrid print location help [REPOST attempt to bump] Pin
spankyleo12313-Aug-09 10:18
spankyleo12313-Aug-09 10:18 
QuestionI am having issues with pictures and sql server can someone help me understand what is going on. [modified] Pin
JollyMansArt13-Aug-09 6:36
JollyMansArt13-Aug-09 6:36 
AnswerRe: I am having issues with pictures and sql server can someone help me understand what is going on. Pin
Luc Pattyn13-Aug-09 6:49
sitebuilderLuc Pattyn13-Aug-09 6:49 
GeneralRe: I am having issues with pictures and sql server can someone help me understand what is going on. Pin
JollyMansArt13-Aug-09 6:55
JollyMansArt13-Aug-09 6:55 
GeneralRe: I am having issues with pictures and sql server can someone help me understand what is going on. Pin
Luc Pattyn13-Aug-09 7:05
sitebuilderLuc Pattyn13-Aug-09 7:05 
GeneralRe: I am having issues with pictures and sql server can someone help me understand what is going on. [modified] Pin
JollyMansArt13-Aug-09 7:27
JollyMansArt13-Aug-09 7:27 
AnswerRe: I am having issues with pictures and sql server can someone help me understand what is going on. Pin
Henry Minute13-Aug-09 7:20
Henry Minute13-Aug-09 7:20 
GeneralRe: I am having issues with pictures and sql server can someone help me understand what is going on. Pin
JollyMansArt13-Aug-09 8:29
JollyMansArt13-Aug-09 8:29 
GeneralRe: I am having issues with pictures and sql server can someone help me understand what is going on. Pin
Henry Minute13-Aug-09 8:38
Henry Minute13-Aug-09 8:38 
AnswerRe: I am having issues with pictures and sql server can someone help me understand what is going on. Pin
JollyMansArt13-Aug-09 7:44
JollyMansArt13-Aug-09 7:44 
GeneralRe: I am having issues with pictures and sql server can someone help me understand what is going on. Pin
Luc Pattyn13-Aug-09 8:34
sitebuilderLuc Pattyn13-Aug-09 8:34 

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.