Binding TextBlock to RichText

Thursday, October 02, 2008 4:16:41 AM (GMT Daylight Time, UTC+01:00)

I was doing some updates to a debugging tool for WPF... I was adding a filter feature that would highlight the characters in yellow as you entered them.

image

I was originally using a TextBlock to bind to by information and that worked fine until I was adding the rich text feature of highlighting the search string.  You can't bind to the Text property of a TextBlock and pass in a Inline object (shown below, which is what supports the rich text within a TextBlock).

image

The only time you could pass Inlines to the TextBlock was in the constructor... that wasn't going to work with a binding.

That forced me down the road of investigating the use of a Label, as I could bind to the Content property and it would render the Inline elements I was creating just fine... this resulted in the rich text highlighting.  However, there was a couple of issues... since this is constantly taking information from the Win32 OutPutDebugString call (see DbgMon) it really needed to perform well when rendering.  I was noticing a little bit of a performance hit... not substantial, but noticeable (maybe that is substantial then).   In addition, wrapping text with in a Label turned out to be not so easy. 

So I went back to the TextBlock.  I tried to bind to the Inlines property.  There was a couple of issues with that... one it wasn't a DependencyProperty and the other issue was that it was read-only.

Solution:

Since I had written a converter to handle highlighting of the filtered text within the string, I was returning Inlines. I modified the convert so that I would return a TextBlock and since I was creating the inlines I was able to pass them into the constructor of the TextBlock.  Instead of binding to a TextBlock in the DataTemplate, I binded to a ContentControl, which would intern using the converter to get the TextBlock that was generated with the filter text highlighted.

The resulting converter looked like the following:

public class StringToHighlightConverter :  IValueConverter
   {
       public object Convert(object values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
       {
           //get the data found in the text
           string dataText = (string)values;
 
           if (!string.IsNullOrEmpty(dataText) && !string.IsNullOrEmpty(TextSearchFilter.SearchClause))
           {
               List<StringOccurance> highlightedWords = new List<StringOccurance>();
               foreach(string token in TextSearchFilter.TokenizedSearchClause)
               {
                   highlightedWords.AddRange(StringEx.FindStringOccurances(dataText, token));
               }
               
               if (highlightedWords.Count == 0)
                   return CreateTextBlock(dataText);
 
               int textStartIdx = 0;
               string plainWord = string.Empty;
               int wordOccuranceIdx = 0; //keep count of the words we have proccessed
               Span phrase = new Span();
 
 
               for (int i = textStartIdx; i < dataText.Length; i++)
               {
                   if (wordOccuranceIdx == highlightedWords.Count)
                   {
                       //We have reached the maximum word occurances, add the plain word span
                       Span wordSpan = CreateWordSpan(dataText.Substring(i), false);
                       phrase.Inlines.Add(wordSpan);
                       break;
                   }
 
                   //get the currrent word that needs to be highlighted
                   StringOccurance wordOccurance = highlightedWords[wordOccuranceIdx];
 
                   if (wordOccurance.StartIndex == i)
                   {
                       //add the plain word span
                       if (!string.IsNullOrEmpty(plainWord))
                       {
                           Span wordSpan = CreateWordSpan(plainWord, false);
                           plainWord = string.Empty;
                           phrase.Inlines.Add(wordSpan);
                       }
 
                       Span highLightedWordSpan = CreateWordSpan(wordOccurance.Value, true);
                       wordOccuranceIdx++;
                       //issue with this
                       i = i + (wordOccurance.Value.Length - 1);
                       phrase.Inlines.Add(highLightedWordSpan);
                       continue;
                   }
 
                   if (i >= dataText.Length)
                   {
                       //add the plain word span
                       //Span wordSpan = CreateWordSpan(dataText.Substring(i), false);
                       Span wordSpan = CreateWordSpan(plainWord, false);
 
                       phrase.Inlines.Add(wordSpan);
                       break;
                   }
 
                   plainWord = plainWord + dataText[i];
               }
 
               return CreateTextBlock(phrase);
 
           }
           return CreateTextBlock(dataText);
       }
 
       private TextBlock CreateTextBlock(Inline text)
       {
           TextBlock block = new TextBlock(text);
           block.TextWrapping = System.Windows.TextWrapping.Wrap;
           return block;
       }
       
       private TextBlock CreateTextBlock(string text)
       {
           Span textSpan = new Span();
           textSpan.Inlines.Add(text);
           return CreateTextBlock(textSpan);
       }
 
       private Span CreateWordSpan(string text, bool highlight)
       {
 
           Span wordSpan = new Span();
           if( highlight == true)
           {
               wordSpan.Background = Brushes.Yellow;
           }
               
           wordSpan.Inlines.Add(text);
           return wordSpan;
 
       }
    
       public object ConvertBack(object value, Type targetTypes, object parameter, System.Globalization.CultureInfo culture)
       {
           throw new NotSupportedException("Not supported");
       }
   }

The xaml in the DataTemplate looked like:

<DataTemplate>
    <ContentControl Content="{Binding OutPutDebugString, 
                    Converter={StaticResource highlightConverter}}" 
                    VerticalAlignment="Top" />
