constructor for PostingCollection?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > constructor for PostingCollection?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    constructor for PostingCollection?  
Michael Richman


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-30-04 10: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





[ Post a follow-up to this message ]



    Re: constructor for PostingCollection?  
Israel Vega


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
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 ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:19 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register