public static Profile LoadProfileFromXmlFile(string path) { // 読み込み Profile profile; try { profile = SettingSerializer.LoadSettings <Profile>(path); } catch { profile = new Profile(); } return(profile); }
/* ---------------------------------------------------- */ // IO /* ---------------------------------------------------- */ /// <summary> /// Xmlから読み込み /// </summary> /// <returns></returns> public AppSetting loadFromXmlFile() { // exeのディレクトリ string exeDir = Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName; // 入力パス string inputFullPath = exeDir + "\\AppSetting.xml"; // 読み込み AppSetting appSetting; try { appSetting = SettingSerializer.LoadSettings <AppSetting>(inputFullPath); } catch { appSetting = new AppSetting(); } return(appSetting); }