Exemplo n.º 1
0
        public override string Index(string folderPath)
        {
            FolderInfo folderInfo = GetFolderInfo(folderPath);

            folderInfo.Update();

            XmlWriterSettings xmlWriterSettings = new XmlWriterSettings();

            xmlWriterSettings.Encoding         = new UTF8Encoding(false);
            xmlWriterSettings.ConformanceLevel = ConformanceLevel.Document;
            xmlWriterSettings.Indent           = true;

            using (MemoryStream ms = new MemoryStream())
            {
                using (xmlWriter = XmlWriter.Create(ms, xmlWriterSettings))
                {
                    xmlWriter.WriteStartDocument();
                    IndexFolder(folderInfo);
                    xmlWriter.WriteEndDocument();
                    xmlWriter.Flush();
                }

                return(Encoding.UTF8.GetString(ms.ToArray()));
            }
        }
Exemplo n.º 2
0
        public virtual string Index(string folderPath)
        {
            FolderInfo folderInfo = GetFolderInfo(folderPath);

            folderInfo.Update();

            IndexFolder(folderInfo);

            return(sbContent.ToString());
        }