Excel.Application

This sample demonstrates the usage of the math expression grammar as well as simple instruction compiler sample.

excel-small.png

Documentation

This sample demonstrates the usage of MEF for the extensibility system.
    internal class External
    {
        private static External _instance;
        private CompositionContainer _container;
        private AssemblyCatalog _catalog;

        private External()
        {
            _catalog = new AssemblyCatalog(Assembly.GetExecutingAssembly());
            _container = new CompositionContainer(_catalog);
            _container.ComposeParts(this);
        }

        static External() { _instance = new External(); }

        [ImportMany(AllowRecomposition = true)]
        private IEnumerable<IBinaryFunction> InternalFunctions { get; set; }

        [ImportMany(AllowRecomposition = true)]
        private IEnumerable<IEnumerableFunction> InternalEnumerableFunctions { get; set; }

        [ImportMany(AllowRecomposition = true)]
        private IEnumerable<IEnumerableExpressionFunction> InternalEnumerableExpressionFunctions { get; set; }

        public static IEnumerable<IBinaryFunction> BinaryFunctions { get { return _instance.InternalFunctions; } }
        public static IEnumerable<IEnumerableFunction> EnumerableFunctions { get { return _instance.InternalEnumerableFunctions; } }
        public static IEnumerable<IEnumerableExpressionFunction> EnumerableExpressionFunctions { get { return _instance.InternalEnumerableExpressionFunctions; } }
    }

Last edited Nov 30, 2010 at 1:23 AM by hack2root, version 4

Comments

No comments yet.