Monthly Archives: May 2007

Movie Summary – TMNT

Standard

My kids love TMNT, so by popular demand, here’s the official movie summary.

Teenage Mutant Ninja Turtles Movie Summary

Advertisements

The .net 2.0 Compact Framework WebBrowser Control

Standard

The .netcf 2.0 provides a web browser control.  This inspired me to try and create my own Web Browser based on .net technology.

The “WebBrowser” control has some serious limitations.  These include:

No “Title” property
Back/Next not supported (on 2003 only?)
Can’t access the “Document” object
Can’t change the context menu
Inability to set options such as formatting, cleartype, textsize etc (ie Anything useful)
Inability to access/invoke the favorites infrastructure
If you think about it, these are fairly major.

I overcame most of these problems in a few ways in Webby.

If you’re interested, feel free to ask questions by leaving comments on this post. 

Where to go from Form1.Button1

Standard

An interesting post called “Build Your Own Cab”  Part 1 by Jeremy D Miller provides some interesting insights on Windows Forms development.  It’s worth a look.

He speaks about the reasons behind MVP approaches to UI development such as the Composite UI Framework.

He makes interesting points about the fact that the average winform has many different purposes including:

  • The actual presentation to the user
  • Capturing to user input events
  • Input validation and business rules
  • Authorization rules
  • Customisation
  • Screen flow and synchronization
  • Interaction with the rest of the application

 This list seems to indicate that the classic winform approach is not a good example of the principle of “seperation of concerns”.

As he points out, this sort of code is difficult to test.  Although the forms can be instantiated within NUnit, sometimes they have dependencies that make this difficult.

It’ll be interesting to see how the series develops.

PersPective Wiki

Standard

One of my favourite wiki programs is PersPective, an open source, asp.net based wiki with a WYSIWYG editor.

The PersPective software itself is simple and elegant. PersPective stores all it’s data in xml files (another key selection criteria in the early days) utilizing a simple Xml schema. That means that the wiki is easy to backup, replicate and repair when the need arises. As a bonus, Alan Slater the author has always been helpful in extending Perspective In many cool ways. The releases of PersPective are of high quality and compatible, a tribute to Alan as a developer.

The extensibility of Perspective is also worth mentioning. It supports a facility called “Raw Includes” that allows new features to the wiki easily.  

If you’re after a good wiki, give it a try:

http://www.high-beyond.com 

Responding To Events From DataTemplate Controls in WPF

Standard

WPF provides the ability to create templated items for controls such as the list and grid.

These item templates allow any WPF controls including labels, text areas and buttons.  My problem was knowing how to create code that responds to the clicks of these buttons.  Wasn’t terribly obvious to me. 

Here’s an example:


  <DataTemplate x:Key="SomeListItemTemplate">
    <StackPanel>
     <TextBlock Text="{Binding Subject}" Width="188" Height="45.277"/>
      <Button x:Name="cmdDeleteItem" Width="59" Height="21.277" Content="Delete" >    
    </StackPanel>
  </DataTemplate>

The trick  appears to be to create “CommandBindings”.  These are an input mechanism in WPF that allows developers to define commands centrally and have them processed by the one piece of logic.

It appears this isn’t supported visually in Expression Blend unfortunately.

In order to solve my problem I had to do four things.

Firstly I defined a Window.CommandBindings section in my xaml file

<Window.CommandBindings>
<CommandBinding Command="local:MyCommands.DeleteItem" Executed="OnDeleteItem" />
</Window.CommandBindings>

(For this to work, add the ‘xmlns:local=”clr-namespace:MyProject” ‘ attribute against the Window Tag)

Secondly I created a class to host my custom command:


Public Class MyCommands
    Public Shared DeleteItem As New RoutedCommand("DeleteItem", GetType(MyTasksWPF.Main))
End Class

Thirdly I created the “OnDeleteItem” method to receive my event:

Public Sub OnDeleteItem(ByVal sender As Object, ByVal args As ExecutedRoutedEventArgs)
System.Windows.MessageBox.Show("So you wanted to delete " & CStr(args.Parameter) & " punk? Well didja?")
End Sub

Finally I updated the button definition to specify the command I defined:

<Button x:Name="cmdDeleteItem" Width="59" Height="21.277" Content="Delete"
Command="local:MyCommands.DeleteItem" CommandParameter="{Binding Id}"/>

Find the SDK docummentation on the subject here:

http://www.eggheadcafe.com/software/aspnet/29895215/commandbindings-in-blend.aspx

A full example demonstrating types of using CommandBinding:

http://adoguy.com/2007/03/28/WPF_Command_Example.aspx

Support for Divico Dual DVB-T 4 Card for GB-PVR and Media Portal

Standard

About a month ago I was able to purchase a new (although obsolete) Windows Media Center 2005 box. This has meant the end to my adventures in using free 3rd party PVR Software. I have decided to create this post to document the definitions I created to assist others. Media Center 2005 is a joy to use and I thoroughly recommend it. Doubtless Vista Media Center is also good as well. (Although getting the free Tv Guide working in Australia is eternal torment) If you’re interested in a freeware PVR, I tried many freeware PVR programs, and here my recommendations:

