Exemple #1
0
        void ParseAssembly(Assembly assembly)
        {
#if ATOMIC_DESKTOP || ATOMIC_ANDROID
            String assemblyPath = assembly.GetName().Name;

            Dictionary <string, CSComponentInfo> assemblyTypes = null;

            if (!componentCache.TryGetValue(assemblyPath, out assemblyTypes))
            {
                componentCache[assemblyPath] = assemblyTypes = new Dictionary <string, CSComponentInfo>();
            }

            Type[] types = assembly.GetTypes();

            foreach (var type in types)
            {
                if (type.IsSubclassOf(typeof(CSComponent)))
                {
                    var csinfo = new CSComponentInfo(type);
                    csinfoLookup[csinfo.Type] = csinfo;
                    assemblyTypes[type.Name]  = csinfo;
                }
            }
#endif
        }
Exemple #2
0
        void HandleComponentAssemblyReference(uint eventType, ScriptVariantMap eventData)
        {
            string assemblyPath = eventData["AssemblyPath"];

            Dictionary <string, CSComponentInfo> assemblyTypes = null;

            if (!componentCache.TryGetValue(assemblyPath, out assemblyTypes))
            {
                componentCache[assemblyPath] = assemblyTypes = new Dictionary <string, CSComponentInfo>();
            }

            // HACK!
            if (PlayerApp.DeployedApp)
            {
                assemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "/AtomicProject.dll";
            }

            Assembly assembly = Assembly.LoadFrom(assemblyPath);

            Type[] types = assembly.GetTypes();

            foreach (var type in types)
            {
                if (type.IsSubclassOf(typeof(CSComponent)))
                {
                    var csinfo = new CSComponentInfo(type);
                    csinfoLookup[csinfo.Type] = csinfo;
                    assemblyTypes[type.Name]  = csinfo;
                }
            }
        }
        void HandleComponentAssemblyReference(uint eventType, ScriptVariantMap eventData)
        {
            string assemblyPath = eventData["AssemblyPath"];

            Dictionary<string, CSComponentInfo> assemblyTypes = null;

            if (!componentCache.TryGetValue(assemblyPath, out assemblyTypes))
            {
                componentCache[assemblyPath] = assemblyTypes = new Dictionary<string, CSComponentInfo>();
            }

            // HACK!
            if (PlayerApp.DeployedApp)
            {
                assemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "/AtomicProject.dll";
            }

            Assembly assembly = Assembly.LoadFrom(assemblyPath);

            Type[] types = assembly.GetTypes();

            foreach (var type in types)
            {
                if (type.IsSubclassOf(typeof(CSComponent)))
                {
                    var csinfo = new CSComponentInfo(type);
                    csinfoLookup[csinfo.Type] = csinfo;
                    assemblyTypes[type.Name] = csinfo;
                }
            }
        }
        void ParseAssembly(Assembly assembly)
        {
#if ATOMIC_DESKTOP || ATOMIC_MOBILE
            if (parsedAssemblies.ContainsKey(assembly))
            {
                return;
            }

            parsedAssemblies[assembly] = true;

            Type[] types = assembly.GetTypes();

            foreach (var type in types)
            {
                if (type.IsSubclassOf(typeof(CSComponent)))
                {
                    var csinfo = new CSComponentInfo(type);
                    csinfoLookup[csinfo.Type] = csinfo;
                    componentCache[type.Name] = csinfo;
                }
            }
#endif
        }
        void ParseAssembly(Assembly assembly)
        {
            #if ATOMIC_DESKTOP || ATOMIC_MOBILE

            if (parsedAssemblies.ContainsKey(assembly))
            {
                return;
            }

            parsedAssemblies[assembly] = true;

            Type[] types = assembly.GetTypes();

            foreach (var type in types)
            {
                if (type.IsSubclassOf(typeof(CSComponent)))
                {
                    var csinfo = new CSComponentInfo(type);
                    csinfoLookup[csinfo.Type] = csinfo;
                    componentCache[type.Name] = csinfo;
                }
            }
            #endif
        }