コード例 #1
0
        /// <summary>
        /// Gets the engine associated with the plugin.
        /// The engine is created if not bound to the enitty.
        /// </summary>
        /// <param name="plugin"></param>
        /// <returns></returns>
        internal Engine BindEngine(PluginEngineEntity plugin)
        {
            Engine engine = plugin.DataElement.Annotation <Engine>();

            if (engine == null)
            {
                engine = new Engine(plugin);
                plugin.DataElement.AddAnnotation(engine);
            }
            return(engine);
        }
コード例 #2
0
 internal Engine(PluginEngineEntity plugin)
 {
     _plugin           = plugin;
     model             = (Model)plugin.Model;
     pluginconstructor = Type.GetType(plugin.PluginTypeName).GetConstructor(new Type[0]);
 }