CSL_Test__1.TorrentXMLHandler.SaveAndClose C# (CSharp) Method

SaveAndClose() public static method

public static SaveAndClose ( ) : void
return void
        public static void SaveAndClose()
        {
            dataset.AcceptChanges();

            if (xmlStream.Name.Equals(xmlDataName))
                dataset.WriteXml(xmlStream);
            else
            {
                xmlStream.Close();
                xmlStream = new FileStream(xmlDataName, FileMode.OpenOrCreate);
                dataset.WriteXml(xmlStream);
            }

            xmlStream.Close();
        }