1. GB-PVR – http://www.gbpvr.com/

A great little program, but the configuration and skinning can be a pain to get working.

2. Media Portal – http://www.teammediaportal.org

Ok, but failed the “spouse” test on usability. It seems to have a great community however.

Both of these programs did not work “out of the box”. They required manual tinkering in order to recognise my Tuner Card, the Divico DVB-T 4. I bought this card on the understanding that it was the most compatible with “everything”. It’s an ok card, but I doubt it’s the best.

One problem seems to be that it takes quite a while to switch channels and stutter does happen at times, regardless of the PVR. It may be compatible, but it’s a lot of work to get going with these other cards. I think the main problem is that most people buy the USB version of this tuner, which is totally different to the dual channel.

My Definition for GB-PVR

Add these entries to the file “bda.ini”:

[Dvico Fusion DVB-T Special]
TUNING_TYPE=DVB-T
FILTER_TUNER=Bluebird, BDA Tuner1
FILTER_CAPTURE=Bluebird, WDM TsCapture1
PIN_TUNER_IN=Input0
PIN_TUNER_OUT=MPEG2 Transport
PIN_CAPTURE_IN=MPEG2 Transport
PIN_CAPTURE_OUT=MPEG2 Transport

[Dvico Fusion DVB-T Special 2]
TUNING_TYPE=DVB-T
FILTER_TUNER=Bluebird, BDA Tuner2
FILTER_CAPTURE=Bluebird, WDM TsCapture2
PIN_TUNER_IN=Input0
PIN_TUNER_OUT=MPEG2 Transport
PIN_CAPTURE_IN=MPEG2 Transport
PIN_CAPTURE_OUT=MPEG2 Transport

The normal detection process should now find both channels of your tuner card.

My Definition for Team Media Portal

Add the following definitions to CaptureCardDefinitions.xml:

<capturecard commercialname=”Dvico FusionHDTV DVB-T 4″ capturename=”Bluebird, WDM TsCapture1″ devid=”vid_0fe9&pid_db78″>
<capabilities tv=”true” radio=”false” mpeg2=”true” mce=”false” sw=”false” bda=”true”/>
<tv>
<interface cat=”capture” video=”2″ audio=”3″ mpeg2=”1″ sectionsandtables=”5″/>
<filters>
<filter cat=”networkprovider” name=”Microsoft DVBT Network Provider” checkdevice=”false”/>
<filter cat=”tunerdevice” name=”Bluebird, BDA Tuner1″ checkdevice=”false”/>
<filter cat=”capture” name=”Bluebird, WDM TsCapture1″ checkdevice=”false”/>
</filters>
<connections>
<connection sourcefilter=”networkprovider” sourcepin=”0″ sinkfilter=”tunerdevice” sinkpin=”0″/>

<connection sourcefilter=”tunerdevice” sourcepin=”0″ sinkfilter=”capture” sinkpin=”0″/>
</connections>
</tv>
</capturecard>

<capturecard commercialname=”Dvico FusionHDTV DVB-T 4 2″ capturename=”Bluebird, WDM TsCapture2″ devid=”vid_0fe9&pid_db78″>
<capabilities tv=”true” radio=”false” mpeg2=”true” mce=”false” sw=”false” bda=”true”/>
<tv>
<interface cat=”capture” video=”2″ audio=”3″ mpeg2=”1″ sectionsandtables=”5″/>
<filters>
<filter cat=”networkprovider” name=”Microsoft DVBT Network Provider” checkdevice=”false”/>
<filter cat=”tunerdevice” name=”Bluebird, BDA Tuner2″ checkdevice=”false”/>
<filter cat=”capture” name=”Bluebird, WDM TsCapture2″ checkdevice=”false”/>
</filters>
<connections>
<connection sourcefilter=”networkprovider” sourcepin=”0″ sinkfilter=”tunerdevice” sinkpin=”0″/>

<connection sourcefilter=”tunerdevice” sourcepin=”0″ sinkfilter=”capture” sinkpin=”0″/>
</connections>
</tv>
</capturecard>

Greetings!

Standard

Hello there Blogsphere!  This is my first development blog, so be kind.

I find the blogs and other web resources invaluable.  This is my way of giving something back. (This inspired by the DotNetRocks podcast with Jeff Atwood about how developers should record their programming adventures for the enrichment of the development community…..I think it’s a great idea)

Just like other developers, I frequently find answers to problems that noone else on the net seems to have come up with, so I’ve decided to share.

My particular area of expertise at the moment is development on the pocket PC.    I’ve authored a few publically availble programs in this area, including Webby Mobile and PPCFinder.    During the development of these and other programs I have discovered a few things, which I’ll share.

If you’ve got questions about mobile development using the Compact Framework, feel free to drop me a line.