PowerShell 1.0 has been released for Windows XP SP2 and Windows Server 2003. The bits can be downloaded here. If you already have installed a previous release of PowerShell, you need to uninstall by selecting 'Show Updates' in the 'Change or Remove Programs'. 
One of the oldest and most basic programs is certainly the command prompt (cmd.exe). One thing is certain, you still can't do without the command prompt, and certainly being a developer. I came across a nice tool, called Console, which enhances the command prompt. I have been using it for a couple of months now, and I really like it. One of the things you should really customize is your PROMPT. More information about changing the PROMPT can be found here. Having, for example, your current directory path on a separate line is really useful. You can customize it through the environment variable called PROMPT, like Scott is doing, but I prefer passing it as a parameter to the cmd.exe. This way I can easily copy the application and no reboot is required. This can be done by the /k argument of the cmd.exe. Here is a snippet of my XML configuration file for Console. console.xml - Copy Code<tab title="Console">
<console shell="cmd /k PROMPT $p$_$+$g" init_dir=""/>
<cursor style="11" r="255" g="255" b="255"/>
<background type="2" r="0" g="0" b="0">
<image file="" relative="0" extend="0" position="0">
<tint opacity="190" r="0" g="0" b="0"/>
</image>
</background>
</tab>
<tab title="cmd">
<console shell="cmd.exe /k PROMPT $p$_$+$g" init_dir=""/>
<cursor style="11" r="255" g="255" b="255"/>
<background type="0" r="0" g="0" b="0">
<image file="" relative="0" extend="0" position="0">
<tint opacity="0" r="0" g="0" b="0"/>
</image>
</background>
</tab>
<tab title="VS.NET 2005">
<console shell="cmd /k PROMPT $p$_$+$g && C:\PROGRA~1\MID05A~1\VC\vcvarsall.bat" init_dir=""/>
<cursor style="0" r="255" g="255" b="255"/>
<background type="2" r="0" g="0" b="0">
<image file="" relative="0" extend="0" position="0">
<tint opacity="188" r="0" g="0" b="0"/>
</image>
</background>
</tab>
<tab title="PowerShell">
<console shell="C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe" init_dir=""/>
<cursor style="0" r="255" g="255" b="255"/>
<background type="2" r="0" g="0" b="0">
<image file="" relative="0" extend="0" position="0">
<tint opacity="189" r="0" g="0" b="0"/>
</image>
</background>
</tab>
This is the result in Console

