.Net blog of Sijin Joseph
My experiences with .Net
-
Reusable MessageBox component
I've just posted my first article on CodeProject at http://www.codeproject.com/cs/miscctrl/MessageBoxEx.aspIt's reusable and customizable Message Box component that allows you to add custom buttons, icons, fonts and provides "Don't ask me again" functionality.
-
Tool for analyzing .Net assemblies
NDepend analyses .NET assemblies of an application and generates design quality metrics. NDepend allows you to automatically measure the quality of a design in terms of its extensibility, reusability and maintainability to effectively manage and control the assemblies’ dependencies of your .NET applications. Moreover, NDepend helps you to get a thorough view of the topology of your application, at component at type and at member level.
Check out the sample report they have on the site. Really cool indeed.
http://smacchia.chez.tiscali.fr/NDepend.html
It's been developed by the same guy who has written this excellent article on iterators in C# 2.0 that not only talks about iterators but also about some cool ways to use iterators in your applications.
http://www.theserverside.net/articles/showarticle.tss?id=IteratorsWithC2
-
Windows keyboard shortcuts at Neowin
Neowin has a nice post on keybaord shortucts for windows
http://www.neowin.net/forum/index.php?showtopic=251731
-
Cool firefox stuff
Do you want a build of FireFox 1.0 that is optimized for your processor? You can get it at
http://www.moox.ws/tech/mozilla/firefox.htm
Also one cool FireFox wallpaper
http://www.wincustomize.com/ViewSkin.aspx?SID=1&SkinID=21787&LibID=8
-
Richard Grimes has stopped writing on .Net
I was just looking for the great workshop on Fusion written by Richard Grimes I saw on the front page of his site that he has stopped writing about .Net. That was quite odd considering that he has written some great articles and books on the subject and is a regular speaker in various events. Googling revealed that he has written an article in DDJ detailing his departure from .Net.
You can read his thoughts on why he does not want to associate with .Net anymore here. You'll need to register to read the article.
-
Cool class of the day - ISerializationSurrogate
I was doing some research in custom XML serializaton in .Net. The problem is the same as the O-R problem for database persistence, the difference here is the level of support that .Net provides in helping with that serialization. I stumbled upon a great site for XML related information http://www.topxml.com and while going through some tutorials on that site came across this cool class called ISerializationSurrogate. You can read more about it here http://www.topxml.com/xmlserializer/surrogateselectors.asp
Basically it allows you to move the serialization code away from the object being serialized. A class that implements this interface can act as a surrogate for the class that it serializes. So that's another hook you can use to customize your serialization.
-
del.icio.us
A couple of days back i was looking for an online bookmark manager, i found some really good and free ones but the one that caught my eye was http://del.icio.us . It is a social bookmark manager, what that means is that when you add a new bookmark you can see what category other people have added that link in, you can then see other bookmarks in that category to discover new sites related to the one you are bookmarking. The best thing is that all these categories are available as RSS feeds, so you can subscribe to the feed for that category and whenever anyone adds a bookmark in that category you get notified. Not only that you can subscibe to the most popular bookmarks in a paticular category.
Here is the help that describes the RSS feeds that are available
» del.icio.us offers you many ways to view your own and other people's bookmarks. Understanding how del.icio.us URLs work makes it easier to see exactly the bookmarks you want.» Every user has a unique homepage:del.icio.us/geoffrey
» Tags also have their own pages:del.icio.us/tag/politics
» You can filter bookmarks by user and tag together:del.icio.us/geoffrey/literature
» This will show all bookmarks from user geoffrey tagged as 'literature'.» Use plus signs to combine multiple tags into a tag intersection:del.icio.us/tag/politics+france+history
» This will display only bookmarks that have all three of the tags 'politics', 'france', and 'history'. This also works for user/tag combinations:del.icio.us/geoffrey/literature+english
The interface is a bit spartan with almost no images at all. But the site is fully functional. I've already discovered some cool sites using this. It works in Firefox as well as IE and other browsers via a bookmarklet, pretty easy to setup. This is one cool concept.
-
What a wierd bug or feature?
A couple of days back i was working on an app, when i came across this problem. So the thing is that there are two events in DataTable, one is called OnRowChanging and the other is called OnRowChanged. Well i figured since i wanted to access the newly added row in the table OnRowChanged would be a good choice. Well as it turns out the row isn't added to the table in the OnRowChanged event infact there is no event which you can catch after the row has been added to the table. Now is that a bug or is it by design?So the workaround that i had to do was to get the row from the DefaultView of the table. The defaultView needs to have the newly added row so that any controls that are bound correctly show newly added rows. -
VSS Automation script
In our company we have a policy of creating a checkin mail that describes the files that you are checking in and what changes or bugs have been fixed in that checkin. The process of creating the mail involved opening VSS and then getting a list of all checked out files and then copying and pasting that to the mail. I've always wanted to get into windows scripting and i thought what better oppurtunity than this. So i wrote this small script that gets a list of all checked out files from VSS and then creates a new mail with the required info already filled in.var oVss = new ActiveXObject("SourceSafe");
oVss.Open("<Insert path to srcsafe.ini>");
var oProj = oVss.VSSItem("<Insert project path e.g. $/");
var allProjects = new Array();
allProjects = GetAllProjects(oProj,allProjects);
var output = "";
var projItem;
var projEnumerator = new Enumerator(allProjects);
for (; !projEnumerator.atEnd() ; projEnumerator.moveNext() )
{
projItem = projEnumerator.item();
var checkouts = GetCheckedOutFiles(projItem);
if(checkouts.length > 0)
{
output += projItem.Spec + "\n";
var checkoutEnumerator = new Enumerator(checkouts);
for(;!checkoutEnumerator.atEnd();checkoutEnumerator.moveNext())
{
var checkoutItem = checkoutEnumerator.item();
output += "\t" + checkoutItem + "\n";
}
output += "\n";
}
}
var olApp = new ActiveXObject("Outlook.Application");
var mailItem = olApp.CreateItem(0 /*olMailItem*/);
mailItem.Recipients.Add("<Insert e-mail address to send mail to>");
mailItem.Body = "\n" + output;
mailItem.Display();
function GetCheckedOutFiles( projectItem )
{
var checkouts = new Array();
var itemEnumerator = new Enumerator(projectItem.items(false));
for(; !itemEnumerator.atEnd(); itemEnumerator.moveNext())
{
var item = itemEnumerator.item();
//File
if(item.Type == 1/*VSSITEM_FILE*/ && item.IsCheckedOut == 2 /*VSSFILE_CHECKEDOUT_ME*/)
{
checkouts.push(item.Name);
}
}
return checkouts;
}
function GetAllProjects( rootItem )
{
var projects = new Array();
var items = new Enumerator(rootItem.items(false));
for(;!items.atEnd();items.moveNext())
{
var item = items.item();
//Project
if(item.Type == 0 /*VSSITEM_PROJECT*/)
{
projects.push(item);
var subProjects = GetAllProjects(item);
var subProjectEnumerator = new Enumerator(subProjects);
for(;!subProjectEnumerator.atEnd();subProjectEnumerator.moveNext())
{
var subProjectItem = subProjectEnumerator.item();
projects.push(subProjectItem);
}
}
}
return projects;
}
function printItems(items, prop)
{
var itemEnumerator = new Enumerator(items);
for(;!itemEnumerator.atEnd();itemEnumerator.moveNext() )
{
var item = itemEnumerator.item();
WScript.Echo(item[prop]);
}
} -
What a way to start the new year..
On 3rd January i got a mail from Microsoft saying that i had been selected as an MVP for Visual C# , now that is some new years gift. I am waiting for my first set of MSDN Universal DVD's ... woot :)