[CSharp.net] Update: Collection oder array?
Mansur Esmann [OM]
csharp.net at glengamoi.com
Tue, 18 May 2004 13:36:47 +0200
Also jetzt bin ich glaube ich weiter:
namespace Toolbox.GIS
{
/// <summary>
/// Represents an collection of LineMapShapes
/// </summary>
public class GISLineMapShapeCollection: ArrayList
{
public GISLineMapShapeCollection()
{
}
public void LineMapShape(LineShape aLineShape)
{
GISLineMapShape x = new GISLineMapShape(aLineShape);
this.Add(x);
}
/// <summary>
/// Represents an LineMapShape
/// </summary>
public class GISLineMapShape : LineMapShape
{
public GISLineMapShape(LineShape aLineShape) : base()
{
this.mBaseShape = aLineShape;
}
}
}
}
Jetzt wird einfach eine Instanz von "GISLineMapShape" angelegt und die dem this. (Also ArrayList)
hinzugefügt ...
Das "GISLineMapShapeCollection()" habe ich um ein wiederverwendbares Objekt zu haben ...
Jetzt muss ich halt mittels "public void LineMapShape(LineShape aLineShape)" eine LineMapShape
erzeugen.
Ist das jetzt der richtige Weg, oder ist da noch ein nichtbemerkter Wurm drinnen?
Schlussendlich sollen natürlich noch einige Properties und Methoden dazu kommen ...
Gruß Mansur