private bool XmlMatch(string matchwidth) { var retval = false; if (Acumulator.Instance().SavedXml == null) { retval = false; } else { var cntr = 0; Start: if (cntr < 3) { cntr++; try { SaveLoadXML slx = new SaveLoadXML(); foreach (var r in Acumulator.Instance().OTracker.offerteRuimte_.Children.Where(c => c.GetType() == typeof(Ruimte))) { (r as Ruimte).GetMetersAdjusted((r as Ruimte).GetSaldoMeters()); (r as Ruimte).GetSaldoMetersAccent(); (r as Ruimte).GetSaldoMetersHoek(); } var curxml = slx.SerializeOfferte(Acumulator.Instance().OTracker.offerteRuimte_); curxml = NormalizeXml(curxml); Acumulator.Instance().lastGeneratedXml = curxml; string savedxml; if (matchwidth != null) { savedxml = matchwidth; } else { savedxml = Acumulator.Instance().SavedXml; } savedxml = NormalizeXml(savedxml); // retval = String.Equals(curxml, savedxml, StringComparison.Ordinal); for (int i = 0; i < curxml.Length; i++) { if (curxml[i] != savedxml[i]) { var totc = curxml.Substring(i); var tots = savedxml.Substring(i); break; } } var hash_curxml = CalculateMD5Hash(curxml); var hash_savedxml = CalculateMD5Hash(savedxml); retval = String.Equals(hash_curxml, hash_savedxml, StringComparison.Ordinal); } catch (Exception e) { LogHelper.SendLog(e.Message, LogType.error); goto Start; } } } return(retval); }