Mike Taulty's Blog
Bits and Bytes from Microsoft UK

July 2008 - Mike Taulty's Blog

Blogs

Mike Taulty's Blog

Elsewhere

  • Silverlight 2 Beta 2 - ASMX Services & XmlSerializer

    It wasn't clear to me from reading the Silverlight SDK docs whether or not you could call ASMX services from Silverlight 2 Beta 2 if calling those services meant involing the XmlSerializer. Silverlight is using WCF to call services and WCF usually uses the DataContractSerializer. This is a clever serializer but one of the things that it doesn't do ( which I never understood the rationale for ) is serialize XML attributes. It is as element-centric as a serializer can be. So, I read in the Silverlight SDK docs; Using XmlSerializer Silverlight 2 Beta 2 supports XmlSerializer . The equivalent serialization support in WCF is described in XML and SOAP Serialization . In Silverlight 2 Beta 2, generating SOAP messages as described in the preceding document is not supported. and I didn't understand whether those 2 sentences combined to say "Supported" or "Not Supported" . Having read it twice, I think what it means is that the XmlSerializer bits are supported but the bits referenced here are not. That's what I think it...
    Filed under: ,
  • Silverlight 2 and HTML 5 - Being Online/Offline ( Part 2 )

    Following up on this post , it seems that there's more to this online/offline malarky in HTML 5 in that this; http://www.w3.org/TR/2008/WD-html5-20080122/#appcache talks about Application Caches. As far as I can work out, that's to do with providing more of a manifest around what pages/resource need to be cached in order to make the application work well when run entirely from the cache offline. I was wondering how this would work with Silverlight so I thought I'd try an experiment using that base class that I wrote in the previous post . Let's say (for argument's sake) that I want to build a simple email client in Silverlight. So, I want a UI with fields such as TO, CC, Subject, Body and I have some webservice that'll actually do the emailing for me. I want to be able to do this whether I am online or offline. Maybe I want a UI something like this; The idea being that you write a mail and when you click Send we either; If we're online, call the webservice. If we're offline, store the mail in IsolatedStorage and...
    Filed under: ,
  • Silverlight 2 and HTML 5 - Being Online/Offline

    One of the things that's coming in IE8 and is already present in FireFox 3 as far as I know is HTML 5's ability to detect whether the browser is online or offline and to provide some offline storage ( alongside cookies ) for the application. You can find some details about that here; http://www.w3.org/TR/offline-webapps/ It occurred to me that this might be pretty useful to pick up from Silverlight and so I wrote a little base class for an application which would surface this info. I didn't go into the "offline storage" idea because I can't really see the point with Silverlight because it already has IsolatedStorage which would work regardless of whether the browser can currently see the network or not. Here's the class, very simple. If someone knows how I answer my TODO: then please let me know - I'm not "great" at Javascript; namespace SLOnlineOffline { public enum NetworkStatus { Online, Offline, Unknown } public class NetworkStatusEventArgs : EventArgs { public NetworkStatus NetworkStatus { get; set; } } public...
    Filed under: ,
  • Dell Hybrid

    Dell's got a (reasonably) nice looking little machine that might make a nice Media Center. I run ( Vista ) Media Center under my TV on a Shuttle box ( search the blog for Shuttle you'll find the specs ) every day and it works extremely well. For me, Media Center is one of the bits of Vista that it's very easy to point at and say "This is way better than it was on XP". However, I think it's true to say that I spec'd the Shuttle for XP and not for Vista. Whilst it runs Vista well enough it doesn't quite zing when it comes to the Media Center UI ( I think I turned off a bunch of transitions way back ) and I was using one of these Sony boxes in a shop the other week and it highlighted to me that my performance with Media Center could be better. Hence...the look at the Dell Hybrid. I'm not sure it'll quite work for me though as; I'm not sure whether the integrated graphics will cut it or not. It looks to accept no internal cards so I'm not sure how I'd get a TV tuner into it. I guess I could find one of those USB tuners...
    Filed under:
  • Using Excel as an XML Editor

    In a couple of instances recently I've had cause to take data that exists in an Excel spreadsheet and save it out as XML and, whilst it's slightly off-topic, I thought I'd share as I find it "enjoyable" :-) I don't mean as a .XLSX file but, rather, as an XML file according to my own schema. Let's say I sketch out some XML file format by running VS and coming up with something like; < videos > < video title ="Using Excel for XML Editing" author ="Mike Taulty" duration ="120" /> </ videos > I can then get Visual Studio to infer a schema from this giving me something like; <xs:schema attributeFormDefault= "unqualified" elementFormDefault= "qualified" xmlns:xs= "http://www.w3.org/2001/XMLSchema" > <xs:element name= "videos" > <xs:complexType> <xs:sequence> <xs:element name= "video" minOccurs= "1" maxOccurs= "unbounded" > <xs:complexType> <xs:attribute name= "title" type= "xs:string" use= "required" /> <xs:attribute name= "author" type= "xs:string" use...
    Filed under:
  • Silverlight 2 Videos on Silverlight.net

    Nice to see that the videos that Mike and I made on Silverlight 2 are now on Silverlight.net up here; http://silverlight.net/Learn/videocat.aspx?cat=10
    Filed under:
  • Added (Updated) ADO.NET Data Services Videos to C9

    I produced a new set of short videos around ADO.NET Data Services and dropped them on to Channel 9. You can find them here; http://channel9.msdn.com/tags/UK and that list will grow as time goes in ( specifically, it'll grow if I can get the publishing system to publish my next 4 videos for me as it's not playing ball at the time of writing :-) ).
  • Don't Steal My Focus

    I've been encoding videos today with Expression Encoder 2. I load up a batch of videos and set them transcoding. This takes ages and burns CPU cycles like nobody's business - at times like this you wish the age of quad-core, eight-core and so on was already mainstream. I get quad-core effects by using the 2 cores on my laptop and the 2 cores on my desktop :-) Anyway, I'd left it running for maybe 8-10 hours and it was nearly done on all the videos when Outlook popped up its reminders window and I tried to dismiss it by hitting ESC. Unfortunately, the ESC went to the wrong window. It went to the Expression Encoder 2 window which promptly cancelled the job and, even worse, deleted all the files that it had transcoded as part of that job so far . Bad marks all around; Bad marks to that Outlook reminders window for being so "needy". Bad marks to Windows for letting that Outlook reminders window annoy me. Very bad marks to Expression Encoder for assuming that pressing ESC on their UI means; Stop the current encoding...
    Filed under:
  • Experiments in Building a Silverlight Photo Control ( Part 4 )

    Following on from this post , I wanted to see what would happen if I opened my solution in Expression Blend 2.5 June Preview and tried to style my control a little. So, I opened it in Blend. I got a bit stuck straight away because when I tried to display my page.xaml Blend threw up an error; From the stack trace, this looked suspiciously like some of my code running to load images when it really shouldn't be inside of a design time environment like Blend. So, I added a little member function to my control; private bool IsInDesignMode { get { return (DesignerProperties.GetIsInDesignMode( this )); } } and called it from a few places to stop the control trying to load images and so on if it's in design mode rather than run-time mode and Blend sprung into life; Now...to try and set about styling the control. First off, I created an empty template for my control; Then I took the Grid that's given to me; and replaced it with a StackPanel, some Buttons , an Image and a couple of other bits and pieces to create my UI...
    Filed under: ,
  • SQL Bits III

    I've managed to submit a session for SQL Bits III in Hatfield on Saturday the 13th September. If I manage to make the vote then I'll be talking about ADO.NET Data Services as a way of ( productively ) exposing CRUD access to your data over RESTful web services and probably doing a bit of explanation around RESTful whilst I'm there along with talking about consuming those services with AJAX and .NET clients. I spoke at the last SQL Bits and it's a cool conference - if you're interested in coming along then check out; http://www.sqlbits.com/ and if you're interested in coming along to my session then you need to vote for it on this page ( otherwise it may well not happen! ); http://www.sqlbits.com/information/publicsessions.aspx
    Filed under:
  • Experiments in Building a Silverlight Photo Control ( Part 3 )

    Following on from this post , and with reference to these posts by scorbs and this one by Ian, I thought it was time that my control got some states. I didn't want to be too ambitious with this so I figured that my control perhaps just needed some basic states which seem to be fairly common across all controls. I put these into two groups ( just like they are for the built-in controls ); CommonStates Normal MouseOver Disabled FocusStates Focused Unfocused I also came up with a bunch of ImageStates but, after playing around with that, I've not implemented them properly yet. One of the things that surprised me about adding these states is that I found myself having to teach my control how to know whether it is currently in a mouse-over state and whether it has focus and so on whereas I was kind of expecting these to be common enough to be built into a base class. So, for instance, in order for my control to do the focus/unfocus thing I ended up; Adding a dependency property to the control - IsFocused. Sync'ing up...
    Filed under: ,
  • Experiments in Building a Silverlight Photo Control ( Part 2 )

    Following on from this post . I wanted to make sure that I only ever had a maximum of [Previous, Current, Next] images loaded in my control whilst still pro-actively trying to load an image as a user "heads towards it". That is, if the user is on image N then I want to try and make sure I've already loaded N-1, N, N+1 as a way of making sure I've got their "next" image already. How to do that? Previously, I just kept a Dictionary<int,MemoryStream> around where the int is the index of the image and the MemoryStream is the bytes of the image and this Dictionary would just grow and grow. There's only one place in my code where I add to that Dictionary so ( rather than going off and building some LRU Dictionary class ) I just made sure that if my dictionary has grown a little large then I just trim it. Whilst there, I decided that using a Lambda statement for the completion of WebClient.OpenReadCompleted was a bit ugly so refactored that into a separate function as well. I also noticed that I'd added 2 DependencyProperty...
    Filed under:
  • My Silverlight and WPF Dream

    I've been having this dream about Silverlight and WPF. Alright, I haven't :-) But, I've talked to a few people about Silverlight and WPF integration recently and I have this vision in my head of what I'd really love to see. Now, don't get me wrong - to the very best of my knowledge this absolutely isn't going to happen and I've never heard mention of any plan anywhere to do this kind of thing but, hey, I can still dream? It runs like this. I'm sitting on my PC. I visit a site that has a Silverlight application like this one; I notice that it's a Silverlight application and, because I'm running on Windows, the browser could offer me some kind of UI functionality to suggest that I can drag this Silverlight Application out onto the desktop; and then ( in my dream ) you drag this application to the desktop. At that point the platform does a check to see; Are you running with .NET Framework V3.0 above installed? if not, it prompts you to install the .NET Framework V3.0 bits ( I guess you'd need to be on Windows XP...
    Filed under: ,
  • Experiments in Building a Silverlight Photo Control ( Part 1 )

    On web pages, you often see a control that displays a set of pictures with a list of the total number of pictures and a next/previous button to move between them. MSN has one that looks like this; and I kind of fancied using this as a means to play with a Silverlight control that did the same thing. What interests me about it is that my control clearly needs to; Display an image Display a Next and Previous button Display a "M of N" piece of text but it doesn't really need to know very much about how to display the image and so on. It can (hopefully) be nicely templated to avoid that kind of knowledge. That's what I wanted to play with. Now, naturally, you could build a control like this so that it dynamically loads which images to display via some web service or maybe via a plug-in interface ( IProvidePictures? ) that you configure at the time of use but I wanted to keep it simple so I figure that ( in pseudo code ) I'd like to see the XAML for my control look something like; <PhotoControl> <PhotoControl...
    Filed under:
  • Channel9

    I've been posting some of my/ Mike's Silverlight 2 B2 videos onto Channel 9. The page is here; http://channel9.msdn.com/tags/UK I'm hoping to use that page as a central place for video publishing going forward and possibly adapt it to other uses as well if that's a possibility. We'll also be copying some of the videos which are still useful in 2008 from; http://www.microsoft.com/uk/msdn/screencasts/ to Channel 9 and then adding new ones. "Stay Tuned".
    Filed under:
1 2 Next >