Click here to Skip to main content
15,885,537 members
Articles / Programming Languages / C#

An Example of Strategy Design Pattern for Beginners

Rate me:
Please Sign up or sign in to vote.
3.31/5 (13 votes)
25 Oct 2010CPOL3 min read 54.7K   405   14  
This example shows how and where to implement the strategy design pattern.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using StrategyExample.Strategy;
using System.Drawing;

namespace StrategyExample.ConcreteClasses
{
    public class Bold : IFontStyle
    {
        #region IFontStyle Members

        public Font GetNewFontStyle(System.Windows.Forms.Control c)
        {
            return new Font(c.Font, FontStyle.Bold);
        }

        #endregion
    }
}

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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Comments and Discussions