Esempio n. 1
0
        public static Type GetType(string typeStr, enAssemblyType asType)
        {
            Type retType = null;

            switch (asType)
            {
            case enAssemblyType.This:
                return(System.Reflection.Assembly.GetExecutingAssembly().GetType(typeStr));

            case enAssemblyType.FrameSet:
            {
                if (FrameSetAssembly != null)
                {
                    return(FrameSetAssembly.GetType(typeStr));
                }
            }
            break;

            case enAssemblyType.ExamplePlugins:
            {
                if (ExamplePluginsAssembly != null)
                {
                    return(ExamplePluginsAssembly.GetType(typeStr));
                }
            }
            break;

            case enAssemblyType.UISystem:
            {
                if (UISystemAssembly != null)
                {
                    return(UISystemAssembly.GetType(typeStr));
                }
            }
            break;

            case enAssemblyType.All:
            {
                retType = System.Reflection.Assembly.GetExecutingAssembly().GetType(typeStr);

                if (FrameSetAssembly != null && retType == null)
                {
                    retType = FrameSetAssembly.GetType(typeStr);
                }

                if (ExamplePluginsAssembly != null && retType == null)
                {
                    retType = ExamplePluginsAssembly.GetType(typeStr);
                }

                if (UISystemAssembly != null && retType == null)
                {
                    retType = UISystemAssembly.GetType(typeStr);
                }
            }
            break;
            }

            return(retType);
        }
Esempio n. 2
0
        public static Type[] GetTypes(enAssemblyType asType)
        {
            List <Type> types = new List <Type>();

            switch (asType)
            {
            case enAssemblyType.This:
                return(System.Reflection.Assembly.GetExecutingAssembly().GetTypes());

            case enAssemblyType.FrameSet:
            {
                if (FrameSetAssembly != null)
                {
                    return(FrameSetAssembly.GetTypes());
                }
            }
            break;

            case enAssemblyType.ExamplePlugins:
            {
                if (ExamplePluginsAssembly != null)
                {
                    return(ExamplePluginsAssembly.GetTypes());
                }
            }
            break;

            case enAssemblyType.UISystem:
            {
                if (UISystemAssembly != null)
                {
                    return(UISystemAssembly.GetTypes());
                }
            }
            break;

            case enAssemblyType.All:
            {
                if (FrameSetAssembly != null)
                {
                    types.AddRange(FrameSetAssembly.GetTypes());
                }
                if (ExamplePluginsAssembly != null)
                {
                    types.AddRange(ExamplePluginsAssembly.GetTypes());
                }
                if (UISystemAssembly != null)
                {
                    types.AddRange(UISystemAssembly.GetTypes());
                }

                types.AddRange(System.Reflection.Assembly.GetExecutingAssembly().GetTypes());
            }
            break;
            }

            return(types.ToArray());
        }