</DataTemplate>

Acropolis CTP Released

Tuesday, June 05, 2007 2:12:52 PM (GMT Daylight Time, UTC+01:00)

Look's like the Acropolis CTP was released a couple of days ago...

http://www.microsoft.com/downloads/details.aspx?familyid=72386ce5-f206-4d5c-ab09-413b5f31f935&displaylang=en&tm

Dinner Now Sample

Friday, March 23, 2007 1:28:08 AM (GMT Standard Time, UTC+00:00)

Looking for a sample that implements all of the latest Microsoft technologies in one package.... Including:

Windows Workflow

Windows Presentation Foundation

Windows Communication Foundation

Vista Sidebar Gadgets

Windows PowerShell

Linq

ASP.NET 2.0 AJAX Extensions

Mobile Device Development

 

You can find all of this in the DinnerNow.NET reference application.

Synchronization Services CTP Released

Monday, February 12, 2007 3:25:47 PM (GMT Standard Time, UTC+00:00)

The ADO.NET Data Synchronization services is now available in CTP.  This SDK will make it easier to support the disconnected operation scenarios you run into with Smart Clients.  If you are looking for more information or a good demo of the functionality you can take a look at Steve Lasker's blog and specifically his Live from Redmond Webcast.

One thing to note is that there is only a SQL Compact Edition provider and there is no SQL Express provider at this point, which means that if you are using SQL Express on the client you will need to write your own provider or wait for Microsoft to develop one.  I would suggest contacting Steve Lasker if want to see a SQL Express provider developed.  Although you could write your own, the schema creation may get a bit tricky... I know that a number of the folks that were on this team were from the SQL Server team and they were able to add some system tables to support the schema process.

They also have a synchronization blog available that discusses and demonstrates the SDK.

Consolas Editor Font for Visual Studio 2005

Tuesday, November 21, 2006 4:34:49 AM (GMT Standard Time, UTC+00:00)

I stumbled across the fact that they released a new editor font for Visual Studio .NET which is supposed to be more compressed and easier to read.  I had been using Lucida Console forever and really liked that, but I like Consolas even better.

You can download it at the Microsoft Download Center.  Beware it will install as the default font for your Visual Studio environment.

Displaying Hierarchical Data with SQL

Wednesday, November 15, 2006 10:49:59 PM (GMT Standard Time, UTC+00:00)

I have solved this problem a number of times using recursion on the client and have always wanted to better solution for handling on the server side.  Handling it on the client requires that you bring back all of the data and recurse through it. Again I was faced with the problem this week... and I thought I would poke around to see if there was a better way to solve the problem.  It looks SQL Server 2005 now supports Common Table Expressions, which allows for recursion.  Here are a couple of articles I found explaining how to do it:

SQL Server 2005 Recursion Functions

