/// <summary> /// 添加配置项 /// </summary> public void AddItem(string configPath) { if (String.IsNullOrEmpty(configPath)) { return; } var res = Find(s => s.Config == configPath); if (res == null) { SourceFileItemType type = SourceFileItemType.NormalPath; if (configPath.StartsWith("SDCard:")) {// SDCard:/DJI/dji.pilot type = SourceFileItemType.AndroidSDCardPath; } else if (Regex.IsMatch(configPath, @"^\$\S+,")) {// $Audio,m4a;mpeg-4;mp3;wma;wav;ape;acc;ogg;amr;3ga;slk type = SourceFileItemType.FileExtension; } Add(new SourceFileItem(configPath, type, string.Empty)); } }
/// <summary> /// SourceFileItem-构造函数(初始化) /// </summary> public SourceFileItem(string config, SourceFileItemType type, string local) { Config = config; ItemType = type; Local = local; }