Xml Comments in Include Files#

Eric Gunnerson points to the C# documentation on include files in xml comments. These allow you to use external files for your xml comments - which can be convenient if you have a separate team managing the documentation. I wonder if this feature is used anywhere outside Microsoft itself actually - I'd sure love to have someone write the documentation for me but unfortunately I don't have that luxury ;-)

Tuesday, October 21, 2003 9:58:14 AM (Romance Standard Time, UTC+01:00) #    Comments [0]  | 

 

Ingo Rammer's Architecture Briefings#

If you're doing anything in .NET (especially when you're dealing with interconnecting systems and using Web Services or .NET Remoting), I'd keep an eye on Ingo Rammer's Architecture Briefings if I were you.

Tuesday, October 21, 2003 9:46:22 AM (Romance Standard Time, UTC+01:00) #    Comments [0]  | 

 

Pager Control for ASP.NET#

There's a cool Pager Control on MSDN that lets you add paging to databound ASP.NET controls other than the DataGrid. Looks pretty good!

Tuesday, October 21, 2003 9:43:21 AM (Romance Standard Time, UTC+01:00) #    Comments [3]  | 

 

Converting between C# and VB.NET#

If you're planning on switching languages, or if you have some code you want to integrate (i.e.: steal/copy/paste) in your project, you already had a tool to convert C# to VB.NET - but now you can also convert VB.NET to C# online. Nice.

Tuesday, October 21, 2003 7:52:03 AM (Romance Standard Time, UTC+01:00) #    Comments [0]  | 

 

Why do abstract classes need to implement interface members?#

Why can't I do this in C#:

public abstract class Base : ISerializable { }
The compiler complains that Base doesn't implement the methods necessary for the ISerializable interface. But who cares, it's an abstract class - it's not supposed to implement all members. It would make sense to me to be able to require that derived classes of my base class implement certain interfaces but without providing abstract methods for all of their members already.

Now I have to go:

public abstract class Base : ISerializable
{
    public abstract void GetObjectData(SerializationInfo info,
StreamingContext context);
}
which is pretty lame if you need to do this for a number of methods or interfaces...

Monday, October 20, 2003 1:05:11 PM (Romance Standard Time, UTC+01:00) #    Comments [1]  | 

 

Clearing The Blog Buffer#

Woohoo, quite a lot of posts already today as you may have noticed ;-) I'm just clearing out my blog buffer with some unfinished posts I had lingering about...

One of the reasons I'm clearing the buffer is also because I've been checking out another blog engine - dasBlog - and I'm hoping to switch to it pretty soon. I'd be hosting my entire site in it (not just the blog) so I still need to check some things out but I think it should be possible. Hey Clemens pulled it off for the newtelligence website so that should basically cover my feasibility phase ;-)

The drawback is that I'd have to update my server to be able to run IIS/ASP.NET (I'll still be using Apache/PHP for my webmail and other services though), and basically import all my posts into DasBlog (especially crosslinking to other posts will prove to be tricky I guess). An intelligent "Import RSS" feature would be so great to switch weblog engines... And to make it totally generic: some app that reads the rss from the old blog, updates the (internal) links, downloads media files, and imports the posts and media into the new blog using a webblog api. Does anyone have some spare time?

Monday, October 20, 2003 10:36:55 AM (Romance Standard Time, UTC+01:00) #    Comments [0]  | 

 

MenuItems#

In Windows Forms, you can only add strings to be displayed in a menu. It would be a lot easier if you could add entire objects to a MenuItem, which could override their ToString()-method to determine the way to represent them in the menu item. For instance, you may want to map menu items to objects so that when the menu item is clicked, you immediately get the correct object in the event handler's sender object. Now, there is no way to associate an object with a menu item.

As a solution, you could consider subclassing the MenuItem class and adding a Tag property that can contain any Object. It is impossible to override the Text property of the MenuItem class so you must set the Text property to the tag object's ToString() value at construction or when the Tag property changes. Now when you listen for the Click event of the MenuItem, cast the sender to your MenuItem subclass and obtain the associated object through the Tag property.

Code sample for a generic MenuItem class with a Tag property:

public class TaggedMenuItem : System.Windows.Forms.MenuItem
{
    private object _tag;
    public object Tag
    {
        get { return _tag; }
    }
    public TaggedMenuItem( object tag )
    {
        _tag = tag;
        if( tag != null ) this.Text = tag.ToString();
    }
}

Of course you can do a whole lot more with this kind of subclassing but this can serve as an easy start...

