private void GenerateIfNotExists(XmlEntryStandard rootEntry) { if (FileExists) { return; } if (!PathExists) { Info = @"Filepath not found"; return; } _xmlFunctions.GenerateFile(rootEntry); if (!_xmlFunctions.Success) { Info = _xmlFunctions.Message; } }
public void GenerateFile(XmlEntryStandard rootEntry) { try { new XDocument( new XElement(rootEntry.EntryPrefix , new XAttribute(rootEntry.TypePrefix, rootEntry.TypeName) , new XAttribute(rootEntry.NamePrefix, rootEntry.Name) ) ).Save(_path); } catch (Exception e) { SetSuccess(false, e.Message); return; } SetSuccess(true, ""); }
public void InitXmlFile(XmlEntryStandard rootEntry) { GenerateIfNotExists(rootEntry); InitialLoad(); }