Teun.ToString()

by Teun Duynstee [Macaw]

<December 2008>
SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910


Navigation

Subscriptions

News

I discontinued this blog. I now post at: www.TeunToString.net



Download Finch PocketBlogger

Post Categories

Article Categories



Friday, January 14, 2005 - Posts

A new release of Finch: 0.93

It has been a long time since a worked on Finch, but today I have added all of the promised features. It all seems to work, but obviously, it needs some testing. Finch is now feature complete for the 1.0 release.

New features are:

  • Category support (even in .Text, where other tools based upon the MetaBlogAPI crash when updating a post in .Text, I decided to create a specific .Text work-around, because I use it myself)
  • Shortcuts in the editor (you get a menu with frequently used phrases and utilities like “Make bold“ and “Insert date“). This is based upon an XML file that you can edit to fit your most frequent phrases.
  • Several small bug fixes around delete/undelete
  • An Exit option in the menu that will really end the process and not just hide it
  • The entry screen for the service Url is a bit more helpful

 

posted Friday, January 14, 2005 5:03 PM by TeunD with 0 Comments

Some small improvements on the FileCatalogPart

Some time ago, I published a catalog web part that reads its content from a normal .ASCX file. One of the comments on this posting suggested a better use of generics in the code and I learned a bit more about how the web part creation in the WebPartManager control works, so I cleaned up the code and it got easier to understand along the way. For more explanation, check the original post. Here is the new and improved code:

public class FileCatalogPart : CatalogPart
 {
  public FileCatalogPart()
  {

  }
  private string _templateLocation;
  public string TemplateLocation
  {
   get
   {
    return _templateLocation;
   }

   set
   {
    _templateLocation = value;
   }
  }


  Dictionary<WebPartDescription, WebPart> webparts = new Dictionary<WebPartDescription, WebPart>();
  public override WebPartDescriptionCollection GetAvailableWebPartDescriptions()
  {
   webparts.Clear();
   
   if (TemplateLocation != null)
   {
    Control container = Page.LoadControl(TemplateLocation);
    if (container != null)
    {
     // You cannot directy iterate over the Controls collection, an excption
     // is thrown that the collection was changed while iterating
     ArrayList iterate = new ArrayList(container.Controls);
     foreach (Control child in iterate)
     {
      WebPart wp = null;
      if (child is WebPart)
      {
       wp = (WebPart)child;
      }
      else
      {
       if (!( child is LiteralControl))
       {
        wp = this.WebPartManager.CreateWebPart(child);
       }
      }
      if (wp != null)
      {
       WebPartDescription desc = new WebPartDescription(wp);
       webparts[desc] = wp;
      }
     }
    }
   }
   return new WebPartDescriptionCollection(webparts.Keys);
  }

  public override WebPart GetWebPart(WebPartDescription description)
  {
   return (WebPart)webparts[description];
  }

 }

posted Friday, January 14, 2005 12:26 PM by TeunD with 0 Comments




Powered by Dot Net Junkies, by Telligent Systems