I had a need to customize a cc.net project list, and if you install CCTray, in c:Program Filescctray 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
.csharpcode { font-size: small; color: black; font-family: Courier New , Courier, Monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }
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