Example #1
0
        /// <summary>
        /// Adds the direct type with math support.
        /// </summary>
        /// <param name="runtime">The runtime.</param>
        /// <param name="mathType">Type of the math.</param>
        public static void AddDirectMathType(RuntimeAssembly runtime, Type mathType)
        {
            var type = typeof(MathDirectType <>).MakeGenericType(mathType);

            var typeDefinition = Activator.CreateInstance(type) as DirectTypeDefinition;

            runtime.AddDirectDefinition(typeDefinition);
        }
Example #2
0
 /// <summary>
 /// Exports the given <see cref="DirectTypeDefinition"/> to <see cref="RuntimeAssembly"/>.
 /// </summary>
 /// <param name="definition">The direct type definition.</param>
 protected void ExportDefinition(DirectTypeDefinition definition)
 {
     Message("Exporting {0} for direct type {1}", definition, definition.DirectType);
     _currentRuntime.AddDirectDefinition(definition);
 }
Example #3
0
        /// <summary>
        /// Adds the direct type.
        /// </summary>
        /// <param name="runtime">The runtime.</param>
        /// <param name="directType">Type of the direct.</param>
        public static void AddDirectType(RuntimeAssembly runtime, Type directType)
        {
            var typeDefinition = new DirectTypeDefinition(directType);

            runtime.AddDirectDefinition(typeDefinition);
        }