[CSharp.net] Collection oder array?

Alexander Zeitler csharp.net at glengamoi.com
Tue, 18 May 2004 11:37:53 +0200


Hallo,

>  Womit ich aber ein Problem habe ist wie ich es einsetze:
> 
> public class GISPoint : PointMapShape, ArrayList
> 
> das geht ja nicht, weil an der Stelle eine Schnittstelle kommt ....
> 
> Heisst das ich sollte GISPoint als ArrayList definieren und 
> darunter dann eine public - klasse
> reintun, die den tatsächlichen GISPoint representiert?

genau - oder GISPointCollection.

Aufruf:

GISPointCollection gisPoints = new GISPointCollection();
GISPoint gisPoint = new GISPoint();
gisPoint.MachWas();
gisPoint.EinWert = 123;
gisPoints.Add(gisPoint);
.....

Später dann z.B.:

foreach(GISPoint gisPoint in gisPoints)
{
	gisPoint.MachWas();
}

Gruss

Alex

Kommt zur .NET Community Conference in Karlsruhe
http://www.dotnetcommunityconference.com