b970bbf80a67bde176e98374180b081e32046130
[mono.git] / mcs / class / System.ComponentModel.Composition / src / Composition.Initialization / System / ComponentModel / Composition / PartInitializer.AssemblyList.cs
1 // -----------------------------------------------------------------------\r
2 // Copyright (c) Microsoft Corporation.  All rights reserved.\r
3 // -----------------------------------------------------------------------\r
4 using System;\r
5 using System.Collections.Generic;\r
6 using System.Reflection;\r
7 //using System.Windows;\r
8 //using System.Windows.Resources;\r
9 \r
10 namespace System.ComponentModel.Composition\r
11 {\r
12     public static partial class PartInitializer\r
13     {\r
14         // This method is the only Silverlight specific code dependency in CompositionHost\r
15         private static List<Assembly> GetAssemblyList()\r
16         {\r
17             var assemblies = new List<Assembly>();\r
18 \r
19             // While this may seem like somewhat of a hack, walking the AssemblyParts in the active \r
20             // deployment object is the only way to get the list of assemblies loaded by the XAP. \r
21             /*\r
22             foreach (AssemblyPart ap in Deployment.Current.Parts)\r
23             {\r
24                 StreamResourceInfo sri = Application.GetResourceStream(new Uri(ap.Source, UriKind.Relative));\r
25                 if (sri != null)\r
26                 {\r
27                     // Keep in mind that calling Load on an assembly that is already loaded will\r
28                     // be a no-op and simply return the already loaded assembly object.\r
29                     Assembly assembly = ap.Load(sri.Stream);\r
30                     assemblies.Add(assembly);\r
31                 }\r
32             }\r
33              */\r
34 \r
35             return assemblies;\r
36         }\r
37     }\r
38 }