Monday, October 20, 2003 10:20:04 AM (Romance Standard Time, UTC+01:00) #    Comments [0]  | 

 

StatusBar Resize Bug#

There's a bug in the .NET implementation (both 1.0 and 1.1) of the System.Windows.Forms.StatusBar control which allows it to be resized independently of the form (and don't tell me this is "by design" ;-) ).

If you have a Form with a StatusBar on it that contains a Panel autosized to its Contents, just maximize the form and you'll see what goes wrong. The resize handle (called a SizingGrip) on the StatusBar that is normally used to resize the window is still there and can be used to resize the StatusBar (in stead of the window - since it's maximized now).

Fortunately, there's a pretty easy workaround for this: just hide the SizingGrip when the form is maximized as shown in the following example:

protected override void OnResize( EventArgs args )
{
    // Check if status bar already exists.
    if( m_StatusBar != null )
    {
        // Sizing grips must be manually removed when maximizing!
        m_StatusBar.SizingGrip = ( WindowState == FormWindowState.Normal );
    }
    // Resize with adjusted status bar.
    base.OnResize( args );
}

I just noticed that this bug doesn't occur on Windows XP (it certainly does on Win2K), it seems to be hiding the sizing grip when the window is maximized. Hmm how can that be when the .NET runtime is supposed to be platform independant?

Blog | Programming | .NET | Quirks
Monday, October 20, 2003 10:16:53 AM (Romance Standard Time, UTC+01:00) #    Comments [2]  | 

 

Some cool ASP.NET Whidbey preview stuff#

Scott Gunnerson talks about his ASP.NET Keynote Demo and shows some screenshots. Points 6 (SQL Cache Invalidation!) and 8 (Master Templates!) must totally rock!

Monday, October 20, 2003 8:52:51 AM (Romance Standard Time, UTC+01:00) #    Comments [0]  | 

 

Microsoft Longhorn to cost as much as man on moon project#

Whow, that's pretty stunning. Read about it on The Enquirer. Or on MSNBC, where Bill Gates also admits to doing the dishes every night :-)

It also has an interesting quote about the attacks on him from his competition (think Larry Ellison and co): "Jealousy has driven more mistakes by my competitors than anything else—when people focus not on the next breakthrough, but on cutting off Microsoft. It's actually been quite a windfall for us."

Monday, October 20, 2003 8:47:33 AM (Romance Standard Time, UTC+01:00) #    Comments [0]  | 

 

Tools! Tools! Tools!#

Pretty much every blog on the planet linked to this one already but just in case you were interstellar for a while: go check out Scott Hanselman's Ultimate Developer and Power Users Tools List!

The ones that were new to me but I will definately install on every dev machine I get my hands on:

  • CommandBar for Explorer: hosts a command prompt window right in your windows explorer. Great for all your command line needs such as csc, javac, regsvcs, ildasm, ...
  • QuickCode.NET: a brilliantly simple and extensible keyword expander for Visual Studio .NET. Type in propv int Test [Alt+Q] and shazam: you get a new property Test with a private variable _test and xml documentation. Sweeeet.

Also cool on the list:

  • Snippet Compiler: just punch in some code on-the-fly and run it. No need to start Visual Studio .NET, great for demo's!
  • Web Services Studio: use web services interactively. Point to the proper WSDL endpoint and you get an immediately callable .NET Proxy for it.
  • GhostIt: make 'ghost' windows with a single click. These are semi-transparent background windows, perfect for instant messengers and the like.
  • NetPing: where a regular ping just doesn't cut it. See operating system, uptime, memory and disk space usage, manage the pc, portscan, start remote desktop, ...

So these are a welcome addition to the tools I'd been using already:

  • Lutz Roeder's Reflector: the slickest way to look at assembly contents, referenced assemblies, metadata, ... Goodbye ILDASM (except for an actual full decompilation to IL of course). Used to be in conjunction with Anakrino but since Reflector also has a built-in decompiler these days I stopped using that. So no more worries: need to know what happens inside an assembly? Decompile it and have a look! Or - if it's something the likes of the Framework Class Library - browse the Rotor Source Code (which is kind of what the Java folks would call a reference implementation for the CLI I guess).
  • NAnt: a pretty powerful build tool for .NET (ported from Apache Ant).
  • NUnit and the NUnitAddin: a widely used unit-testing framework for .NET (ported from JUnit). The addin lets you run your unit tests straight from Visual Studio .NET. Cool!
  • Process Explorer and other great tools from SysInternals: need to know which process is locking a file, which TCP connections are open, which registry keys are being modified, ...? Look no further!
  • PowerMenu: a little utility that lets you do some nice things with your windows very easily (minimizing to the tray, setting transparency, keeping on top, ...).
  • SharpReader: my preferred news aggregator. Although I've also been using FeedDemon lately but that won't remain free.
  • E = m c²: not to blow my own horn but I use it all the time on all my machines ;-) It's a utility that can check various sources for messages, then filter and redistribute them (read: check mail, rss feeds, events, ... and show popups, send mails, ...).

The best thing is, these tools are all free and almost none of these require installation. Drag'n'Drop/Unzip/Xcopy (whatever you want to call it) deployment is so my bag :-)

Monday, October 20, 2003 8:30:31 AM (Romance Standard Time, UTC+01:00) #    Comments [0]  | 

 

A Few Must-Reads#

Clemens Vasters talks about what could be the next big paradigm shift in programming (as was moving from procedure-based programming to OOP): Service Oriented Architectures (SOA). Also check out his excellent post on why checking postconditions is more important than checking preconditions.

Eric Gunnerson shares his favorite resource on Deterministic Finalization.

Joel gives a very interesting basic overview of encodings and character sets. A few months ago I was puzzled by encodings myself so I looked into it - and Joel's right: it really isn't that hard.

In another post, Joel explains why he doesn't like programming with exceptions. This is one of those things where I don't know what to think about it, surely he's a smart guy and he will have his reasons to go back to return codes and drop structured exception handling but I don't really see the point and his post doesn't convince me either. Weird.

On MSDN Magazine, Jason Clark from Wintellect talks in detail about the upcoming feature of G enerics in .NET. In a previous article, he already covered a first look at generics, which is also pretty interesting.

The Kiss Of The Titans: Don Box dumps his old-time girlfriend ("COM is Love") and moves on to Chris Sells (voyeur on duty is Tim Ewald by the way). Man, if those drinks were poisoned: no more .NET ;-)

Whow, linkorama ;-)

Wednesday, October 15, 2003 8:35:22 AM (Romance Standard Time, UTC+01:00) #    Comments [0]  | 

 

IXmlSerializable#

Very interesting if you run across a .NET type that can't be serialized (e.g. a Hashtable) or when you want precise control over the xml mapping:

Custom xml serialization with IXmlSerializable: "IXmlSerializable is an undocumented interface that can be used to provide custom xml serialization support to types that are to be serialized using XmlSerializer."

Monday, October 13, 2003 8:48:14 PM (Romance Standard Time, UTC+01:00) #    Comments [0]  | 

 

Daily Comics#

No daily Dilbert emails for me thank you very much. I'll just subscribe to the dwlt.net online comics feeds for the ones I want to see. Excellent, Calvin and Hobbes right where I want them: in my aggregator :-)

Email is for communication, not for something you can just as well use pull services (RSS) for.

Friday, October 10, 2003 2:14:38 PM (Romance Standard Time, UTC+01:00) #    Comments [0]  | 

 

Helper Interface For British Chauvinists#
public interface ISerialisable : ISerializable {}
Thursday, October 09, 2003 12:02:04 PM (Romance Standard Time, UTC+01:00) #    Comments [1]  | 

 

Scroll Lock & Family#

After solving the mystery about the Any Key, recommended reading for advanced keyboard huggers can be found in an article that explains the use of the Scroll Lock key and the rest of those freaky keys that you most likely never use.

They add more multimedia and other keys each time a new deluxe version of a keyboard is produced but how about just making the keys that are already there - collecting dust but no fingerprints - easily programmable?

Wednesday, October 08, 2003 11:10:25 AM (Romance Standard Time, UTC+01:00) #    Comments [0]  | 

 

All content © 2013, Jelle Druyts
On this page
Recent Photos
www.flickr.com
This is a Flickr badge showing public photos from Jelle Druyts. Make your own badge here.
Advertising
Top Picks
Statistics
Total Posts: 350
This Year: 0
This Month: 0
This Week: 0
Comments: 530
Archives
Sitemap
Disclaimer
This is my personal website, not my boss', not my mother's, and certainly not the pope's. My personal opinions may be irrelevant, inaccurate, boring or even plain wrong, I'm sorry if that makes you feel uncomfortable. But then again, you don't have to read them, I just hope you'll find something interesting here now and then. I'll certainly do my best. But if you don't like it, go read the pope's blog. I'm sure it's fascinating.

Powered by:
newtelligence dasBlog 2.0.7226.0

Sign In