Microsoft Content Management Server - constructor for PostingCollection?

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > June 2004 > constructor for PostingCollection?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author constructor for PostingCollection?
Michael Richman

2004-06-30, 5:56 pm

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
Israel Vega

2004-06-30, 5: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



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com