/// <summary> /// Travaille sur le fichier de sortie pour injecter /// </summary> /// <param name="xmlPlateforme"></param> /// <param name="baseGame"></param> private void WorkOnGamesFile(string xmlPlateforme, XElement verbatimGame, string xmlSrcFile, BasicGame baseGame) { // Travail sur le fichier de plateforme using (XML_Games xGame = new XML_Games(xmlPlateforme)) { bool?replace = false; if (xGame.Exists("ID", baseGame.Id)) { replace = AskDxMBox("Game is Already present, replace it (or duplicate) ?", "Question", E_DxButtons.Yes | E_DxButtons.No, baseGame.Title); } if (replace == true) { UpdateStatus?.Invoke(this, $"Removing game: {baseGame.Title}"); xGame.RemoveByChild(Cst.Game, Cst.Id, baseGame.Id); UpdateStatus?.Invoke(this, $"Removing AdditionnalApps: {baseGame.Title}"); xGame.RemoveByChild(Cst.AddApp, Cst.GameId, baseGame.Id); UpdateStatus?.Invoke(this, $"Removing CustomFields: {baseGame.Title}"); xGame.RemoveByChild(Cst.CustField, Cst.GameId, baseGame.Id); UpdateStatus?.Invoke(this, $"Removing AlternateNames"); xGame.RemoveByChild(Cst.AltName, Cst.GameId, baseGame.Id); } // Injection UpdateStatus?.Invoke(this, $"Inject game"); xGame.InjectGame(verbatimGame); UpdateStatus?.Invoke(this, $"Inject additionnal applications"); xGame.InjectAddApps(XML_Games.GetNodes(xmlSrcFile, Cst.AddApp)); UpdateStatus?.Invoke(this, $"Inject custom fields"); xGame.InjectCustomF(XML_Games.GetNodes(xmlSrcFile, Cst.CustField)); /*XML_Games.InjectAddApps(clones, machineXMLFile); * if (PS.Default.wCustomFields) * { * //var r = XML_Games.ListCustomFields(xmlFile, "CustomField"); * XML_Games.Trans_CustomF(xmlFile, machineXMLFile); * }*/ //XML_Games.Remove_Game(lbGame.Id, machineXMLFile); } }