1 // -----------------------------------------------------------------------
\r
2 // Copyright (c) Microsoft Corporation. All rights reserved.
\r
3 // -----------------------------------------------------------------------
\r
5 using System.Collections.Generic;
\r
6 using System.ComponentModel.Composition.Hosting;
\r
7 using System.ComponentModel.Composition.Primitives;
\r
9 namespace System.ComponentModel.Composition.Factories
\r
11 internal static partial class ElementFactory
\r
13 public static ICompositionElement Create()
\r
15 return Create((string)null, (ICompositionElement)null);
\r
18 public static ICompositionElement Create(string displayName)
\r
20 return Create(displayName, (ICompositionElement)null);
\r
23 public static ICompositionElement Create(ICompositionElement origin)
\r
25 return Create((string)null, origin);
\r
28 public static ICompositionElement Create(string displayName, ICompositionElement origin)
\r
30 return new CompositionElement(displayName, origin);
\r
33 public static ICompositionElement CreateChain(int count)
\r
35 ICompositionElement previousElement = null;
\r
37 for (int i = 0; i < count; i++)
\r
39 previousElement = Create((count - i).ToString(), previousElement);
\r
42 return previousElement;
\r