질문하기질문하기
 

질문MEF and singletons

  • 2009년 6월 23일 화요일 오전 9:47Gerhard 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    Hi,

    I have an object with more than one interface and I want to resolve this dependancies with MEF. But its important, that the instance of the object is a singleton, so how can I tell MEF to do so?

    Thanks

    Gerhard
    • 이동됨Mathias SchifferMSFT2009년 6월 23일 화요일 오전 10:28English Language Post (From:.NET Framework)
    •  

모든 응답

  • 2009년 8월 17일 월요일 오전 10:04Craig Kuhnert 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    When you export your class use the creationpolicy attribute
    [PartCreationPolicy(CreationPolicy.Shared)]
    [Export(typeof(IMyInterface))]
    public class MyClass : IMyInterface
    {
    }