Click here to Skip to main content
14,032,238 members
Rate this:
 
Please Sign up or sign in to vote.
Please under stand the flow of code .
I have an interface Ishape which in some separate dll or class library.

[InheritedExport]
    public interface Ishape
    {

        int Paint(int width, int height);

    }




In my window application I have two classes.

public class Circle : MEF_Test.Ishape
   {
       public int Paint(int width, int height)
       {

           return 0;
       }

   }
   [Export(typeof(Ishape))]
   public class Rect : MEF_Test.Ishape
   {
       public int Paint(int width, int height)
       {

           return 0;
       }

   }



I want to bind class names in combobox who inherit interface IShape .
I am new to both window application and MEF ( managed extensibilty Framework )

Please somebody help . I need it as soon as possible .

Thanks in advance
Regard
Posted

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Hi,

Just use the meta data for example:

[ExportMetadata("Name", "ControlsLibrary1.BlueControl")]

Then when you load all of the Shapes you can add them to the Combo-Box.

You can read more about it in my article:

The Simplest Way to use MEF Fully Lazy DLL Loading[^]

I hope it would help you :)
   

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web05 | 2.8.190419.4 | Last Updated 18 Apr 2014
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100