Click here to Skip to main content
15,884,353 members
Articles / Programming Languages / C# 4.0

An Introduction to Managed Extensibility Framework (MEF) - Part I

Rate me:
Please Sign up or sign in to vote.
4.92/5 (78 votes)
27 Apr 2011CPOL9 min read 246.3K   5.9K   175  
This article will disscuss about MEF, how to start working in this, etc.
using System.ComponentModel.Composition;
using CalculatorContract;

namespace CompositionHelper
{
    [Export(typeof(ICalculator))]
    [ExportMetadata("CalciMetaData", "Divide")]
    public class Divide : ICalculator
    {
        #region Interface members
        public int GetNumber(int num1, int num2)
        {
            return num1 / num2;
        }
        #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