Hello guys,
I know that the NetMF doesn’t support generics, and now I’m faced with an issue, and frankly i can’t think of how to solve it, because the solution is buried somewhere in a C# 1.1 book before generics were introduced… and my head just can’t think backwards… so anyway can help please chime in…
//this is a simple class
[Serializable]
public class myClass1
{
public myClass1()
{
}
}
//a collection that derives from the above class.
using System.Collections.Generic;
using System.Collections.ObjectModel;
[Serializable]
public class myClass1Collection : Collection<myClass1>
{
/// <summary>
/// Initializes a new instance of the <see cref="myClass1Collection"/> class.
/// </summary>
/// <param name="myList">My list.</param>
internal myClass1Collection(IList<myClass1> myList)
: base(myList)
{ }
/// <summary>
/// Initializes a new instance of the <see cref="myClass1Collection"/> class.
/// </summary>
public myClass1Collection()
{ }
}
now how can i do this in NETMF world?
maybe the answer is using ArrayList … because that is the equivalent to List if I’m not mistaken…
You will have to build a custom collection type using either an array or ArrayList or possibly a Hashtable depending on your needs. ArrayList is not equivalent to List. ArrayList yields an array of Object types, not T types. It’s like going back to CS101…
on code tags not behaving - i’ve been busted by special characters before, even directly after the tag. e.g. a period right after a url tag will cause the period to be included in the url. In general, I put extra CRLFs in to make sure tags behave.
You could also simply try editing the post by deleting the text and pasting it back in.