Exemplo n.º 1
0
        public static NodeManifest Construct(Type[] types)
        {
            var manifest = new NodeManifest();

            var information = new Dictionary <string, NodeInformation> ();

            foreach (var type in types)
            {
                information.Add(type.FullName, NodeInformation.Construct(type));
            }
            manifest.Nodes = information;
            return(manifest);
        }
Exemplo n.º 2
0
        public static NodeManifest Construct(Type[] types)
        {
            var manifest = new NodeManifest();

            var information = new List <NodeInformation> ();

            foreach (var type in types)
            {
                information.Add(NodeInformation.Construct(type));
            }
            manifest.Nodes = information.ToArray();
            return(manifest);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        public static NodeManifest Construct()
        {
            var manifest = new NodeManifest();

            var information = new Dictionary <string, NodeInformation> ();

            foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
            {
                foreach (var type in assembly.GetTypes())
                {
                    if (type.IsAbstract)
                    {
                        continue;
                    }

                    if (typeof(Node).IsAssignableFrom(type))
                    {
                        information.Add(type.FullName, NodeInformation.Construct(type));
                    }
                }
            }
            manifest.Nodes = information;
            return(manifest);
        }