|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ActionInterfaces
{
public class DivideAction : ICustomAction<int>
{
public string Name
{
get { return "Divide Action"; }
}
public string Description { get; set; }
public int Execute( int val )
{
Console.WriteLine( "Name: {0} Value: {1}", Name, val );
if ( val > 2 )
return val / 2;
else
return val;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I'm originally from the UK, I hail from Saddleworth (near Manchester). I moved to the US in 2007 and live with my wife and daughter in New Jersey.
I started late into software development and do as much learning as I can. I've been a developer for 10 years, starting with Business BASIC on DG/UX boxes, moving to do Windows Mobile development using .NET CF. My tool of choice is C#, however I'll pick at whatever language is good for the job.
I struggle to concentrate on one thing, so don't really learn a topic very well before moving on to the next. It's my aim to sort this out and learn more about C#, the language, the design and more importantly how to use it like the masters I see on this site.