langfilelistretriever.cs

来自「这是一个小型的相片管理器」· CS 代码 · 共 44 行

CS
44
字号


using System;
using System.Collections;
using System.IO;

namespace VirtualPhotoOrganizer.Util
{
	/// <summary>
	/// used to retrieve a list of currently available lang files
	/// </summary>
	internal class LangFileListRetriever
	{
		// stores our list of langFiles
		ArrayList LangFiles = new ArrayList();

		public LangFileListRetriever() {
			GetLangFileList();
		}

		/// <summary>
		/// fills the LangFiles list with the names of the available lang files
		/// </summary>
		private void GetLangFileList() {
			try {
				DirectoryInfo dir = new DirectoryInfo(System.Windows.Forms.Application.StartupPath + "\\Lang");

				foreach (FileInfo fi in dir.GetFiles("*.xml"))
					LangFiles.Add(fi.Name.Substring(0, fi.Name.Length - 4));
			}
			catch { }
		}

		public string[] LanguageFiles {
			get {
				string[] files = new string[LangFiles.Count];
				for (int i = 0; i < LangFiles.Count; i++)
					files[i] = LangFiles[i].ToString();
				return files;
			}
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?