public static string GetConfiguration(ConfigPathType configurationType) { switch (configurationType) { case ConfigPathType.OpenSauce: return(Path.Combine(FolderPathFactory.GetFolder(FolderPathType.OpenSauce), ConfigPathResources.OpenSauceSettings)); case ConfigPathType.Halo: return(Path.Combine(FolderPathFactory.GetFolder(FolderPathType.Halo), ConfigPathResources.HaloSettings)); case ConfigPathType.Mapping: return(Path.Combine(FolderPathFactory.GetFolder(FolderPathType.Halo), ConfigPathResources.MappingSettings)); case ConfigPathType.Chimera: return(Path.Combine(FolderPathFactory.GetFolder(FolderPathType.Halo), ConfigPathResources.ChimeraSettings)); case ConfigPathType.LastProf: return(Path.Combine(FolderPathFactory.GetFolder(FolderPathType.Halo), ConfigPathResources.LastProfileText)); case ConfigPathType.Initc: return(Path.Combine(ConfigPathResources.InitcSettings)); default: throw new ArgumentException(ConfigPathResources.InvalidNameException); } }
/// <summary> /// 用正在属性化的配置文件位置特性初始化 <see cref="ConfigFileAttribute"/> 类的新实例。 /// </summary> /// <param name="supportMultiLanguages">是否支持多语言标志。</param> /// <param name="fileName">相对路径文件名。</param> /// <param name="configPathType">文件路径类型。</param> public ConfigFileAttribute(bool supportMultiLanguages, string fileName, ConfigPathType configPathType) { this.configPathType = configPathType; this.supportMultiLanguages = supportMultiLanguages; this.fileName = fileName; }
/// <summary> /// 用正在属性化的配置文件位置特性初始化 <see cref="ConfigFileAttribute"/> 类的新实例。 /// </summary> /// <param name="fileName">相对路径文件名。</param> /// <param name="configPathType">文件路径类型。</param> public ConfigFileAttribute(string fileName, ConfigPathType configPathType) { this.configPathType = configPathType; this.fileName = fileName; }