web metrics
October 2007 - Posts - Technoeuphoria!

October 2007 - Posts

Live Surprises

* warning: screenshot fest*

 

I was browsing around Windows Live today and found a few more pleasant surprises on Windows Cardspace technology. Browse through below if you just want to find out how to try it out. Windows Cardspace, although it is still a budding technology in a sense that not many have adopted the technology yet, is quite an interesting authentication mechanism. I'd previously blogged about it from the session I'd attended at TechEd Malaysia. If you want to know more about cardspace, you can check out http://cardspace.netfx3.com

 

*screenshot fest starts here*

imageSo for those of you using Windows Vista, and if you accidentally type in and launch cardspace from your instant search and are wondering what on earth it's for, now's your chance to try it out! If you try to login to one of the many Live Services out there like Live Spaces or Live Hotmail,  you're now actually given the option to sign in using your Information Card. If you click the option and click on Sign, you'll actually be prompted to select which information card you want to send over to the the web site.

  image

When you select information and click sign in, and if you haven't used and Infocard with the Live ID before, you'll probably get something like this:

image

You can now click on "add an Information Card to your account". What this does is it will ask you to log in with your password then basically associate an Infocard with your account.

 

image

image

image

 

image

image

 

When selecting the Infocard to use, you can actually use the same card with multiple accounts, say one card you use for your personal accounts, and another for you business accounts.

 

Speaking of multiple accounts...

If you go to http://account.live.com you'll find a new link available, that will allow you to link multiple Windows Live IDs together.

image

when you click on the link, it will take you to this page that allows you to key in your credentials.

image

 

Once you've associated your accounts, you'll be able to switch between your Live accounts by clicking on your ID on the upper right corner once you're logged in to any one.

 

image

Posted by jocelyn | with no comments

Pimp my Outlook!

// leave it to jocelyn to reinvent the wheel and build a solution for herself rather than check to see if it already existed :p
// yes, the product team know their stuff, please do not bother re creating the project as this feature already exists. This is for
// demo purposes only :)

I love the integration between my Windows Mobile and my Outlook contacts. I diligently maintain my contacts in Outlook so I can make sure that when I'm on the road and one of my partners call me, I'd have all their business information at hand in case I need to locate them, send something over, etc. Every time I visit a new partner, I come back to the office with a stack of business cards from different people in the organization. I make it a point to add each and every one of them into my contact list. After a while, it felt quite dumb to add different people with the same company name, web and office address, notes etc. True, it's just a few fields but a few multiplied by, say, 10 people in the company is quite taxing, even if it's a copy paste job. So I finally got the spare time today to sit and build something to solve this little problem -- create an outlook add-in.

Last time I tried building an office add in were in the days of VSTO for VS 2005 where you had to manually define the Ribbon in XML, etc. Quite easy actually, but with all the other things I was doing, I couldn't bring myself to sit on it. Now that I heard all that was fixed in VS 2008, I made time for it today. The only difficult part was finding out which object / method creates a new contact, and which ones access the current ones. Hooking it up to the ribbon was a no brainer. So here's what I did:

1. Fire up Visual Studio 2008 and create an Outlook Add-in project

image

2. Right click on your project and select Add -> New Item...

image 

3.  To find the appropriate item easier, first click on Office then Ribbon (Visual Designer)

image

4. Now you can start visually designing the Ribbon interface. Since this is an Outlook add-in, there will be multiple ribbons to choose from: the ribbon that appears when creating/editing mail, contacts, appointments, etc. In order to specify which one you want to customize, right-click on the ribbon control and view it's properties. The RibbonType is the property that you will want to specify in order to customize the ribbon you want. In this example, I've selected the Microsoft.Outlook.Contact ribbon. (you may, by the way, select multiple ribbons if you want)

image

 

