CruiseControl.NET – Customize Your Project List with .NET Remoting

I had a need to customize a cc.net project list, and if you install CCTray, in c:\Program Files\cctray you will see 3 dll’s.

ThoughtWorks.CruiseControl.CCTrayLib
ThoughtWorks.CruiseControl.Remote
NetReflector

Note: If you have the latest CCTray installed, then you will have to develop any custom application in .NET 2.0

So first this, you need to reference those 3 dll’s, and add a using statement to your code


using ThoughtWorks.CruiseControl.CCTrayLib.Configuration;
using ThoughtWorks.CruiseControl.CCTrayLib.ServerConnection;
using ThoughtWorks.CruiseControl.Remote;
RemoteCruiseManagerFactory factory = new RemoteCruiseManagerFactory();
ICruiseManager manager = factory.GetCruiseManager("tcp://buildserver:21234/CruiseManager.rem");
ProjectStatus[] projectStatuses = manager.GetProjectStatus();
foreach (ProjectStatus status in projectStatuses)
{             
//status.Name; = Project Name
    //status.WebURL; = Web URL for the cc.net project
    //status.BuildStatus.ToString(); = cc.net build status
}

Well, I spent more time trying to format the code on this post than actually coding the program, so that stinks. I wish it wasnt such a pain to preserve formatting