public static void Add <T>(this OrderPrecedenceImportCollection <T> collection, T value, string appliesTo = null, int orderPrecedence = 0)
        {
            var metadata = IOrderPrecedenceMetadataViewFactory.Create(appliesTo, orderPrecedence);

            var export = new Lazy <T, IOrderPrecedenceMetadataView>(() => value, metadata);

            collection.Add(export);
        }
Example #2
0
        public static void Add <T>(this OrderPrecedenceExportFactoryCollection <T> collection, T value, string appliesTo = null, int orderPrecedence = 0)
        {
            var metadata = IOrderPrecedenceMetadataViewFactory.Create(appliesTo, orderPrecedence);

            var factory = ExportFactoryFactory.ImplementCreateValueWithAutoDispose(() => value, metadata);

            collection.Add(factory);
        }