Exemplo n.º 1
0
        /// <summary>
        ///		Put all static objects into global objects collection.
        ///		<para>
        ///			THIS METHOD MUST BE CALLED PRIOR TO ANY OTHER CALLS!
        ///		</para>
        /// </summary>
        /// <param name="classes">
        ///		The classes where the desired importing static objects are located
        /// </param>
        public static void ImportEntryObjects(params Type[] classes)
        {
            foreach (var type in classes)
            {
                // Load all static properties
                foreach (var property in
                         type.GetVisibleProperties(BindingFlags.Public | BindingFlags.Static))
                {
                    ObjectNode node = ObjectNode.Create(null, property);
                    Roots.Add(node);
                }

                // Load all static methods
                foreach (var method in type.GetVisibleMethods(BindingFlags.Public | BindingFlags.Static))
                {
                    MethodNode node = MethodNode.Create(null, method);
                    Roots.Add(node);
                }
            }
        }