GetModuleFile() публичный Метод

public GetModuleFile ( string fileType, string alias ) : ModuleFile
fileType string
alias string
Результат ModuleFile
        public ModuleFile GetModuleFile(string fullAlias)
        {
            int    indexOfColon = fullAlias.IndexOf(':');
            string module       = fullAlias.Substring(0, indexOfColon);
            string alias        = fullAlias.Substring(indexOfColon + 1);
            Module mod          = ModuleDataManager.GetInstance().GetMod(module);

            if (mod == null)
            {
                return(null);
            }

            ModuleFile result;

            result = mod.GetModuleFile("aliases", alias);
            if (result != null)
            {
                return(result);
            }

            result = mod.GetModuleFile("components", alias);
            if (result != null)
            {
                return(result);
            }

            result = mod.GetModuleFile("controllers", alias);
            if (result != null)
            {
                return(result);
            }

            return(null);
        }
Пример #2
0
        public FileData GetSelectedFileData(string selected)
        {
            string[] path = selected.Split('\\');
            if (path.Length <= 2)
            {
                return(null);
            }

            Module     module = mModules[path[0]];
            ModuleFile file   = module.GetModuleFile(path[1], path[2]);

            if (file != null)
            {
                return(file.GetFileData(path));
            }

            return(null);
        }
        public FileData GetSelectedFileData(string selected)
        {
            // FullPath is a property of treeviews that consists of the labels of all of the
            // tree nodes that must be navigated to reach the selected tree node
            string[] path = selected.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);

            if (path.Length <= 2 || !mModules.ContainsKey(path[0]))
            {
                return(null);
            }

            Module     module = mModules[path[0]];
            ModuleFile file   = module.GetModuleFile(path[1], path[2]);

            if (file != null)
            {
                return(file.GetFileData(path));
            }

            return(null);
        }