5. Now you're all set to use the same drag and drop designer to create your Ribbon UI, much as you would with the forms designer. In this example, I've simply edited the tab name, the group name and added a button to my group. Putting additional tabs and controls, again, is the same experience as in a Windows Forms design experience. And to add functionality to my button-- yep, you guessed it, double click. This will hook up my button to my code.

image

 

6. Now for the code. I've commented on the lines that I've added. all the rest, I left as defaults. If you're wondering, yes the namespace and some identifiers changed for this project, I wanted to make it a bit more descriptive :)

image 

7. Hit F5! (of course, I'd have to have Outlook 2007 installed here ) I can now see my custom ribbon visible:

image

And clicking on it will give me a new dialog, with all the details I specified copied over. The addresses are usually the pain in the *** so that I prioritized.

image

If you're wondering what that FormRegion1 at the bottom of the window is, that's another control that you can use to customize on top of Outlook. It's basically much like a panel that you can stick your custom user controls into. Form more flexibility on customization, use the Outlook Form Region as your canvas for your components.

image

Have fun!

p.s. It took me longer to blog about this than to code it.. maybe i should create a live writer plug-in for this. nyehehehe

Innovate On Windows Server Today!

clip_image001


If you're building on Windows Server 2008, we've just launched a program that help you plan, build, test and promote your solutions. Check out the resources available at http://innovateonwindowsserver.com/

Posted by jocelyn | with no comments
Filed under:

Post MSDN Tech Talk: Introduction to Language Integrated Query

Okay, I didn't have any slides today, and I redirected people to this blog this morning. So allow me to summarize the main points that I discussed. I also have some links to external resources where you can get more information on LINQ. This is actually a repost from my previous entry .

  • Automatic Properties, Object Initializers, and Collection Initializers *
  • Extension Methods
  • Lambda Expressions
  • Query Syntax
  • Anonymous Types *
  • * Compiler tricks that you can make use of even if your target framework is .NET 2.0 thanks to multi-targeting feature of Visual Studio 2008

    LINQ
    The LINQ Project -  MSDN Portal where you can find all the information to find out more about LINQ (yes there is a LOT of content ;) )
    IQueryable vs IEnumerable 

    LINQ to SQL
    LINQ to SQL This channel 9 video should be give you an overview of what LINQ to SQL is
    Scott Gu's entries on LINQ to SQL 

    VB 9.0 + VB XML support
    Overview of VB 9.0
    Erik Meijer Shows Us His Favorite Visual Basic 9.0 Feature - XML Literals

    C# 3.0
    C# Version 3.0 Specification

     

    I'm sure this will be enough to get you guys started. Will be posting more stuff on the new technologies soon :)

    Posted by jocelyn | 3 comment(s)

    Windows Live Events!

    http://home.services.spaces.live.com/events/

    For those of you who like hosting parties, night outs, etc. here's a really good new service that allows you to post event details, invite and keep track of guests attending, add to calendar functionality that supports outlook, apple ical, yahoo and google calendars too. It also provides you a place to upload event photos.

    Okay, now to plan for a party... ;)

    image

    Posted by jocelyn | with no comments
    Filed under:

    Partial Classes & Partial Methods

    If you're working with LINQ to SQL, you'll probably want to take advantage of the partial methods.

    This Channel 9 video gives a concise overview of how you can implement the concept of partial methods.

    Basically, partial methods allow you to create hooks from within your functions that will give an option to extend these functions. First let's establish the rules when implementing partial classes:

    1. Partial methods for C# cannot have any access modifiers. (in VB, access modifier must be private)

    2. Partial methods must be declared within partial classes or partial structs

    3. Partial methods must have a void return type and cannot have out parameters

    4. You can only implement partial classes once.

    To illustrate, (in a very weird way), I've modeled a simple Developer in terms of location, hygiene and energy. Let's say, in my implementation, I don't really care if my developer takes a bath or not, but I'm aware that some people out there *might* prefer their developers to be taking baths before they go to work and before going to bed. So let's say I'm considerate enough to allow that kind of extension in my code. I can do that by making calls at specific points in my code to a partial method TakeBath() that I declare in my class, which also has to be partial as per Rule #2. This will allow other people to create another partial Developer with the implementation part of my TakeBath() partial method.

    image

    So I take this definition and create my new Developer. Thanks to object initializers, even though I didn't implement an appropriate constructor to assign default values to my Developer, I can easily initialize these values upon creation.

    image

    As you can see, my developer is able to regain his energy after a GoToSleep(). Unfortunately, we can't say much about his hygiene.

    image

    After years of integrating my Developer into several projects, solutions, etc it might someday dawn on me that my developer seriously needs to TakeABath(); knowing that a lot of projects and solutions are making use of my Developer, I wouldn't want to rebuild him at the risk of breaking him. Thanks to partial classes, (and my forward looking implementation of it in my Developer code) I can simply create a partial Developer class that will take on the challenge of implementing Taking a bath.

    When I create my partial class VS2008 will even tell me what methods I can implement

    image

    So I flesh it out like so...

     

    image

    And at the end of the day, I can have my Developer fresh and clean and sleeping soundly.

    image

     

    On a more serious note, if you make use of LinqToSql to generate entity models for, let's say, the Customers table in the Northwind database, the OR Designer generates code to declare these partial methods that you can use to implement validation logic before and after the fields of the table are updated.

    image

    Watch the Channel 9 video, it gives quite a clear explanation of partial methods. It also differentiates using partial methods vs using Event handling to implement these hooks as well how it is different from just using the conditional attribute onto your methods.

    By the way, this is something new in VS 2008 but you can very well make use of if you target .NET 2.0 projects. As the video mentions, it's one o' dem "compiler tricks" :)

     

    Yes, I'm bored.

    Posted by jocelyn | with no comments
    Filed under:

    MSDN Tech Talk Oct 16, 2007

    I'll be having a session on LINQ during next week's MSDN Tech Talk. Check out Chewy's blog for more details. See you there!

    Posted by jocelyn | with no comments
    Filed under:

    Windows Live SWEET!!!

    I was pleasantly surprised when I downloaded the updated beta version of Windows Live Writer when I was given the option to install other components of the Windows Live Suite.

     image 

    If you want to skip the hooplah and try it out yourselves, just go to http://get.live.com/en-us/betas/writer_betas and download the installer on the page. It should take you to the point where you can select what to install. As you can see, i've installed everythngi, just so i can check which ones make sense for me. Let me talk a bit about some of them too.

     

    Windows Live Writer

    image

    This one, I have been using for quite some time already. You see, I'm one person with a LOT of blogs. i usually sign up for anything and everything new when it comes to online publishing. So, number one, I have a lot of blogs to maintain: Personal blog, Technical blog, Rant Box blog,personal blog with different audience, Personal blog for more profound content, you get the idea. WLW lets me setup all my blog accounts with this one application so I don't have to remember all the URLs + username and password combination when when I decide to blog among sites.

    Second, sometimes I find really conducive places for blogging, but not all the time do they have Internet connection. So until Windows Live Writer came out, I save my posts in notepad and take note of the time and date to copy paste to my blog site later on. TEDIOUS! Especially when I had pictures to incorporate on my blog. With WLW, you get the WYSIWYG editor to integrate pictures into your post. And because WLW caches my blog style, I can straight away see how my post will look once I publish it online. Very helpful especially when you post a lot of pictures. Tags and categories can also be set offline and finally, you can preset the publish date so once you hit publish, you post registers to the time you were actually writing it. That's what I call "LIVE" writing ;)

    Third, tight integration with Windows Live Spaces removes the worry of having to upload you pictures to 3rd party sites because it straight away knows to upload into your photo album. Not using Windows Live Spaces? Not to worry! WLW gives you the option to associate an FTP server to host your pictures so you just have to set it up one time, and WLW takes care of the rest.

    WLW works marvelously with most of the popular blog providers. I have yet to see a provider that has trouble integrating with it.  So try it out today, you will want to try the other applications in the Windows Live Suite.

    Windows Live Mail

    image

    *the error is because I've forgotten my aimakz@gmail password :p

    I don't only have multiple blog accounts, I also have multiple email accounts, yes, including a Gmail one. :p And no, I never check all of them because it's too tiring to keep logging in and out of one site, then logging in and out of another site. Not to say that i'll be reading all of that unread mail but, at least now, I only have to open up one application for it all. Too bad you need to have yahoo mail plus to use this with yahoo though. Except for Windows Live Hotmail, it needs to have POP mail access enabled.

    It also makes for a good RSS reader (Please pardon my feeds, I have a problem with sorting, just like i do with my mail :p)

    image

    As well as newsgroups reader

    image

    Now I won't need a book when I'm on the bus/plane. I just need a machine with a really long battery life :p

    Windows Live Photo Gallery

    image

    I haven't had the chance to explore it fully yet, but one feature that caught my eye is the ability to publish to WLS and MSN Soapbox straight from with the application. Wonderful!!

     

    As all these apps are still on beta, there will definitely be changes. I'm excited to see what else is coming. At this point, Windows Live -- Sweet!

    Update:

    I just saw a demo with Live Photo Gallery to create panoramic photos out of photos you take. It comes out quite well! gonna try take photos later and post here :)

     

    image

    Posted by jocelyn | 5,880 comment(s)
    Filed under:

    Some .NET 3.5 features application

    It's been a while since I got time to read up on some blog posts and I stumbled on some interesting posts (which you guys probably have already read but I'm posting them anyway) that show how the new features of the .NET 3.5 framework can be put to practical use.

    Check out this post by Scott Guthrie, it shows a good application of extension methods to add "syntactic sugar" to your code

    Tip/Trick: Building a ToJSON() Extension Method using .NET 3.5 - ScottGu's Blog

    Kirk Allen Evan's posts on how to use LINQ and .NET 3.5 to convert rss to json.

    http://blogs.msdn.com/kaevans/archive/2007/09/04/use-linq-and-net-3-5-to-convert-rss-to-json.aspx

    Pretty cool stuff!

    Posted by jocelyn | with no comments
    Filed under:

    IQueryable vs IEnumerable

    At the most abstract level, LINQ (Language Integrated Query) can query against two types of provider: IEnumerable, which is virtually any collection type in the .NET Framework and IQueryable object such as LINQ to SQL, or Entities, or XML objects.

    For the first case, you're actually leveraging the framework to do the dirty work of your filtering, projection, etc. With the second case, you're passing the burden of running the query to your provider. What happens when you make a LINQ query to an IQueryable object such as a LINQ to SQL data context, your LINQ query gets translated into the appropriate SQL syntax and gets passed off to your database to execute, once the query is iterated over.

    With that in place, anyone can extend LINQ to apply to their own custom defined data stores. If you want more information on how to create your own IQueryable provider, checkout this blog series: http://blogs.msdn.com/mattwar/archive/2007/07/30/linq-building-an-iqueryable-provider-part-i.aspx

    But bottom line, regardless of your data source, your LINQ query syntax still remains the same.

    LINQ will definitely improve the way developers deal with data into a more streamlined manner.

     

    I'm using
    VS08_h_rgb_r 
    Get the Beta 2!

    Posted by jocelyn | 1 comment(s)

    Expression Blend 2 September Preview

    In case you missed it (I certainly did :p)

    http://www.microsoft.com/expression/products/download.aspx?key=blend2preview

    What’s new in this preview?

    Visual Studio 2008 support

    Making Controls from Existing Objects

    Split View and XAML Editor Improvements

    Storyboard Picker

    Storyboard and Keyframe Properties

    Vertex Animation

    Breadcrumb Bar

    Font Embedding

    Build Options

    Object Manipulation

    Posted by jocelyn | 5,803 comment(s)
    Filed under: