I think one of the most popular code snippet tools is Code Library for .NET. I don't know how it's with the current version, but all previous versions I tested were very unstable. But it really has all the features I need for a code snippet tool.
I found some other code snippet tools named CodeKeeper.NET and SnippetBox.NET. It's surprising that the two sites are very similar, just search/replace of some text :-). Unfortunately it's not for free.
I wonder what you guys use as code snippet tool...
Marc Clifton added a nice introduction to declarative versus imperative programming.
Imperative programming (source) Describes computation in terms of a program state and statements that change the program state. Declarative programming (source) Gives the computer a list of instructions to execute in a particular order, declarative programming describes to the computer a set of conditions and lets the computer figure out how to satisfy them
Like Marc Clifton describes in the article, we are already using declarative techniques like resource files, config files, etc. Many libraries like FABRIQ, User Interface Process Application Block for .NET, log4net, etc. uses a XML file to describe a sort of workflow in a declarative way.
Therefore I try to use it where possible on every project. Certainly when it comes to making forms. I just hate the generated code inside the InitializeComponent of a form/control, it is more elegant, readable and maintainable by describing it in a declarative way. For example a menubar would look like this:
instead of a bunch of statements that are needed for declaration, initialisation, setting properties and to composite the controls together. In this way it is also very hard to see the relationships between the objects!
I've seen on MSDN that the WebBrowser control has a new event in SP2, named NewWindow3 . It's an extension to the NewWindow2 event with additional info in the eventargs. The url that initiates the new window, and the url where the new window is redirecting to.
I am pretty sure that this has something to do with the new popup blocker that will be added in Windows XP SP2.
The second day at TechEd I followed 2 sessions about ASP.NET 2.0 where the speaker demonstrated a lot of nice new controls and features. One of the features I like most (call it a feature or a bug-fix), is that the designer does NOT mess your aspx code anymore, which is a very good thing, I think it was called 'HTML preserve'. Features like, themes/skins, a tool for deploying your web application, role based management, navigation control, a bunch of login related controls (registration, login, lost your password, etc.), ...
After that there was the Belgian Day which was very well organized and was really fun (I don't have to mention that a lot of people watched the football :)
The first opening key note was very entertaining and refreshing. There was an introduction of the team services in VS.NET, a demo with 3d-glasses on a 64-bit platform, a promising project called SkyServer.org, announce of the Express edition of VS.NET, and many other things.
It's very well organized, everybody at TechEd receives a login where you can check your email, surf on the internet, you receive a bag with a huge set of goodies and documentation, etc.
I just returned from a session of FABRIQ which can be downloaded on GotDotNet and it's a very nice messaging architecture that can be interesting on the project I am currently working on. So, be prepared Tom, Franco and Peter when I come back to Belgium :)
I found somewhere in the newsgroups a nice trick for creating typed collections. In most of the cases typed collections only differ in the type they get and set.
To make things easier we can do the following. Create an integer collection class, like below:
Here we use an alias named ItemType that denote the type that the collection must work with. If we want a collection of the class Employee, we simply copy/paste the IntCollection class and change the class name to EmployeeCollection and set the ItemType to Entities.Employee for example. So we have something like:
The last couple of weeks I concentrated on writing SharpBrowser. It was already subscribed for a long time on Sourceforge.net, but now I finally released an initial version :-).
The main features of the initial version, is that it is tab-based and it can be used with IE or Mozilla! SharpBrowser uses the great UI library from divil.co.uk for the menus, toolbars, docking and documents. One of the features is that you for example can choose the UI rendering, e.g.: Office2003, Everett and Whidbey.
In order to use Mozilla you just have to download the Mozilla 1.7 ActiveX Control and install it. If the installation is successful you will see an extra menuitem, where you can choose the browser: (left is IE, right is Mozilla)
Note that this is an initial release, and that there a bunch of features that must be implemented. In the following weeks I will concentrate on implementing features that are included in the standard IE and after that extra features like:
cookie mamagement
download management
popup killer
google toolbar
view partial source
event viewer
manage broken links
mouse gestures
plugin-mechanism
etc.
That's why I started writing SharpBrowser, because I am convinced that you can implement a set of very usefull features for a browser that are not (yet) included in IE. I am also thinking about features for web developers, like a viewstate decoder, better support for debugging javascript, test scenarios, etc.
This project give me also the opportunity to experiment with libraries like MyXaml, log4net, Microsoft Application Blocks, etc. For me it is important that I can learn of it, and that the project uses the right concepts, design patterns, libraries, etc. That's the reason why I distribute it in open-source so that we can share our knowledge!
In the next couple of days I will explain some concepts that I implemented for SharpBrowser. Patterns like the visitor, command, composite, facade, etc.
If you have any suggestions, ideas for new features, or want to share about good practices, design patterns, libraries, please let me know!
CruiseControl.NET is a continuous integration tool we have set up for our current project. It automatically builds when there is a change in source control (VSS, CVS, ClearCase, etc), and it reports it in a nice web layout with all the build, nunit, fxcop results.
There is also a nice tray application that can be installed on the developers pc's which indicates the status of the builds, for example it becomes:
green: build is successfull
yellow: server is currently building
red: build is failed
gray: server is unavailable
It's always a moment of truth when checking in code and hoping that the tray application remains green :-)
We use NAnt as build tool and NUnit for unit testing. The only thing to pay attention for is that for example deleted files in VSS remains in the working directory and therefore still be included by NAnt. Therefore we setup a small integration server where VSS, Microsoft.NET SDK 1.1 and CruiseControl.NET is installed. The build script that is called by CruiseControl.NET does basically the following tasks:
delete all source files
get latest version of sources
get latest version of buildscripts
build the sources
test the binaries
(buildscripts, NAnt and NUnit are stored in VSS)
NAnt can do operations on VSS if you download NAntContrib, there you have a set of additional tasks like 'vssget', 'vsslabel', etc. Note that it is a real advantage of storing your buildscripts in VSS so that CruiseControl.NET always uses the latest buildscripts.
RazorToolbox is a set of utilities/tools in the form of addins, macros, components, etc. for Visual Studio.NET. In the initial release of RazorToolbox we have ComponentDropper.
In .NET you can easily build components (= also controls), but in order to use them on your designer surface you have to add them in the toolbox of Visual Studio.NET. But there are some problems. For example if you are writing an exe-application and added some components in the exe-project, you cannot add them to the toolbox, because the toolbox only accepts DLLs. Another issue is when you are developing a set of components in a control library, you will have to refresh the toolbox for each component you added in the library, it is not automatically refreshed and is time-consuming. Besides that there are some controls in .NET that are not displayed in the toolbox, for example the PropertyGrid.
ComponentDropper allows you to drop a component on the designer surface from a set of assemblies. For example if you are writing an exe-application and added a usercontrol named UserControl1 like the screennshot below:
Take the ComponentDropper from the toolbox and drag it over the form where you want to drop UserControl1. You get something like:
This list gives the set of components that reside in the current project and the assemblies that are referenced in the project. There you can double-click on UserControl1 and it's added to the form.
There are some settings, like you can first build the project before ComponentDropper search for components in the current project. Also you can indicate that ComponentDropper searches in the list of references in the current project. A list of references can be excluded through expressions, for example: System.\*_.
Now you don't need anymore the architect edition of Visio to generate your UML diagrams from an assembly. Now you can use Assembly2Visio from GotDotNet.
It has the extra feature that you can use regular expressions to filter class names and its totally integrated in Visio 2003 through a macro. Nice tool!