/// <summary> /// Updates the date in NewDarkLoader.ini with the date from Darkloader.ini if they are not the same. Assumes latter is correct. /// </summary> private void oldDateToNewDate(INIFile oldINI, INIFile newINI, string oldSectionName, string newSectionName, DateType relPlay, bool fmTypeArchive) { string oldINIDate; string newINIDate; if (relPlay == DateType.Release) { if (fmTypeArchive) { oldINIDate = oldINI.IniReadValue(oldSectionName, "misdate"); } else { oldINIDate = oldINI.INIReadValueNoSize(oldSectionName, "misdate"); } newINIDate = newINI.IniReadValue(newSectionName, nKeys.ReleaseDateInt); } else { if (fmTypeArchive) { oldINIDate = oldINI.IniReadValue(oldSectionName, "date"); } else { oldINIDate = oldINI.INIReadValueNoSize(oldSectionName, "date"); } newINIDate = newINI.IniReadValue(newSectionName, nKeys.LastPlayedInt); } if (oldINIDate != "") { DateTime oldDateTime = DateIntConverter.oldDateIntToDateTime(oldINIDate); if (newINIDate != "") { DateTime newDateTime = DateIntConverter.dateFromHexString(newINIDate); if (oldDateTime != newDateTime) { string hexDate = DateIntConverter.dateToHexString(oldDateTime); writeDateToINI(newINI, newSectionName, relPlay, hexDate); } } else { string hexDate = DateIntConverter.dateToHexString(oldDateTime); writeDateToINI(newINI, newSectionName, relPlay, hexDate); } } }
private DateTime stringToDateTime(string dateHexString) { DateTime convertedDate = DateIntConverter.dateFromHexString(dateHexString); return(convertedDate); }