Пример #1
0
        /// <summary>
        ///   讀取全域設定
        /// </summary>
        /// <param name="filename">設定檔名稱</param>
        public static void Load(string filename)
        {
            if (File.Exists(filename))
            {
                string[] sDatas = File.ReadAllLines(filename, Encoding.UTF8);
                __cChartProfile = JsonConvert.DeserializeObject <ChartProfile>(sDatas[0]);
                __cPaths        = JsonConvert.DeserializeObject <PathSetting>(sDatas[1]);
                __cBase         = JsonConvert.DeserializeObject <BaseSetting>(sDatas[2]);
                __cTesting      = JsonConvert.DeserializeObject <TestSetting>(sDatas[3]);
            }

            //加入延伸模組
            string sPath = Path.GetDirectoryName(filename);

            string[] sFiles = Directory.GetFiles(sPath + ".\\plugins\\extends", "*.dll");
            foreach (string sFile in sFiles)
            {
                Assembly.LoadFrom(sFile);
            }
        }
Пример #2
0
		/// <summary>
		///   讀取全域設定
		/// </summary>
		/// <param name="filename">設定檔名稱</param>
		public static void Load(string filename) {
			if (File.Exists(filename)) {
				string[] sDatas = File.ReadAllLines(filename, Encoding.UTF8);
				__cPaths = JsonConvert.DeserializeObject<PathSetting>(sDatas[0]);
			}
		}