Ejemplo n.º 1
0
Archivo: DT.cs Proyecto: ATL3Y/Ded_Game
        static void LoadProjects()
        {
            mProjects.Clear();
            var types = (from asm in AppDomain.CurrentDomain.GetAssemblies()
                         from t in asm.GetTypes()
                         where t.IsSubclassOf(typeof(DTProject))
                         select t).ToArray();

            foreach (var t in types)
            {
                DTProject newProject = (DTProject)Activator.CreateInstance(t);
                mProjects.Add(newProject.Identifier, newProject);
            }
        }
Ejemplo n.º 2
0
        public static DTProject Project(string identifier)
        {
            DTProject prj = null;

            if (!mProjects.TryGetValue(identifier, out prj))
            {
                LoadProjects();
                if (!mProjects.TryGetValue(identifier, out prj))
                {
                    DTLog.LogError("[DevTools] Unable to find project '" + identifier + "' !");
                }
            }

            return(prj);
        }
Ejemplo n.º 3
0
        static void LoadProjects()
        {
            mProjects.Clear();
            List <Type> types = new List <Type>();

            foreach (Type t in TypeExt.GetLoadedTypes())
            {
                if (t.IsSubclassOf(typeof(DTProject)))
                {
                    types.Add(t);
                }
            }
            foreach (Type t in types)
            {
                DTProject newProject = (DTProject)Activator.CreateInstance(t);
                mProjects.Add(newProject.Identifier, newProject);
            }
        }
Ejemplo n.º 4
0
        public int CompareTo(object obj)
        {
            DTProject other = (DTProject)obj;

            return(Identifier.CompareTo(other.Identifier));
        }