From fd382a796b78bd460ab7ad87af3f001f23f5a27c Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 28 Dec 2017 01:52:11 +0100 Subject: Fix for #28 - RRT file lock becomes a "terminal" issue only on initial load, on subsequent refreshes it's ignored (but sends an empty names list, so generates a warning) --- Aktywator/RRBTournament.cs | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/Aktywator/RRBTournament.cs b/Aktywator/RRBTournament.cs index 48040ee..3e73d43 100644 --- a/Aktywator/RRBTournament.cs +++ b/Aktywator/RRBTournament.cs @@ -54,25 +54,29 @@ namespace Aktywator override internal Dictionary> getNameList() { - this._xml.Load(this._name); Dictionary> names = new Dictionary>(); - foreach (XmlNode pair in this._xml.SelectNodes("//lista/para")) + try { - int pairNo = Int32.Parse(pair.SelectSingleNode("numer").InnerText); - names.Add(pairNo, new List()); - foreach (XmlNode player in pair.SelectNodes("gracz/nazwisko")) + this._xml.Load(this._name); + foreach (XmlNode pair in this._xml.SelectNodes("//lista/para")) { - names[pairNo].Add(player.InnerText); + int pairNo = Int32.Parse(pair.SelectSingleNode("numer").InnerText); + names.Add(pairNo, new List()); + foreach (XmlNode player in pair.SelectNodes("gracz/nazwisko")) + { + names[pairNo].Add(player.InnerText); + } } - } - foreach (KeyValuePair> pair in names) - { - while (pair.Value.Count < 2) + foreach (KeyValuePair> pair in names) { - pair.Value.Add(" "); + while (pair.Value.Count < 2) + { + pair.Value.Add(" "); + } } } + catch (Exception) { } return names; } } -- cgit v1.2.3