Brian Jimdar
Seattle area WPF / Silverlight developer

Code pasted from Visual Studio

Saturday, 22 December 2007 14:14 by brian
/// <summary>
/// Retrieves all posts from the data store
/// </summary>
/// <returns>List of Posts</returns>
public override List<Post> FillPosts()
{
     
string folder = Category._Folder + "posts" + Path.DirectorySeparatorChar;
     
List<Post> posts = new List<Post>();

     
foreach (string file in Directory.GetFiles(folder, "*.xml",
          
SearchOption.TopDirectoryOnly)) 
      {
          
FileInfo info = new FileInfo(file);
          
string id = info.Name.Replace(".xml", string.Empty);

      
    //Post post = SelectPost(new Guid(id));
           Post post = Post.Load(new Guid(id));
           posts.Add(post);
      
}
      
posts.Sort();
       return posts;
}
Categories:  
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Related posts