summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMetadata.cs
diff options
context:
space:
mode:
authorJiyoung Yun <jy910.yun@samsung.com>2017-02-10 11:35:12 (GMT)
committerJiyoung Yun <jy910.yun@samsung.com>2017-02-10 11:35:12 (GMT)
commit4b11dc566a5bbfa1378d6266525c281b028abcc8 (patch)
treeb48831a898906734f8884d08b6e18f1144ee2b82 /src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMetadata.cs
parentdb20f3f1bb8595633a7e16c8900fd401a453a6b5 (diff)
downloadcoreclr-4b11dc566a5bbfa1378d6266525c281b028abcc8.zip
coreclr-4b11dc566a5bbfa1378d6266525c281b028abcc8.tar.gz
coreclr-4b11dc566a5bbfa1378d6266525c281b028abcc8.tar.bz2
Imported Upstream version 1.0.0.9910upstream/1.0.0.9910
Diffstat (limited to 'src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMetadata.cs')
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMetadata.cs100
1 files changed, 3 insertions, 97 deletions
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMetadata.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMetadata.cs
index 9ca959c..f097c6a 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMetadata.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMetadata.cs
@@ -16,94 +16,10 @@ namespace System.Runtime.InteropServices.WindowsRuntime
using System.Runtime.InteropServices;
using System.Security;
- public static class WindowsRuntimeMetadata
+ internal static class WindowsRuntimeMetadata
{
- // Wrapper for Win8 API RoResolveNamespace with default Windows SDK path as installed .winmd files in %WINDIR%\system32\WinMetadata.
- public static IEnumerable<string> ResolveNamespace(string namespaceName, IEnumerable<string> packageGraphFilePaths)
- {
- return ResolveNamespace(namespaceName, null, packageGraphFilePaths);
- }
-
- // Wrapper for Win8 API RoResolveNamespace.
- public static IEnumerable<string> ResolveNamespace(string namespaceName, string windowsSdkFilePath, IEnumerable<string> packageGraphFilePaths)
- {
- if (namespaceName == null)
- throw new ArgumentNullException(nameof(namespaceName));
- Contract.EndContractBlock();
-
- string[] packageGraphFilePathsArray = null;
- if (packageGraphFilePaths != null)
- {
- List<string> packageGraphFilePathsList = new List<string>(packageGraphFilePaths);
- packageGraphFilePathsArray = new string[packageGraphFilePathsList.Count];
-
- int index = 0;
- foreach (string packageGraphFilePath in packageGraphFilePathsList)
- {
- packageGraphFilePathsArray[index] = packageGraphFilePath;
- index++;
- }
- }
-
- string[] retFileNames = null;
- nResolveNamespace(
- namespaceName,
- windowsSdkFilePath,
- packageGraphFilePathsArray,
- ((packageGraphFilePathsArray == null) ? 0 : packageGraphFilePathsArray.Length),
- JitHelpers.GetObjectHandleOnStack(ref retFileNames));
-
- return retFileNames;
- }
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- private extern static void nResolveNamespace(
- string namespaceName,
- string windowsSdkFilePath,
- string[] packageGraphFilePaths,
- int cPackageGraphFilePaths,
- ObjectHandleOnStack retFileNames);
+ private static EventHandler<DesignerNamespaceResolveEventArgs> DesignerNamespaceResolve;
-#if FEATURE_REFLECTION_ONLY_LOAD
- [method: System.Security.SecurityCritical]
- public static event EventHandler<NamespaceResolveEventArgs> ReflectionOnlyNamespaceResolve;
-
- internal static RuntimeAssembly[] OnReflectionOnlyNamespaceResolveEvent(AppDomain appDomain, RuntimeAssembly assembly, string namespaceName)
- {
- EventHandler<NamespaceResolveEventArgs> eventHandler = ReflectionOnlyNamespaceResolve;
- if (eventHandler != null)
- {
- Delegate[] ds = eventHandler.GetInvocationList();
- int len = ds.Length;
- for (int i = 0; i < len; i++)
- {
- NamespaceResolveEventArgs eventArgs = new NamespaceResolveEventArgs(namespaceName, assembly);
-
- ((EventHandler<NamespaceResolveEventArgs>)ds[i])(appDomain, eventArgs);
-
- Collection<Assembly> assembliesCollection = eventArgs.ResolvedAssemblies;
- if (assembliesCollection.Count > 0)
- {
- RuntimeAssembly[] retAssemblies = new RuntimeAssembly[assembliesCollection.Count];
- int retIndex = 0;
- foreach (Assembly asm in assembliesCollection)
- {
- retAssemblies[retIndex] = AppDomain.GetRuntimeAssembly(asm);
- retIndex++;
- }
- return retAssemblies;
- }
- }
- }
-
- return null;
- }
-#endif //FEATURE_REFLECTION_ONLY
-
- [method: System.Security.SecurityCritical]
- public static event EventHandler<DesignerNamespaceResolveEventArgs> DesignerNamespaceResolve;
-
internal static string[] OnDesignerNamespaceResolveEvent(AppDomain appDomain, string namespaceName)
{
EventHandler<DesignerNamespaceResolveEventArgs> eventHandler = DesignerNamespaceResolve;
@@ -142,7 +58,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime
}
#if FEATURE_REFLECTION_ONLY_LOAD
- [ComVisible(false)]
public class NamespaceResolveEventArgs : EventArgs
{
private string _NamespaceName;
@@ -182,20 +97,11 @@ namespace System.Runtime.InteropServices.WindowsRuntime
}
#endif //FEATURE_REFLECTION_ONLY
- [ComVisible(false)]
- public class DesignerNamespaceResolveEventArgs : EventArgs
+ internal class DesignerNamespaceResolveEventArgs : EventArgs
{
private string _NamespaceName;
private Collection<string> _ResolvedAssemblyFiles;
- public string NamespaceName
- {
- get
- {
- return _NamespaceName;
- }
- }
-
public Collection<string> ResolvedAssemblyFiles
{
get