Esempio n. 1
0
        private void GenerateIfNotExists(XmlEntryStandard rootEntry)
        {
            if (FileExists)
            {
                return;
            }
            if (!PathExists)
            {
                Info = @"Filepath not found";
                return;
            }

            _xmlFunctions.GenerateFile(rootEntry);
            if (!_xmlFunctions.Success)
            {
                Info = _xmlFunctions.Message;
            }
        }
Esempio n. 2
0
        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, "");
        }
Esempio n. 3
0
 public void InitXmlFile(XmlEntryStandard rootEntry)
 {
     GenerateIfNotExists(rootEntry);
     InitialLoad();
 }