// This updates cached XML, will still need flushing to disk afterwards in OutputToXml()
        public void SaveSnapshotRevision(VolumeSnapshot snapshot)
        {
            VolumeSnapshotRevision revision = snapshot.Revision;

            if (mSnapshotDictionary.ContainsKey(revision))
            {
                mSnapshotDictionary[revision] = snapshot;
            }
            else
            {
                mSnapshotDictionary.Add(revision, snapshot);
            }
            if (!mSnapshotsStored.Contains(revision))
            {
                mSnapshotsStored.Add(revision);
            }

            PWLib.Platform.Windows.Directory.CreateDirectory(mXmlRootDir);
            XmlTextWriter xmlWriter = new XmlTextWriter(GetRevisionFileName(revision), Encoding.Unicode);

            xmlWriter.Formatting = Formatting.Indented;
            xmlWriter.WriteStartDocument();

            snapshot.OutputToXml(xmlWriter);

            xmlWriter.Close();
        }
        // This updates cached XML, will still need flushing to disk afterwards in OutputToXml()
        public void SaveSnapshotRevision(VolumeSnapshot snapshot)
        {
            VolumeSnapshotRevision revision = snapshot.Revision;

            if (mSnapshotDictionary.ContainsKey(revision))
            {
                mSnapshotDictionary[revision] = snapshot;
            }
            else
            {
                mSnapshotDictionary.Add(revision, snapshot);
            }

            System.IO.StringWriter stringWriter = new System.IO.StringWriter();
            XmlTextWriter          xmlWriter    = new XmlTextWriter(stringWriter);

            xmlWriter.Formatting = Formatting.Indented;

            snapshot.OutputToXml(xmlWriter);

            string xmlFragment = stringWriter.ToString();

            xmlWriter.Close();
            stringWriter.Close();

            if (mSnapshotXmlCache.ContainsKey(revision))
            {
                mSnapshotXmlCache[revision] = xmlFragment;
            }
            else
            {
                mSnapshotXmlCache.Add(revision, xmlFragment);
            }
        }
        // This updates cached XML, will still need flushing to disk afterwards in OutputToXml()
        public void SaveSnapshotRevision( VolumeSnapshot snapshot )
        {
            VolumeSnapshotRevision revision = snapshot.Revision;
            if ( mSnapshotDictionary.ContainsKey( revision ) )
                mSnapshotDictionary[ revision ] = snapshot;
            else
                mSnapshotDictionary.Add( revision, snapshot );
            if ( !mSnapshotsStored.Contains( revision ) )
                mSnapshotsStored.Add( revision );

            PWLib.Platform.Windows.Directory.CreateDirectory( mXmlRootDir );
            XmlTextWriter xmlWriter = new XmlTextWriter( GetRevisionFileName( revision ), Encoding.Unicode );
            xmlWriter.Formatting = Formatting.Indented;
            xmlWriter.WriteStartDocument();

            snapshot.OutputToXml( xmlWriter );

            xmlWriter.Close();
        }
        // This updates cached XML, will still need flushing to disk afterwards in OutputToXml()
        public void SaveSnapshotRevision( VolumeSnapshot snapshot )
        {
            VolumeSnapshotRevision revision = snapshot.Revision;
            if ( mSnapshotDictionary.ContainsKey( revision ) )
                mSnapshotDictionary[ revision ] = snapshot;
            else
                mSnapshotDictionary.Add( revision, snapshot );

            System.IO.StringWriter stringWriter = new System.IO.StringWriter();
            XmlTextWriter xmlWriter = new XmlTextWriter( stringWriter );
            xmlWriter.Formatting = Formatting.Indented;

            snapshot.OutputToXml( xmlWriter );

            string xmlFragment = stringWriter.ToString();

            xmlWriter.Close();
            stringWriter.Close();

            if ( mSnapshotXmlCache.ContainsKey( revision ) )
                mSnapshotXmlCache[ revision ] = xmlFragment;
            else
                mSnapshotXmlCache.Add( revision, xmlFragment );
        }