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

C#

 
QuestionRemoving All "List<*>" Items Though It Shouldn't ... ?? [SOLVED] Pin
Matt U.4-Mar-10 12:36
Matt U.4-Mar-10 12:36 
AnswerRe: Removing All "List" Items Though It Shouldn't ... ?? Pin
Luc Pattyn4-Mar-10 14:54
sitebuilderLuc Pattyn4-Mar-10 14:54 
GeneralRe: Removing All "List" Items Though It Shouldn't ... ?? Pin
Matt U.4-Mar-10 15:19
Matt U.4-Mar-10 15:19 
GeneralRe: Removing All "List" Items Though It Shouldn't ... ?? Pin
Luc Pattyn4-Mar-10 15:27
sitebuilderLuc Pattyn4-Mar-10 15:27 
GeneralRe: Removing All "List" Items Though It Shouldn't ... ?? Pin
Matt U.4-Mar-10 15:56
Matt U.4-Mar-10 15:56 
GeneralRe: Removing All "List" Items Though It Shouldn't ... ?? Pin
Luc Pattyn4-Mar-10 16:06
sitebuilderLuc Pattyn4-Mar-10 16:06 
GeneralRe: Removing All "List" Items Though It Shouldn't ... ?? Pin
Matt U.5-Mar-10 11:37
Matt U.5-Mar-10 11:37 
GeneralRe: Removing All "List" Items Though It Shouldn't ... ?? Pin
Luc Pattyn5-Mar-10 12:00
sitebuilderLuc Pattyn5-Mar-10 12:00 
Hi,

1.
string a="31232435342452";
string b=a;
string c=b;


looks like it has three strings; in reality only one piece of text is stored somewhere, and its memory address is stored inside the objects a, b, and c. So the memory penalty for copying objects is very limited.

2.
Passing objects around seems to be a difficult concept for the OO novice.
If there ever is only one list of artists, you might make it a public static member of class Artist, so it could get accessed by everyone from everywhere using Artist.artists
However that is not the best way, as sooner or later you'll want two or more lists of artists.

One normally does create the list once, then pass it on to other interested objects, either through a constructor parameter, a method parameter, or by setting a property to that effect.

3.
Dictionaries are fine; their one limitation is all key values must be unique and non-null. Which sounds fine for artists with a UniqueID field.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.

GeneralRe: Removing All "List" Items Though It Shouldn't ... ?? Pin
Matt U.5-Mar-10 12:04
Matt U.5-Mar-10 12:04 
QuestionChanging colors of an image Pin
Berlus4-Mar-10 9:34
Berlus4-Mar-10 9:34 
AnswerRe: Changing colors of an image Pin
Anubhava Dimri4-Mar-10 18:14
Anubhava Dimri4-Mar-10 18:14 
QuestionWinsock Library Recommendation? [modified] Pin
Richard Andrew x644-Mar-10 9:13
professionalRichard Andrew x644-Mar-10 9:13 
AnswerRe: Winsock Library Recommendation? Pin
snorkie4-Mar-10 10:22
professionalsnorkie4-Mar-10 10:22 
GeneralRe: Winsock Library Recommendation? Pin
Richard Andrew x644-Mar-10 10:29
professionalRichard Andrew x644-Mar-10 10:29 
AnswerRe: Winsock Library Recommendation? Pin
snorkie4-Mar-10 11:22
professionalsnorkie4-Mar-10 11:22 
GeneralRe: Winsock Library Recommendation? Pin
Richard Andrew x644-Mar-10 11:31
professionalRichard Andrew x644-Mar-10 11:31 
GeneralRe: Winsock Library Recommendation? Pin
snorkie4-Mar-10 16:30
professionalsnorkie4-Mar-10 16:30 
AnswerRe: Winsock Library Recommendation? Pin
Ennis Ray Lynch, Jr.4-Mar-10 11:41
Ennis Ray Lynch, Jr.4-Mar-10 11:41 
Questionfiles name of a directory in a lable one by one Pin
tanweer4-Mar-10 9:11
tanweer4-Mar-10 9:11 
AnswerRe: files name of a directory in a lable one by one Pin
AspDotNetDev4-Mar-10 9:35
protectorAspDotNetDev4-Mar-10 9:35 
Questionloop in service. Pin
noamtzu004-Mar-10 8:29
noamtzu004-Mar-10 8:29 
AnswerRe: loop in service. Pin
Dave Kreskowiak4-Mar-10 9:07
mveDave Kreskowiak4-Mar-10 9:07 
QuestionString Arrays Pin
Darrall4-Mar-10 5:01
Darrall4-Mar-10 5:01 
AnswerRe: String Arrays Pin
PIEBALDconsult4-Mar-10 5:08
mvePIEBALDconsult4-Mar-10 5:08 
GeneralRe: String Arrays Pin
Darrall4-Mar-10 5:53
Darrall4-Mar-10 5:53 

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.