Click here to Skip to main content
15,891,423 members
Home / Discussions / C#
   

C#

 
AnswerRe: Generics and the == operator. Pin
dojohansen17-Oct-09 22:44
dojohansen17-Oct-09 22:44 
GeneralRe: Generics and the == operator. Pin
N a v a n e e t h17-Oct-09 23:18
N a v a n e e t h17-Oct-09 23:18 
GeneralRe: Generics and the == operator. Pin
dojohansen17-Oct-09 23:59
dojohansen17-Oct-09 23:59 
GeneralRe: Generics and the == operator. Pin
dojohansen18-Oct-09 0:00
dojohansen18-Oct-09 0:00 
QuestionDeleting objects from a collection Pin
Trollslayer17-Oct-09 10:34
mentorTrollslayer17-Oct-09 10:34 
AnswerRe: Deleting objects from a collection Pin
Not Active17-Oct-09 12:01
mentorNot Active17-Oct-09 12:01 
GeneralRe: Deleting objects from a collection Pin
Trollslayer17-Oct-09 12:19
mentorTrollslayer17-Oct-09 12:19 
AnswerRe: Deleting objects from a collection Pin
Luc Pattyn17-Oct-09 12:11
sitebuilderLuc Pattyn17-Oct-09 12:11 
As Mark said, plus some comments:

1.
if MyClass has a public Dispose() method (e.g. when it is a Form, a Font, a Pen, ...), you should call it on the object you no longer need, like so:
MyClass toBeDisposed=myAL[0];
myAL[0]=new MyClass();
toBeDisposed.Dispose();    // <<<<<<<<<<<<<<<<<<<


2.
why do you still use ArrayList? it is better to use a generic List (available since .NET 2.0), as that:
- provides type safety (it only accepts what you declare it should accept);
- is faster, it doesn't need casting when using its elements.

Smile | :)

Luc Pattyn

I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages

Local announcement (Antwerp region): Lange Wapper? Neen!


GeneralRe: Deleting objects from a collection Pin
Trollslayer17-Oct-09 12:27
mentorTrollslayer17-Oct-09 12:27 
GeneralRe: Deleting objects from a collection Pin
CaptainSeeSharp17-Oct-09 13:16
CaptainSeeSharp17-Oct-09 13:16 
GeneralRe: Deleting objects from a collection Pin
Luc Pattyn17-Oct-09 13:26
sitebuilderLuc Pattyn17-Oct-09 13:26 
AnswerRe: Deleting objects from a collection Pin
DaveyM6917-Oct-09 12:51
professionalDaveyM6917-Oct-09 12:51 
GeneralRe: Deleting objects from a collection Pin
Trollslayer17-Oct-09 12:55
mentorTrollslayer17-Oct-09 12:55 
GeneralRe: Deleting objects from a collection Pin
DaveyM6917-Oct-09 13:10
professionalDaveyM6917-Oct-09 13:10 
GeneralRe: Deleting objects from a collection Pin
Trollslayer17-Oct-09 13:16
mentorTrollslayer17-Oct-09 13:16 
GeneralRe: Deleting objects from a collection Pin
Luc Pattyn17-Oct-09 13:33
sitebuilderLuc Pattyn17-Oct-09 13:33 
Answer[Added informatio] Deleting objects from a collection Pin
Trollslayer17-Oct-09 13:05
mentorTrollslayer17-Oct-09 13:05 
GeneralRe: [Added informatio] Deleting objects from a collection Pin
DaveyM6917-Oct-09 13:17
professionalDaveyM6917-Oct-09 13:17 
GeneralRe: [Added informatio] Deleting objects from a collection [modified] Pin
CaptainSeeSharp17-Oct-09 13:20
CaptainSeeSharp17-Oct-09 13:20 
GeneralRe: [Added informatio] Deleting objects from a collection Pin
Luc Pattyn17-Oct-09 13:36
sitebuilderLuc Pattyn17-Oct-09 13:36 
GeneralRe: [Added informatio] Deleting objects from a collection Pin
CaptainSeeSharp17-Oct-09 13:43
CaptainSeeSharp17-Oct-09 13:43 
GeneralRe: [Added informatio] Deleting objects from a collection Pin
Luc Pattyn17-Oct-09 13:53
sitebuilderLuc Pattyn17-Oct-09 13:53 
GeneralRe: [Added informatio] Deleting objects from a collection Pin
Luc Pattyn17-Oct-09 13:47
sitebuilderLuc Pattyn17-Oct-09 13:47 
GeneralRe: [Added informatio] Deleting objects from a collection Pin
harold aptroot17-Oct-09 14:09
harold aptroot17-Oct-09 14:09 
AnswerRe: Deleting objects from a collection Pin
dojohansen17-Oct-09 23:05
dojohansen17-Oct-09 23:05 

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.