/// <summary> /// Constructor /// </summary> public RequirementDataMapping() { //First we need to get the application roaming settings folder string appDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\Inflectra\" + DATA_FOLDER; //If it doesn't exist, create it if (!Directory.Exists(appDataFolder)) { Directory.CreateDirectory(appDataFolder); } //Now see if the DataSet xml exists this.mappingDataFile = appDataFolder + @"\" + DATA_FILE; this.requirementMappingData = new RequirementMappingData(); if (File.Exists(mappingDataFile)) { //Read in the data requirementMappingData.ReadXml(mappingDataFile, System.Data.XmlReadMode.Auto); } else { //Write out the empty data set requirementMappingData.WriteXml(mappingDataFile); } }
/// <summary> /// Saves the current mapping data to the XML file /// </summary> public void Save() { //Write out the empty data set if (this.requirementMappingData != null && !String.IsNullOrEmpty(mappingDataFile)) { requirementMappingData.WriteXml(mappingDataFile); } }