CCNetConfig

Continuous Integration, Simplified Configuration

Home | Wiki | About | Login | Contact |
subscribeSubscribe
Subscribe
CCNetConfig
Releases
Beta Releases
Stable Releases
Work Items
Discussions
CPRP
Releases
Beta Releases
Stable Releases
RSS Builds Publisher
Releases
Beta Releases
Stable Releases
Current Release
0.5.0.120
Sun, Jan 20 2008 at 10:02 PM
All Releases
CCNetConfig Build Status
  • Build StatusSuccess
  • Label0.6.420.32915
  • Last Build4/28/2008 6:43 AM
  • Next Build7/24/2008 12:00 AM
Recent Work Items
  • Automated: Unhandled exceptio…
  • Automated: Object reference n…
  • support for SvnRevisionLabell…
  • Automated: Uncommon behaviour…
  • Automated: create a new confi…
  • Copying and pasting a task do…
  • Automated: Invalid URI: The U…
  • Automated: Cannot import a nu…
  • Remove support for plugins in…
  • Show splash screen on initial…
Legend: Proposed Active Fixed Closed
Tag Cloud
  • A Little Class
  • Automation
  • C#
  • CCNet
  • CCNetConfig
  • codeplex
  • CodePlexAPI
  • Continuous Integration
  • CruiseControl.NET
  • feedburner
  • google
  • JSON
  • LOLCode
  • MSBuild
  • RssBuildsPublisher
  • Sandcastle
  • subtext
  • subversion
  • SvnLabeller
  • tfs
  • twitter
  • Visual Studio
  • Wix
  • XML
  • xna
more tags...
Archives
  • July, 2008 (2)
  • May, 2008 (3)
  • April, 2008 (5)
  • March, 2008 (8)
  • February, 2008 (6)
  • January, 2008 (7)
  • December, 2007 (11)
  • November, 2007 (7)
  • October, 2007 (5)
  • September, 2007 (8)
  • August, 2007 (5)
  • June, 2007 (7)
  • May, 2007 (5)
  • April, 2007 (23)
  • March, 2007 (27)
  • February, 2007 (12)
  • January, 2007 (9)
  • December, 2006 (2)
  • November, 2006 (12)
  • October, 2006 (17)
  • September, 2006 (8)
  • August, 2006 (30)
 
Image Galleries
  • Screenshots
  • A Little Class
Post Categories
  • Announcements
  • Automation
  • Beta
  • Beta Marker
  • C#
  • CCNetConfig
  • CCNetConfig.BugTracking
  • CCnetConfig.CCNet
  • CCNetConfig.Core
  • CCNetConfig.GUI
  • CCNetConfig.Updater
  • CCNetConfig.Updater.Core
  • CodePlex
  • CodePlex Release Publisher
  • CodePlexAPI
  • Continuous Integration
  • CruiseControl.NET
  • Extending CCNetConfig
  • MSBuild
  • MsBuild Extended Tasks
  • News
  • Nightly
  • Orcas
  • Project Extension
  • Rant
  • Reflector
  • Release
  • RssBuildsPublisher
  • Sandcastle
  • SubText
  • SubVersion
  • TFS
  • TFS Plugin
  • Tools
  • TortiseSVN
  • Vista
  • Visual Studio
  • Wiki
  • Wix
  • XAML
  • Xbox Live
  • Zune
 

Blog Statistics
  • Posts219
  • Articles0
  • Comments36
  • Trackbacks5
Home
Download
Screenshots
Support
License
Source

February 2008 Entries

CCNetConfig 0.6.30901.225 Beta
Early this morning the 0.6.30901.225 build was created. This build adds some support for new properties added to the email publisher in CruiseControl.NET 1.4, like the mailPort and converters elements.

I also added a task dialog when you attempt to add a new project with a name that already exists, giving you the option to cancel or choose a different name. Prior to this build, the new project dialog would close and nothing would happen at all if a project with that name existed. The renaming of an existing project has been fixed as well. So it will not tell you that a project with the 'new name' already exists when it doesn't.

Project Exists

Showing the context menu on the "Cruise Control" node now shows the correct menu items again.
Context menu

The EmailPublisher was changed to use the dynamic serialization. The FilteredSourceControl bug with importing null nodes was fixed. I have also started working on notifying the user of any errors or conflicts with the selected version when loading the configuration. A task dialog will display prompting the user whether to view the errors, manually edit the configuration file or ignore the errors. The task dialog is in place, but no further functionality exists yet.
Technorati Tags:[ CCNetConfig ]
Filed Under [ CCNetConfig ]
Ryan Conrad posted @ Monday, February 25, 2008 2:37 PM | Comments (0)
A Little Class (System.Enum)
The System.Enum class is an abstract class that inherits from ValueType and implements the IComparable, IFormattable, and IConvertible interfaces. It contains methods to compare instances, convert the value to the string representation, convert the string representation to the numeric representation, and create an instance of a specified enumeration and value.

