06-30-04 10:56 PM
No constructor but you can do this:
/// <summary>
/// Posting item collection class
/// </summary>
public class PostingItems : System.Collections.CollectionBase
{
// Restricts items that can be added to the collection to Posting types
public void Add(Posting p)
{
List.Add(p);
}
public void Remove(int index)
{
// Makes sure there is an object at the supplied index before trying to
remove it.
if (index < Count && index > 0)
{
List.RemoveAt(index);
}
}
public Posting Item(int Index)
{
// The appropriate item is retrieved from the List object and
// explicitly cast to the specified type, then returned to the
// caller.
return (Posting) List[Index];
}
}
It builds a Stongly typed collection of Postings
"Michael Richman" <mpr7@pge.com> wrote in message
news:2403c01c45ee5$b57482d0$a501280a@phx
.gbl...
> I have written a recursive function to crawl channels. I'd
> like this function to return a temporary PostingCollection
> containing a number of Postings from the channels and sub-
> channels.
>
> I'm not finding a constructor for PostingCollection, does
> anyone have any ideas on how to build a temporary
> PostingCollection and how to add Postings to it?
>
> Thanks,
>
> Michael
[ Post a follow-up to this message ]
|