Exemplo n.º 1
0
		/// <summary>
		/// Answer an enumeration of all topic in the ContentBase, sorted using the supplied IComparer (does not include imports)
		/// </summary>
		/// <param name="comparer">Used to sort the topics in the answer</param>
		/// <returns>Enumeration of AbsoluteTopicNames</returns>
		protected IEnumerable AllTopicsSorted(IComparer comparer)
		{
			ArrayList answer = new ArrayList();
			ArrayList all = new ArrayList();
			Set present = new Set();
			foreach (FileInfo each in new DirectoryInfo(Root).GetFiles("*.wiki"))
			{
				FileInfoTopicData td = new FileInfoTopicData(each, Namespace);
				all.Add(td);
				present.Add(td.Name);
			}
			foreach (BackingTopic each in BackingTopics.Values)
			{
				BackingTopicTopicData td = new BackingTopicTopicData(each);
				if (present.Contains(td.Name))
					continue;
				all.Add(td);				
			}
			if (comparer != null)
				all.Sort(comparer);
			foreach (TopicData each in all)
			{
				AbsoluteTopicName name = new AbsoluteTopicName(each.Name, each.Namespace);
				answer.Add(name);
			}
			return answer;
		}
Exemplo n.º 2
0
        public override QualifiedTopicNameCollection AllTopics()
        {
            QualifiedTopicNameCollection topics = new QualifiedTopicNameCollection();
            foreach (IFileInformation file in FileSystem.GetFiles(Root, "*.wiki"))
            {
                FileInfoTopicData topicData = new FileInfoTopicData(file, Namespace);
                topics.Add(new QualifiedTopicName(topicData.Name, topicData.Namespace));
            }

            return topics;
        }