Exemplo n.º 1
0
 /// <summary>
 /// Search all loaded (non-dynamic) assemblies for a Type matching the given name, the Type
 /// should be derived from UKlawrScriptComponent (but this is not enforced yet).
 /// </summary>
 /// <param name="typeName">The full name of a type (including the namespace).</param>
 /// <param name="componentTypeInfo">Structure to be filled in with type information.</param>
 /// <returns>true if type information matching the given type name was found, false otherwise</returns>
 private bool FindScriptComponentTypeByName(string typeName, out ScriptComponentTypeInfo componentTypeInfo)
 {
     if (!_scriptComponentTypeCache.TryGetValue(typeName, out componentTypeInfo))
     {
         var componentType = FindTypeByName(typeName);
         if (componentType != null)
         {
             componentTypeInfo = GetComponentTypeInfo(componentType);
             // cache the result to speed up future searches
             _scriptComponentTypeCache.Add(typeName, componentTypeInfo);
         }
         else
         {
             return(false);
         }
     }
     return(true);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Search all loaded (non-dynamic) assemblies for a Type matching the given name, the Type
 /// should be derived from UKlawrScriptComponent (but this is not enforced yet).
 /// </summary>
 /// <param name="typeName">The full name of a type (including the namespace).</param>
 /// <param name="componentTypeInfo">Structure to be filled in with type information.</param>
 /// <returns>true if type information matching the given type name was found, false otherwise</returns>
 private bool FindScriptComponentTypeByName(
     string typeName, out ScriptComponentTypeInfo componentTypeInfo
 )
 {
     if (!_scriptComponentTypeCache.TryGetValue(typeName, out componentTypeInfo))
     {
         var componentType = FindTypeByName(typeName);
         if (componentType != null)
         {
             componentTypeInfo = GetComponentTypeInfo(componentType);
             // cache the result to speed up future searches
             _scriptComponentTypeCache.Add(typeName, componentTypeInfo);
         }
         else
         {
             return false;
         }
     }
     return true;
 }