1 <?xml version="1.0" encoding="utf-8"?>
2 <Type Name="ExportFactory<T>" FullName="System.ComponentModel.Composition.ExportFactory<T>">
3 <TypeSignature Language="C#" Value="public class ExportFactory<T>" />
4 <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit ExportFactory`1<T> extends System.Object" />
6 <AssemblyName>System.ComponentModel.Composition</AssemblyName>
7 <AssemblyVersion>4.0.0.0</AssemblyVersion>
10 <TypeParameter Name="T" />
13 <BaseTypeName>System.Object</BaseTypeName>
17 <typeparam name="T">To be added.</typeparam>
19 <attribution license="cc4" from="Microsoft" modified="false" />
20 <para>When you refer indirectly to a part by using a <see cref="T:System.Lazy`1" /> object, the <see cref="P:System.Lazy`1.Value" /> property always returns a reference to the same object. In some circumstances, you might want each reference to result in the creation of a new object. <see cref="T:System.ComponentModel.Composition.ExportFactory`1" /> is designed for those scenarios.</para>
22 <see cref="T:System.ComponentModel.Composition.ExportFactory`1" /> can be used in a similar fashion to <see cref="T:System.Lazy`1" /> when creating attributed parts. That is, an import contract that is defined on <see cref="T:System.ComponentModel.Composition.ExportFactory`1" /> with a generic parameter of <paramref name="T" /> will match an export that is defined on <paramref name="T" />. For example, the follow export and import match:</para>
24 public String myData = "Example Data.";
27 public ExportFactory<String> theData { get; set; }</code>
28 <code><Export()>
29 Public myData As String = "Example Data."
32 Public Property theData As ExportFactory(Of String)</code>
33 <para>The <see cref="M:System.ComponentModel.Composition.ExportFactory`1.CreateExport" /> method returns an <see cref="T:System.ComponentModel.Composition.ExportLifetimeContext`1" /> object, which has two pieces. The <see cref="P:System.ComponentModel.Composition.ExportLifetimeContext`1.Value" /> property provides access to the created part. Calling the <see cref="M:System.ComponentModel.Composition.ExportLifetimeContext`1.Dispose" /> method of the <see cref="T:System.ComponentModel.Composition.ExportLifetimeContext`1" /> object cleans up the created part and all of its dependencies, thereby allowing the part's lifetime to be managed without reference to the container that created it.</para>
36 <attribution license="cc4" from="Microsoft" modified="false" />
37 <para>A factory that creates new instances of a part that provides the specified export.</para>
41 <Member MemberName=".ctor">
42 <MemberSignature Language="C#" Value="public ExportFactory (Func<Tuple<T,Action>> exportLifetimeContextCreator);" />
43 <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Func`1<class System.Tuple`2<!T, class System.Action>> exportLifetimeContextCreator) cil managed" />
44 <MemberType>Constructor</MemberType>
46 <AssemblyVersion>4.0.0.0</AssemblyVersion>
49 <Parameter Name="exportLifetimeContextCreator" Type="System.Func<System.Tuple<T,System.Action>>" />
52 <param name="exportLifetimeContextCreator">To be added.</param>
53 <summary>To be added.</summary>
54 <remarks>To be added.</remarks>
57 <Member MemberName="CreateExport">
58 <MemberSignature Language="C#" Value="public System.ComponentModel.Composition.ExportLifetimeContext<T> CreateExport ();" />
59 <MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.ComponentModel.Composition.ExportLifetimeContext`1<!T> CreateExport() cil managed" />
60 <MemberType>Method</MemberType>
62 <AssemblyVersion>4.0.0.0</AssemblyVersion>
65 <ReturnType>System.ComponentModel.Composition.ExportLifetimeContext<T></ReturnType>
69 <remarks>To be added.</remarks>
71 <attribution license="cc4" from="Microsoft" modified="false" />
72 <para>Creates an instance of the factory's export type.</para>
75 <attribution license="cc4" from="Microsoft" modified="false" />
76 <para>A valid instance of the factory's exported type.</para>
80 <Member MemberName="OnFilterScopedCatalog">
81 <MemberSignature Language="C#" Value="protected virtual bool OnFilterScopedCatalog (System.ComponentModel.Composition.Primitives.ComposablePartDefinition composablePartDefinition);" />
82 <MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance bool OnFilterScopedCatalog(class System.ComponentModel.Composition.Primitives.ComposablePartDefinition composablePartDefinition) cil managed" />
83 <MemberType>Method</MemberType>
85 <AssemblyVersion>4.0.0.0</AssemblyVersion>
88 <ReturnType>System.Boolean</ReturnType>
91 <Parameter Name="composablePartDefinition" Type="System.ComponentModel.Composition.Primitives.ComposablePartDefinition" />
94 <remarks>To be added.</remarks>
96 <attribution license="cc4" from="Microsoft" modified="false" />
97 <para>When overridden in a derived class, filters part definitions in the scope of the <see cref="T:System.ComponentModel.Composition.ExportFactory`1" /> object.</para>
100 <attribution license="cc4" from="Microsoft" modified="false" />
101 <para>true if the part definition should be included in the scope; otherwise, false.</para>
103 <param name="composablePartDefinition">
104 <attribution license="cc4" from="Microsoft" modified="false" />The part definition to filter.</param>