private static void ConstructType(Type type, Dictionary <string, TypeInformation> objectTypes) { if (!type.IsAbstract) { var typeAttributes = type.GetCustomAttribute(typeof(EditorTypeAttribute)); if (typeAttributes != null) { objectTypes.Add(type.Name, TypeInformation.Construct(type)); } } }
public static BehaviourManifest CreateFromAppDomain(AppDomain appDomain) { var manifest = new BehaviourManifest(); var objectTypes = new Dictionary <string, TypeInformation>(); foreach (var type in frameworkTypes) { objectTypes.Add(type.Name, TypeInformation.Construct(type)); } var nodeTypes = new Dictionary <string, NodeInformation>(); foreach (var assembly in GetDependentAssemblies(appDomain, typeof(NodeTemplate).Assembly)) { Type[] types; try { types = assembly.GetTypes(); } catch { continue; } foreach (var type in types) { ConstructType(type, objectTypes); if (type.IsAbstract) { continue; } if (typeof(NodeTemplate).IsAssignableFrom(type)) { nodeTypes.Add(type.FullName, NodeInformation.Construct(type)); } } } manifest.Types = new TypeManifest() { ObjectTypes = objectTypes, NodeTypes = nodeTypes, }; return(manifest); }