ACAT.Lib.Core.AbbreviationsManagement.Abbreviations.createAbbreviationsFile C# (CSharp) Method

createAbbreviationsFile() private method

Creates an empty abbreviations file
private createAbbreviationsFile ( String fileName ) : XmlTextWriter
fileName String Name of the file
return System.Xml.XmlTextWriter
        private XmlTextWriter createAbbreviationsFile(String fileName)
        {
            XmlTextWriter xmlTextWriter;

            // overwrite even if it already exists
            try
            {
                xmlTextWriter = new XmlTextWriter(fileName, null) { Formatting = Formatting.Indented };
                xmlTextWriter.WriteStartDocument();
                xmlTextWriter.WriteStartElement("ACAT");
                xmlTextWriter.WriteStartElement("Abbreviations");
            }
            catch (Exception ex)
            {
                Log.Debug(ex.ToString());
                xmlTextWriter = null;
            }

            return xmlTextWriter;
        }