Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
ModuleRuntimeHelpers.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System.Linq;
4 using System.Reflection;
5 
6 namespace SiliconStudio.Core.Reflection
7 {
8  public static class ModuleRuntimeHelpers
9  {
10  public static void RunModuleConstructor(Module module)
11  {
12 #if SILICONSTUDIO_PLATFORM_WINDOWS_RUNTIME
13  // Initialize first type
14  // TODO: Find a type without actual .cctor if possible, to avoid side effects
15  System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(module.Assembly.DefinedTypes.First().AsType().TypeHandle);
16 #else
17  System.Runtime.CompilerServices.RuntimeHelpers.RunModuleConstructor(module.ModuleHandle);
18 #endif
19  }
20  }
21 }