While this may seem like a simple class, and the methods described below may be well know by some, I have seen many different ways for developers to convert a string representation of an enumeration to the enumeration value. Hopefully this post helps spread the knowledge on the proper ways to do the conversion.

Code

1using System; 2 3namespace ALittleClass ...{ 4 class Program ...{ 5 6 [STAThread] 7 static void Main ( string[] args ) ...{ 8 // Formats the enum to a name or decimal equivalent if its not defined 9 // will output 'Sunday' 10 Console.WriteLine ( "Format(G): {0}", Enum.Format ( typeof ( DayOfWeek ), 0, "G" ) ); 11 // will output '7' 12 Console.WriteLine ( "Format(G): {0}", Enum.Format ( typeof ( DayOfWeek ), 7, "G" ) ); 13 // formats the enum value as a hexadecimal value with out the leading 0x 14 Console.WriteLine ( "Format(X): {0}", Enum.Format ( typeof ( DayOfWeek ), 0, "X" ) ); 15 // formats the enum value in decimal form 16 Console.WriteLine ( "Format(D): {0}", Enum.Format ( typeof ( DayOfWeek ), 0, "D" ) ); 17 // Behaves identically to "G" 18 Console.WriteLine ( "Format(F): {0}", Enum.Format ( typeof ( DayOfWeek ), 0, "F" ) ); 19 20 // gets the name of the enum from the value 21 Console.WriteLine ( "GetName: {0}", Enum.GetName ( typeof ( DayOfWeek ), 1 ) ); 22 23 // gets the names of all the values in the enum 24 Console.WriteLine ( "GetNames:" ); 25 foreach ( string name in Enum.GetNames ( typeof ( DayOfWeek ) ) ) ...{ 26 Console.WriteLine ( "\tName: {0}", name ); 27 } 28 29 // gets the underlying type of the enum 30 Console.WriteLine ( "GetUnderlyingType: {0}", Enum.GetUnderlyingType ( typeof ( DayOfWeek ) ).FullName ); 31 32 // gets the enum values 33 Console.WriteLine ( "GetValues:" ); 34 foreach ( object o in Enum.GetValues ( typeof ( DayOfWeek ) ) ) ...{ 35 Console.WriteLine ( "\tValue: {0}", o ); 36 } 37 38 // gets if a specified value is defined in the enum. This can be the value of the enum or the name 39 Console.WriteLine ( "IsDefined(Monday): {0}", Enum.IsDefined ( typeof ( DayOfWeek ), "Monday" ) ); 40 Console.WriteLine ( "IsDefined(FooBar): {0}", Enum.IsDefined ( typeof ( DayOfWeek ), "FooBar" ) ); 41 Console.WriteLine ( "IsDefined(1): {0}", Enum.IsDefined ( typeof ( DayOfWeek ), 1 ) ); 42 43 // parse a value and return the enum object 44 DayOfWeek dow = (DayOfWeek)Enum.Parse ( typeof ( DayOfWeek ), "Monday" ); 45 Console.WriteLine ( "Parse: {0}", dow ); 46 47 // attempting to parse a value with ignore case off. 48 try ...{ 49 dow = (DayOfWeek)Enum.Parse ( typeof ( DayOfWeek ), "monday", false ); 50 Console.WriteLine ( "Parse: {0}", dow ); 51 } catch ( Exception ex ) ...{ 52 Console.WriteLine ( ex.Message ); 53 } 54 55 // we are out of here! 56 Console.ReadLine ( ); 57 } 58 } 59} 60

Output

Format(G): Sunday
Format(G): 7
Format(X): 00000000
Format(D): 0
Format(F): Sunday
GetName: Monday
GetNames:
        Name: Sunday
        Name: Monday
        Name: Tuesday
        Name: Wednesday
        Name: Thursday
        Name: Friday
        Name: Saturday
GetUnderlyingType: System.Int32
GetValues:
        Value: Sunday
        Value: Monday
        Value: Tuesday
        Value: Wednesday
        Value: Thursday
        Value: Friday
        Value: Saturday
IsDefined(Monday): True
IsDefined(FooBar): False
IsDefined(1): True
Parse: Monday
Requested value 'monday' was not found.
Technorati Tags:[ c# ] [ A Little Class ] [ System.Enum ]
Filed Under [ C# ]
Ryan Conrad posted @ Friday, February 22, 2008 8:59 AM | Comments (0)
A Little Class (Microsoft.Win32.SystemEvents)
This weeks little class is the Microsoft.Win32.SystemEvents. This class is a static class that allows you to listen for specific events fired by the system. It allows you to capture the following events:

  • DisplaySettingsChanged
    • When the user changes the screen resolution
  • DisplaySettingsChanging
    • Before the actual settings change
  • InstalledFontsChanged
    • When a new font is installed on the system
  • PaletteChanged
    • When the user switches to an application that uses a different palette
  • PowerModeChanged
    • When the machines power status changes: AC to battery or machine suspended
  • SessionEnded
    • User is logged off or machine is shut down
  • SessionEnding
    • Before the actual session ends
  • SessionSwitch
    • When a new user logs in
  • TimeChanged
    • When the time of the system changed
  • UserPreferenceChanged
    • When a user preference has changed: The desktop background has changed
  • UserPreferenceChanging
    • Before the preference changes
  • TimerElapsed
    • Fires every x number of milliseconds specified when initializing the event listener
  • EventsThreadShutdown
    • Fires when the application is no longer listening for system events

Code

1using System; 2using Microsoft.Win32; 3 4namespace ALittleClass ...{ 5 class Program ...{ 6 [STAThread] 7 static void Main ( string[] args ) ...{ 8 Console.WriteLine ( "Waiting for System Events..." ); 9 // initialize a timer to listen for the events. 10 IntPtr sysTimer = SystemEvents.CreateTimer ( 500 ); 11 // listent for display settings to change 12 SystemEvents.DisplaySettingsChanged += delegate ( object sender, EventArgs e ) ...{ 13 Console.WriteLine ( "DisplaySettingsChanged" ); 14 }; 15 // listen for the display settings right before they change 16 SystemEvents.DisplaySettingsChanging += delegate ( object sender, EventArgs e ) ...{ 17 Console.WriteLine ( "DisplaySettingsChanging" ); 18 }; 19 // listen for when this is no longer going to listen for system events 20 SystemEvents.EventsThreadShutdown += delegate ( object sender, EventArgs e ) ...{ 21 Console.WriteLine ( "EventsThreadShutdown" ); 22 }; 23 // listen for a new font to be installed on the system 24 SystemEvents.InstalledFontsChanged += delegate ( object sender, EventArgs e ) ...{ 25 Console.WriteLine ( "InstalledFontsChanged" ); 26 }; 27 // listen for when the user switches to an application that uses a different palette 28 SystemEvents.PaletteChanged += delegate ( object sender, EventArgs e ) ...{ 29 Console.WriteLine ( "PaletteChanged" ); 30 }; 31 // listen for the system to switch to a different power mode 32 // Resume, StatusChange (AC to battery) or Suspend 33 SystemEvents.PowerModeChanged += delegate ( object sender, PowerModeChangedEventArgs e ) ...{ 34 Console.WriteLine ( "PowerModeChanged: {0}",e.Mode ); 35 }; 36 // listen for the users session to end. this could be Logoff or SystemShutdown 37 SystemEvents.SessionEnded += delegate ( object sender, SessionEndedEventArgs e ) ...{ 38 Console.WriteLine ( "SessionEnded: {0}", e.Reason ); 39 }; 40 // listen for the users session to end. this could be Logoff or SystemShutdown 41 SystemEvents.SessionEnding += delegate ( object sender, SessionEndingEventArgs e ) ...{ 42 Console.WriteLine ( "SessionEnding: {0}", e.Reason ); 43 }; 44 45 // listen for the users session to change. here are the reasons for a switch: 46 // ConsoleConnect 47 // ConsoleDisconnect 48 // RemoteConnect 49 // RemoteDisconnect 50 // SessionLock 51 // SessionLogoff 52 // SessionLogon 53 // SessionRemoteControl 54 // SessionUnlock 55 SystemEvents.SessionSwitch += delegate ( object sender, SessionSwitchEventArgs e ) ...{ 56 Console.WriteLine ( "SessionSwitch: {0}", e.Reason ); 57 }; 58 // listen for the system time to change 59 SystemEvents.TimeChanged += delegate ( object sender, EventArgs e ) ...{ 60 Console.WriteLine ( "TimeChanged" ); 61 }; 62 // listen for the timer to elapse that listens for the system events 63 SystemEvents.TimerElapsed += delegate ( object sender, TimerElapsedEventArgs e ) ...{ 64 // fires every X milliseconds that we specified when the timer was created. 65 }; 66 // listen for a user preference list desktop background to change 67 SystemEvents.UserPreferenceChanged += delegate ( object sender, UserPreferenceChangedEventArgs e ) ...{ 68 Console.WriteLine ( "UserPreferenceChanged: {0}", e.Category ); 69 }; 70 // listen for a user preference list desktop background to change 71 SystemEvents.UserPreferenceChanging += delegate ( object sender, UserPreferenceChangingEventArgs e ) ...{ 72 Console.WriteLine ( "UserPreferenceChanging: {0}", e.Category ); 73 }; 74 Console.WriteLine ( "Press Enter to Stop Listening." ); 75 // wait for an enter key to stop listening. 76 Console.ReadLine ( ); 77