Hierarchical Queries in SQL Server 2005

Intellisense for SQL Analyzer

Wednesday, May 31, 2006 6:00:00 AM (GMT Daylight Time, UTC+01:00)
Redgate software has added intellisense to the SQL Analyzer.  Looks like you can download for free until September 1st, 2006.  You can get the downloa at http://www.red-gate.com/products/SQL_Prompt/index.htm.
 
Here is a sample of what it looks like.
 
Intellisense for SQL Server

Compatibility between 1.1 and 2.0 Framework

Sunday, May 14, 2006 6:00:00 AM (GMT Daylight Time, UTC+01:00)
Playing around with some of the .NET 2.0 framework and here are some interesting things to note.
 
IPC Channel
There is a new bidirectional IPC Channel (System.Runtime.Remoting.Channels.Ipc ) with the .NET Framework 2.0 that does not use the network layer when communicating between AppDomains.  This equates to increased performance for applications communicating between each other on the same machine.
 
BinaryFormatter/SoapFormatter and CLR Backward Compatibility
If you have a need to remote between the 1.1 and 2.0 versions of the .NET Framework and are using the BinaryFormatter, a patch will be required for the 1.1 framework, that will allow it to communicate with 2.0 (http://blogs.msdn.com/eugeneos/archive/2006/03/15/552315.aspx).  This is mostly do to the fact that minor changes (adding extra fields for example) to types serialized by the BinaryFormatter are considered breaking changes in 1.1.  It looks like with the introduction of the Version Tolerant Serialization ( http://msdn2.microsoft.com/en-us/library/ms229752.aspx) a similar patch will not be required to go from 2.0 to the next revision of the framework.  This patch is not applicable to the SOAP formatter, since the SoapFormatter implements a less stringent type checking which allows the addition of fields with out breaking serialization.  This would also indicate the importance of the SoapFormatter has been reduced and there would be very few benefits for using it over the BinaryFormatter and the introduction of Version Tolerant Serialization.
 
Serialization of Generics
The SoapFormatter does not support serialization of Generics, however the BinaryFormatter does. http://blogs.msdn.com/mattavis/archive/2004/08/23/219200.aspx  Another reason to move away from the SoapFormatter for .NET to .NET implementations.
 
CLR
Recently while working on a project for a client we discussed how upgrades were going to work for the application.  This eventually evolved into a discussion of how updates to the framework would come into play with the application.  These are my findings.  When I refer to 1.0, 1.1 or 2.0 I am referring to the version of the .NET Framework.
 
Using a newer version of the CLR to load assemblies compiled in older versions is generally OK, because of the .NET Frameworks commitment to being backwards compatible.  Instances can arise where the older implementation will fail to work, and those have been documented at: Breaking Changes from Version 1.1 to 2.0 (http://msdn.microsoft.com/netframework/programming/breakingchanges/default.aspx). 
 
Currently I am using the July 2005 Application Blocks compiled in 1.1 with the .NET 2.0 implementation without a problem.
 
Loading Assembly Changes
It is possible to load a 1.1 assembly into a 1.0 application.  It is also important to note that the 2.0 CLR will not allow you to load an assembly built with 2.0 into a process that is running the 1.0 or 1.1 .NET Frameworks
 
Framework Resolution
It is possible to run an application compiled for the 2.0 Framework, and have that application consume assemblies built in 1.0,1.1 and 2.0.  The important thing to understand is that the process will redirect all references to the version of the CLR that is loaded into the process.  This allows types to be shared among all the different versions of the assemblies.  For example, a reference to a System.Xml.XmlDocument in .NET Framework version 1.1 can be consumed by .Net 2.0 application with out any problems.  Since it is possible that there may be undiscovered issues with this default behavior of the CLR you can override this capability in the configuration file and tell the 1.1 assembly to bind to the 1.1 version of System.Xml.XmlDocument.  However, if you try to communicate with any other assemblies that were not compiled in the 1.1 framework the CLR will throw an exception.
 
Some interesting links related to  framework capatibility.
 
CLR 2.0 Compatibility and Side by Side (Brad Abrams Blog)
 
Targeting a .NET Framework Version
 
 

Converting Visual Studio 2003 Web Projects to 2005

Saturday, April 29, 2006 5:49:36 PM (GMT Daylight Time, UTC+01:00)

I ran into some problems converting my VS 2003 web projects to 2005.  Specifically around how I was using configuration files and build events in VS 2003.  After poking around on the net I found that Microsoft had published a VS 2003 Web Project for 2005.  You can get it at http://webproject.scottgu.com/.  After installing it and following the directions for converting my project, it took care of all of the issues I was having.

Overview of Visual Studio Team System

Friday, March 03, 2006 6:00:00 AM (GMT Standard Time, UTC+00:00)
The following is an overview of Visual Studio Team System and some of the benefits it brings to the table.  It’s a high level overview, but it may allows you to identify areas that you want to dig into.
 
 
You can also download it in pdf format:

IntroVSTS.pdf

Windows Communication Foundation (WCF) Site Released

Monday, January 23, 2006 6:00:00 AM (GMT Standard Time, UTC+00:00)
Previously know as Indigo, the new WCF site has been announced. 
 

Enterprise Library releases a version of the Application Updater Block

Monday, March 14, 2005 6:00:00 AM (GMT Standard Time, UTC+00:00)
You can find the release on GotDotNet.

Enterprise Library Released

Monday, January 31, 2005 6:00:00 AM (GMT Standard Time, UTC+00:00)
Enterprise Library is released.  These are derivatives of the original Application Blocks improved immensely to support additional functionality that was missing in the core original blocks.

Effective Source Safe - Shell Extension & VSS to RSS

Tuesday, December 07, 2004 6:00:00 AM (GMT Standard Time, UTC+00:00)
Visual Source Safe (VSS) can be a little frustrating when you are trying to add projects through the Visual Studio IDE.  You think it is creating it in one place and it ends up in another…
 
A tool that I have found to be pretty helpful is Effective Source Safe.  It is a shell extension that allows you to add files to source safe, exactly how you have them on the file system.
 
This allows you to create the projects where you want in your folder structure and then add them through the shell extension provided by ESS.  After you add them to VSS you can open the Visual Studio IDE and bind them to the VSS project folder you want.
 
Be aware, it does have some quirks.
  • When you do add to source control the explorer doesn’t update with the appropriate icons, but it is in VSS.
  • Performance is not very good.  Clicking around the directory structures that are monitored by ESS can be painful at times.
 
You can get ESS at Code Project. 
 
Also if you want to get updates from VSS everytime someone makes changes to the code base, but don't want e-mails filling your InBox, take a look at VSS to RSS.  It includes source now so you can modify it.
 

Contract First Web Service Development

Thursday, November 18, 2004 6:00:00 AM (GMT Standard Time, UTC+00:00)
I have a heard a lot of buzz about contract first development as of late.  I first heard about it from Ed Ferron and Matt Milner after they returned from their PluralSight training in the beginning of November.
 
Aaron Skonnard and Don Box have brought it up in their blogs.
 
I Googled it and found a reference to it on MSDN that was published late October.  It that was co-authored by James Duff, Eric Cherng both of Vertigo Software (the folks that brought us PetShop) and Dino Chiesa of Microsoft.
 
The concept of Contract First development comes down to taking more control over how the .NET Framework handles the creation of your web service contract (WSDL) that clients consume.  If you don't need the control, then you don't need to take on the additional complexity of hand modifying your WSDL.  As many have mentioned, the tool sets for creating WSDL are not there yet.
 
So when do you need that control?  Interop with other platforms seems to be the most popular instance, as the fidelity of data types my not translate well into other platforms.  By taking control of the contract, you can describe in more detail how to represent a type that may not have a direct equivalent in another platform. 
 
Another instance is working in BizTalk, which requires the schema of messages to be defined first.  I just finished a SOA project that included BizTalk as a component of the implementation.  We did a type of Contract First development, but not exactly the way it is described in the MSDN article.  We designed the way we wanted our messages to look by laying them out in xml.  Then converted them to a type, and from the type created our schemas which then was consumed by BizTalk and our web services.  The MSDN article suggests having the Xml Web Services framework  generate the wsdl for you, then modify the wsdl to meet the needs of interop and generate the types from that.
 
One of the things we really struggled with was getting the xsd.exe to produce the class structures we wanted.  We ended up abandoning the tool pretty early, looked at alternatives (Dingo, XsdTidy, SchemaTron, and modifying the xsd.exe source), but ended up writing an implementation that would take an xml document and create the class structure, gets/sets for properties and strongly typed collections we were looking for.
 
The folks at thinktecure have created an IDE add-in (WsContractFirst) that takes a wsdl and creates the proxy and server side classes based on your modified wsdl contract.

SharePoint 2003 - WSS Site Map

Sunday, October 17, 2004 6:00:00 AM (GMT Daylight Time, UTC+01:00)
I spent some time earlier this year working on a large SharePoint site.  One of the things that I became pretty frustrated with was the navigation experience for SharePoint administration.  I came up with this Mind Map that shows the layout (for WSS only).  I decided to share it with people to verify its accuracy and get feedback on it.
 
Send error and omissions to shannon@conceptbench.com
 
 
SharePoint WSS Site Map.zip (387.22 KB)

Setting up SharePoint Portal for Anonymous Access

Wednesday, July 14, 2004 6:00:00 AM (GMT Daylight Time, UTC+01:00)
The steps that explain how to create a new virtual server and enable it for anonymous access are listed in the "Manage Anonymous Access Settings" topic of the "Portal and Site Security" section of the "Security" chapter of the Microsoft Office SharePoint Portal Server 2003 Administration Guide.  The following is the link to that topic in the .chm file:
mk:@MSITStore:C:\Documents%20and%20Settings\sbraun\Desktop\SharepointPSAdmin.chm::/html/ManagingAnonymousAccessSettings.htm
 
I followed the directions in the chm file, but they didn't work.  This is what I came up with, which is similar to the chm file, but step 3 is an addition to the chm.
 
Make sure that you follow these steps in this order:
  1. Create a Virtual Site using IIS (follow the detailed steps in the chm)
  2. Extend the virtual Server, using the Central Administration Tool (follow the detailed steps in the chm).
    1. Make sure that you choose to Extend and Map to Another Virtual Server.
  3. Change anonymous access for the WSS site, logging in through the Anonymous site.
On the portal, click Site Settings.
    1. Under General Settings, click Manage security and additional settings.
    2. Under Users and Permissions, click Change anonymous access settings.
    3. To enable or disable anonymous access to the site, in the Anonymous Access section, under Anonymous users can access, select one of the following:
      1. Areas and Content
      2. Areas, Content and Search
      3. Nothing
    4. Click OK.
  1. Enable Anonymous Access for the Virtual Server IIS Management Tool (follow the detailed steps in the chm).
 

User Interface Process Block V2 Released

Monday, April 12, 2004 4:01:46 PM (GMT Daylight Time, UTC+01:00)

The User Interface Process Block V2 or UIP V2 is the next version of one of the most popular application blocks. This block is a reusable code component that builds on the capabilities of the Microsoft .NET Framework to help you separate your business logic code from the user interface. The UIP Application Block is based on the model-view-controller (MVC) pattern. You can use the block to write complex user interface navigation and workflow processes that can be reused in multiple scenarios and extended as your application evolves.

 UIP V2  includes 

  •     Support for Smart Client Applications, including state persistence using isolated storage
  •     New views supported: hosted controls, wizards, and floating windows
  •     A number of fixes and enhancements to V1.

The block can be found at: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/uipab.asp

Smart Client Architecture Guide - Pre-Alpha

Wednesday, April 07, 2004 2:25:57 PM (GMT Daylight Time, UTC+01:00)

This pre-alpha release contains three chapters for review. 

Chapter 1 - Introduction
Chapter 4 - Offline
Chapter 6 - Multithreading

You can find the zip here.

Microsoft Eastern Strategic Architect Forum

Thursday, March 25, 2004 3:23:55 AM (GMT Standard Time, UTC+00:00)

Spent the last week in Orlando.  That's one of the reasons why the blog went dead for the week.  I spoke at the Microsoft Eastern Strategic Architect Forum about Web Services.  Then the family and I spent another 4 days doing the Disney theme parks.  Exausting to say the least.  Still had a great time. 

I also picked up some publications from the Patterns and Practices group that I had never seen before.  One was a pocket guide to Improving Web Application Security: Threats and Countermeasures called the “Pocket Guide to Improving Web Security”.  There was another book, that was based on the Enterprise Solution Patterns using Microsoft.NET, version 2.0 called “Software patterns: Organzing and Testing“.  I have looked around the net to see if there has been any others published, but didn't find anything.  These books are a condensed versions, and cover the main points of the books they derive from, I like the format.

Smart Client Offline Application Block

Friday, March 12, 2004 4:39:13 PM (GMT Standard Time, UTC+00:00)

The Offline Application Block, which is intended to serve as an architectural model for developers who want to add offline capabilities to their smart client applications. The block demonstrates how to:

  • Detect the presence or absence of network connectivity.
  • Cache the required data so that the application can continue to function even when the network connection is not available.
  • Synchronize the client application state and/or data with the server when the network connection becomes available.

You can find the block at:

http://msdn.microsoft.com/architecture/application/default.aspx?pull=/library/en-us/dnpag/html/offline.asp

Tracking Releases from Platform Architecture Group (PAG)

Friday, March 12, 2004 4:32:35 PM (GMT Standard Time, UTC+00:00)

The PAG is the group that brings us information around best practices and creates what are known as application blocks. 

I bought applicationblocks.com a year ago with the intention to post release information in RSS around the blocks and the PAG activity.  I found that I would often hear about their releases weeks or even months after the fact. I wanted to provide to everyone a way to consume the information without having to visit the practices site on a daily basis.

I was later told that Microsoft would have an RSS feed up towards the end of last year, so I held off.  Well it is March now, and I still don't have an RSS feed, nor does Microsoft.  So what I have decided to do is use some Microsoft resources that I have and publish the notifications that I get around releases the PAG group in the Patterns & Practices feed.  I hope it is beneficial to everyone, and if you see something released and I don't have the feed current, shoot me an e-mail at shannon@conceptbench.com

SharePoint Resources

Wednesday, March 10, 2004 3:30:56 PM (GMT Standard Time, UTC+00:00)

SharePointCustomization.com
Sample sites based on real world scenarios that fully expose great new functionality in FrontPage 2003 and Windows SharePoint Services.

http://www.sharepointcustomization.com/default.aspx

What are the guys up to at MSResearch?

Thursday, January 15, 2004 2:31:02 AM (GMT Standard Time, UTC+00:00)

It would be great if Microsoft would implement SmartSkip in MCE.  You can find more information about it here.  The Media Variations video was also pretty cool.

Building a Media Center Edition PC???

Saturday, January 10, 2004 5:12:51 AM (GMT Standard Time, UTC+00:00)
Check out https://www.interactservices.com/MCEkitfulfillment/PageDirect.asp.  You can get the MCE 2004 evaluation kit which includes the Microsoft XP MCE 2004 software and remote for $60.
 

MCE 2004 - No ability queue songs?

Wednesday, January 07, 2004 2:24:33 AM (GMT Standard Time, UTC+00:00)

Alright, so I am getting ready to sit down and prepare for a InfoPath presentation that I am doing tomorrow evening and I can't even queue some songs up on the MCE.  You would think that when you are developing something like this, that you would allow users to queue songs up on the fly.  Especially when the API exposes the call.  Looks like an opportunity to do some MCE programming.

MediaCenter.AddSongToQueue

The AddSongToQueue method adds a specified song to the user's queue for audio playback.

Syntax

MediaCenter.AddSongToQueue(sUrl)

Parameters

sUrl

(Required) A String that specifies the location of the audio file to be added.

Remarks

Media Center enables you to dynamically create a queue of audio files for the user to play back in order. The queue starts with the currently playing song. If this method is invoked while no song is currently playing, then no queue exists, so Media Center will simply play the song indicated (that song then, in effect, becomes a "queue" of one song). If the method is invoked while a queue exists, Media Center will add the song to the end of the queue to play after any other songs in the queue finish playing.

If the user starts a queue in Windows Media Player, that queue will be maintained in Media Center as long as the playback is not stopped by the user or by an extensibility application.

Requirements

Windows XP Media Center Edition 2004.


 


Media Center 2004 PC Built

Sunday, January 04, 2004 3:16:19 AM (GMT Standard Time, UTC+00:00)

So during my free time this holiday I built my own Media Center PC using an old Dell 8000 1.4 ghz, ATI All In Wonder 9000 Pro grahpics card and ordered a Phillips remote from new egg to drive it.  About 30 hours later and 4 installs of Windows XP with the MCE overlay I got it working.  For the most part anyway.  The remote works flawlessly, I can play Videos and Music from my media library.  The only thing left to get to work is the ATI card.  For right now, it is exactly what I want. I have Tivo, so I don't care about recording shows from the MCE at this point.

First, this is only possible if you have an MSDN subscription, and the ability to download Windows XP MCE.  Otherwise only OEMs have the ability to build the Media PCs.

Couple of headaches during the install:

The serial key identifies to the XP install that you are doing an XP MCE install, not just an XP Pro SP1 install.  This took me a couple of tries to actually figure out. 

Once I got it installed, I got the infamous Video Error.  I had to install the ATI DVD codec and WinDVD in order to get MCE to play DVDs. 

As I mentioned before, I have not tried to get the ATI card to play TV inside of MCE.  I have done some research on it and it looks like you can do it.  Dell is using the ATI card in there recently released Media PC, and I have seen some instructions on their forum on how to get it to work...

Power of the XmlSerialization Stack

Wednesday, November 05, 2003 5:35:34 PM (GMT Standard Time, UTC+00:00)

I have been working with the XmlSerialization stack on and off for about 2 years now. My first introduction to it was at DevelopMentor's Guerilla .NET @ Microsoft course back in November 2001. I had used it for trivial serialization tasks and as a simple topic for presentations that I gave internally for other consultants and at Microsoft DevCare. It was a straight forward, simple way to serialize object graphs to a human readable format (Xml).

Though useful, it was rigid and didn't always meet my requirements. In those instances I took advantage of the more robust System.Runtime.Serialization stack. After all, that stack supported private/public field serialization, highly customizable output through custom formatters and had a higher type fidelity. In addition, I could supply serialization for types that were not marked [Serializable] (through the ISerializationSurrogate).

It wasn't until the last couple of months that I really discovered that the System.Xml.Serialization stack was more flexible then I had originally thought. I stumbled across the flexibility when I was trying to emulate the ISerializable interface found in the System.Runtime.Serialization stack for an extended XmlSerializer class I was implementing to address some the original stack's short comings. I had tried implementing ISerializable on my class, then serializing it using the XmlSerializer, but none of the interface methods were called. By chance I created a IXmlSerializable interface... when I compiled, it failed indicating that the interface already existed. When I read the API docks on it, it was exactly what I was trying to implement. Prior to that I thought the System.Xml.Serialization stack was limited to a number of attributes (XmlAttribute, XmlElementAttribute, XmlIgnore, XmlArray, etc) used to describe how/what you wanted the XmlSerializer to serialize in your object graph.

What I discovered through the research is that there was more flexibility with the System.Xml.XmlSerializer then initially thought. By implementing IXmlSerializable in my classes, I could not only control how I formatted my Xml, but I could also serialize private members. Though it is a bit more work, because you must supply the implementation for not only writing the object to an XmlWriter, but also supply an implementation using the XmlReader to hydrate your object. IXmlSerializable is the equivalent to ISerializable in the System.Runtime.Serialization stack.

Granted this still doesn't give you the power that the System.Runtime.Serialization stack supplies, but it does open the door for additional implementations that may have been overlooked in the past.

C# V2 Language Specification

Thursday, October 30, 2003 8:49:28 PM (GMT Standard Time, UTC+00:00)

Can be found at http://msdn.microsoft.com/vcsharp/team/language/default.aspx .

Great IE Web Development Tools

Tuesday, October 28, 2003 2:11:03 AM (GMT Standard Time, UTC+00:00)

My brother was over this weekend and we were looking at the web design of one of the sites he had in staging (here is the production site ). He was working on a face lift and he noticed that my blog had a "window" floating on the right hand side, containing a calendar, navigation, etc. He was wondering what the html looked like. I highlighted the area and clicked 'View Partial Source'. He went nuts... commenting stuff like you're the smartest brother I have (I am also the only by the way) or something along those lines of that was really cool how did you do that and can I have the tool.

Here are a couple of tools integrated into IE that have been great for doing site development and debugging.

Microsoft Web Developer Accessories
Even though this was developed for IE5, most of the functions still work with IE6. Here is the description from Microsoft:

These two tools help the Web developer or those who are just curious about how pages are coded. The DOM tree tool lets you view all the Document Object Model properties in tree form via a right click of the mouse or from the Tools menu. And for those who are tired of scrolling through hundreds of lines of HTML to find that one section of code that does what you want, search no more! Simply highlight the area of Web page that you want to see the source for, right-click on it and select View Partial Source. It's that simple! Not supported by Microsoft.

Toggle Borders
This utility allows you to toggle table borders from 1px red border to the original style. It is great for determining how a web page is laid out. You can download it from the zip at the bottom of this post (also included are the MS Web Developer Accessories). As far as credits, I am not sure where this came from.

Has anyone else seen any great tools for web development integrated into IE?

Download: WebDevTools.zip

nAnt Pad

Friday, October 24, 2003 9:34:27 PM (GMT Daylight Time, UTC+01:00)
A tool for editing Nant scripts: http://www.nantpad.com

Source Code Viewer

Tuesday, October 14, 2003 2:21:01 PM (GMT Daylight Time, UTC+01:00)
Creating a Source Code Viewer, check out the source code viewer in MSDN.

Visual Studio .NET 2003 Posters

Monday, October 13, 2003 10:45:18 PM (GMT Daylight Time, UTC+01:00)
You can find the posters here.

Microsoft Log Parser 2.1

Sunday, October 12, 2003 11:42:33 PM (GMT Daylight Time, UTC+01:00)
Log Parser 2.1 is available for parsing a variety of logs. Including IIS logs. It comes with a COM API.

Downloads

Wednesday, January 01, 2003 6:00:00 AM (GMT Standard Time, UTC+00:00)
Here are a list of downloads from the this site:
 
Great for template engines or writing your own evaluation parser, I had attempted a number of times to do it in Regular Expressions with no luck.  The main problem being I couldn't get it to go N levels deep.  Here is a post that gives it a little more background.  The code could be optimized a bit more, but it works.
 
Implemented using C# and the HtmlAgility pack this library helps you download html pages and put them in mht format.  You can read more about it here.
 
Basic form for posting to your dasBlog site written in InfoPath.  You can author offline posts and post them to dasBlog once you are back online.  You can only post new entries, it currently does not implement the editing of existing entries.  Its pretty basic but it works well.  If you have problems getting it setup send me an email (shannonATconceptbench.com).
 
Ever need to create seed data.  If you do, this class will help you randomly create names of people to populate your system for testing.