I am currently building software factories and I needed a way to have a list of running Visual Studio instances and the corresponding EnvDTE._DTE object to manipulate the solution. Windows internally keeps a list of COM objects that are currently running, called the Running Object Table (ROT). VS .NET 2005 for example, register itself in the ROT as "!VisualStudio.DTE.8.0:pid" where 'pid' is the process id of the corresponding VS 2005 instance. In .NET 1.1 you would use the the following UCOMIRunningObjectTable, UCOMIBindCtx for enumerating the ROT. In .NET 2.0 these interfaces are obsolete and are replaced by IRunningObjectTable and BIND_OPTS respectively. Note that the same code can be used for getting other instances like MS Word, IE, etc. DTEHelper.cs - Copy Codeusing System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
using EnvDTE;
public static class DTEHelper
{
const uint S_OK = 0;
[DllImport("ole32.dll")]
public static extern uint GetRunningObjectTable(uint reserved, out IRunningObjectTable ROT);
[DllImport("ole32.dll")]
public static extern uint CreateBindCtx(uint reserved, out IBindCtx ctx);
static IDictionary<string, object> GetRunningObjectTable()
{
IDictionary<string, object> rotTable = new Dictionary<string, object>();
IRunningObjectTable runningObjectTable;
IEnumMoniker monikerEnumerator;
IMoniker[] monikers = new IMoniker[1];
GetRunningObjectTable(0, out runningObjectTable);
runningObjectTable.EnumRunning(out monikerEnumerator);
monikerEnumerator.Reset();
IntPtr numberFetched = IntPtr.Zero;
while (monikerEnumerator.Next(1, monikers, numberFetched) == 0)
{
IBindCtx ctx;
CreateBindCtx(0, out ctx);
string runningObjectName;
monikers[0].GetDisplayName(ctx, null, out runningObjectName);
Marshal.ReleaseComObject(ctx);
object runningObjectValue;
runningObjectTable.GetObject(monikers[0], out runningObjectValue);
if (!rotTable.ContainsKey(runningObjectName))
rotTable.Add(runningObjectName, runningObjectValue);
}
return rotTable;
}
public static IDictionary<string, _DTE> GetRunningVSIDETable()
{
IDictionary<string, object> runningObjects = GetRunningObjectTable();
IDictionary<string, _DTE> runningDTEObjects = new Dictionary<string, _DTE>();
foreach (string objectName in runningObjects.Keys)
{
if (!objectName.StartsWith("!VisualStudio.DTE"))
continue;
_DTE ide = runningObjects[objectName] as _DTE;
if (ide == null)
continue;
runningDTEObjects.Add(objectName, ide);
}
return runningDTEObjects;
}
}
The Microsoft Patterns & Practicess Team recently released a new version of the Web Client Software Factory that can be found on CodePlex. One of the things I noticed directly, is that they implemented a web version of the Composite UI based on the ObjectBuilder. The goals of Web Client Software Factory are: - CAB for Web
- Hiding complexity
- Separation of infrastructure & biz logic
- Biz logic reuse amongst different UI Technologies
- Promoting consistent development practices
- Navigation
- UI Richness
- UI Layout management
- State management
- Best use of technology available (Ajax, WinForms controls, ...)
- Security
- SaaS implications on application design
More information about the vision & scope can be found here.
On IStaySharp.NET I created an article that shows you, how you can load a DSL file. This is necessary if you need to access your model from GAT, a Visual Studio AddIn, custom library, etc. The last couple of weeks I am digging into DSL and GAT for creating a set of software factories at Real Software that will be used as a baseline for building applications. Learning two (DSL & GAT) simultaneously and combining them was not so trivial and there is some learning curve. For GAT there are some interesting resources: The MSDN forums is a good resource when you have some issues and/or questions. DSL has also a specific forum. The capabilities of DSL are really impressive. Now you have finally the tools to write for example your own dataset designer with code generation!!!
Last week I bought an external harddisk, Vantec Nexstar 3 (NST-360SU-BK), that can be connected through USB 2.0 and eSata. eSata is simply a new standard for connecting external SATA drives at full speed! I use the external harddisk to share data between my laptop (through USB 2.0) and my desktop PC (through eSata). I use extensively Virtual PC for development, and it's a good thing when developing on my desktop PC I can use the full speed of my HD.
Microsoft released the beta program for Virtual PC 2007. The new features are - Hardware-assisted virtualization
- Support for Windows Vista as a guest and host operating system
- Support for 64-bit host operating system
You can participate on the beta program through the Microsoft Connect web site.
I've upgraded SyntaxColor4Writer with the new version of CodeHighlighter 4.0. It uses a new parsing model and it supports some additional language definitions, namely: For example: HasChanges method of a DataSet in MSIL - Copy Code1 .method public hidebysig instance bool HasChanges() cil managed
2 {
3 .maxstack 2
4 L_0000: ldarg.0
5 L_0001: ldc.i4.s 28
6 L_0003: call instance bool System.Data.DataSet::HasChanges(System.Data.DataRowState)
7 L_0008: ret
8 }
Any suggestions and/or feedback about SyntaxColor4Writer is welcome!
A new version of CruiseControl.NET has been released. The release notes of version 1.1 can be found here. This is the defacto standard tool if you want to continuous integration together with unit testing, code metrics, code analysis, etc.
Recently I switched from RSSBandit to GreatNews as RSS reader (noticed by a post from Bert Jansen).
The speed for aggregating feeds using GreatNews is really fast! I think it was better called SpeedNews ;). Besides that, it has a nice user-interface and all config & feed data is kept in the installation folder. This means that no installation (MSI) is required, and that it can easily be deployed to other computers.
Today I published a new version of SyntaxColor4Writer on IStaySharp.NET. It's compiled against the new beta version of Windows Live Writer with the following added features:
'Copy Code' link (copies everything to the clipboard)
Caption text
Customize backcolor, including line numbering
Spaces in tabs
Font size
Below you find some examples:
1 <system.web>
2 <compilation defaultLanguage="VB" debug="true"/>
3 <customErrors mode="ReadOnly"/>
4 </system.web>
C# code of the Main method class.
Program.cs - Copy Code 1 /// <summary>
2 /// The main entry point for the application.
3 /// </summary>
4 [STAThread]
5 static void Main()
6 {
7 Application.EnableVisualStyles();
8 Application.SetCompatibleTextRenderingDefault(false);
9 Application.Run(new TestForm());
10 }
Cassini is a ASP.NET sample application that shows how to write a web server using .NET. This means that you can host ASP.NET using the ASP.NET hosting APIs (System.Web.Hosting). This is really an alternative to IIS. There is also a second project called UltiDev Cassini Web Server which is based on the Cassini source with the following additional features:
- Comes ready for distribution with Visual Studio ASP.NET applications
- Runs as a windows service
- Hosts and runs multiple ASP.NET applications
- Provides management UI and simple API for configuring web applications
- Comes in two flavors: 2.0 version for ASP.NET 2.0 applications, and 1.1 for applications compiled for ASP.NET 1.1
If you have the need for an offline version of your ASP.NET application, where easy deployment is required (without IIS), then this is a very good solution.
Ubuntu is a free linux-based operating system. Ubuntu works very well on Virtual PC, and I didn't encounter any problems during installation. A detailed step-by-step explanation can be found on the documentation site of Ubuntu, How To - Configure Ubuntu for Microsoft Virtual PC 2004.
Setting Ubuntu to the same screen resolution as the host in full-screen mode didn't worked for me. I tried the following post, but without any success.
One of the reasons for installing Ubuntu, was to see if my blog site rendered correctly in Firefox. Only the line under the post title was not positioned correctly. I will update the 'business' theme soon.
DasBlog 1.9 is released. It's a major update with a lot of extra features and fixes. I contributed to this release for improving DasBlog in a multi-user setup. The following features has been added (will update the documentation on dasblog.info):
- Top Posters macro & Profile Combo control
- Every admin/contributor can create/edit a personal profile page
- A Contributor can be notified by mail for certain events and can be configured through the 'User Settings' screen
- Notify when a new post has been added
- Notify when comments has been added for ALL posts
- Notify when comments has been added for OWN posts
I also created a new theme called 'business', which is running on my weblog now. It's not yet included in this release, but it's available through the subversion repository. I am also planning to create a theme, based on 'business', for in a multi-user setup.
Soon I will update RealDN (corporate blog of my company I am working for) to DasBlog 1.9.
Windows Live Writer is a desktop application that makes it easier to compose compelling blog posts using Windows Live Spaces or your current blog service. For Windows Live Writer I created a plugin called SyntaxColor4Writer that enables you to embed syntax highlighting in your blog posts. More details about SyntaxColor4Writer can be found here. This is how the plugin looks:
This is an example of a xml fragment generated by SyntaxColor4Writer:
<system.web>
<compilation defaultLanguage="VB" debug="true" />
<customErrors mode="RemoteOnly" />
</system.web>
It has been quiet for some time on my blog, but that will change now. It was mainly due to the fact that we bought a new house in Hombeek, we didn't know that little village before :). Every weekend we spend time on painting and some chores. But the fact that we moved now, and that practically everything is done, I can again spend more time for programming and sharing with the community.
That's right, a public preview of Office 2007 Beta 2 is available. You can download the bits from here. Note that right now it is very difficult to connect to the server, due to high traffic.
BindingListView<T> is a project hosted on GotDotNet that gives you search, sorting and filtering capabilities to a plain BindingList. For example if you have the following Person entity:
public class Person { string firstName = string.Empty; int age = 0;
public string FirstName { get { return firstName; } set { firstName = value; } }
public int Age { get { return age; } set { age = value; } }
public Person(string firstName, int age) { this.firstName = firstName; this.age = age; } }
And you want to have a collection of persons bind to a datagrid, you can simply write the following:
BindingList<Person> persons = new BindingList<Person>(); persons.Add(new Person("Bill", 45)); persons.Add(new Person("Gert", 33)); persons.Add(new Person("Johan", 12)); persons.Add(new Person("An", 27));
personsGrid.DataSource = persons;
What if you need to do some filtering, or simply sorting on the datagrid? Therefore you would need to create a custom collection class that implements a bunch of interfaces for having sorting, filtering and searching capabilities.
The BindingListView<T> class has all these functionalities built-in. You simply have to pass a list, and bind the BindingListView to the datagrid. The same way you would do with a DataSet and DataView. This means:
BindingListView<Person> personsView = new BindingListView<Person>(persons); personsGrid.DataSource = personsView;
Sorting on a BindingListView is done through the Sort property, the same as on a DataView. For example:
personsView.Sort = "FirstName";
Filtering is done through the Filter property and uses anonymous delegates. So for example to filter all persons that are less than 30, you can write:
personsView.Filter = BindingListView<Person>.CreateItemFilter(new Predicate<Person>( delegate(Person person) { return (person.Age < 30); } ));
You can also merge multiple sources to one view (functionality that the DataView doesn't support) through the AggregatedBindingListView<T>.
|