Exemple #1
0
        //============================================================
        // <T>根据名称查找打开主题。</T>
        //
        // @param name 名称
        // @return 主题
        //============================================================
        public FDrTheme FindOpen(string name)
        {
            string   code  = RDrUtil.FormatPathToCode(name);
            FDrTheme theme = _themes.Find(code);

            if (theme != null)
            {
                theme.Open();
            }
            return(theme);
        }
Exemple #2
0
        //============================================================
        // <T>扫描所有节点。</T>
        //
        // @param folder 文件夹
        // @param path 路径
        //============================================================
        private void ScanNodes(FDrFolder folder, string path)
        {
            string fileTag = string.Empty;

            // 文件夹排序
            folder.Folders.Sort();
            // 循环取得每个文件
            foreach (FDrFolder subfloder in folder.Folders)
            {
                // 获得经过处理的名称
                string[] items = subfloder.Name.Split('-');
                if (items.Length >= 3)
                {
                    string type    = items[0];
                    string dotPath = path + "\\" + items[1];
                    if ("fd" == type)
                    {
                        subfloder.Type  = "folder";
                        subfloder.Label = items[1] + " [" + items[2] + "]";
                    }
                    else if ("tm" == type)
                    {
                        subfloder.Type = "theme";
                        FDrTheme theme = new FDrTheme();
                        subfloder.Label       = items[1] + " [" + items[2] + "]";
                        theme.Name            = dotPath;
                        theme.Label           = items[2];
                        theme.Directory       = subfloder.Directory;
                        theme.DirectoryExprot = _exportDirectory;
                        theme.Scan();
                        subfloder.Tag = theme;
                        // 存储对照表
                        _themes.Set(theme.Code, theme);
                        _folders.Push(subfloder);
                    }
                    ScanNodes(subfloder, dotPath);
                }
            }
        }