Example #1
0
        public void WriteTopics(IndexMaker maker, Stream stream, BinaryWriter writer)
        {
            //
            // Convention: entries with the same SortKey should have the same Caption
            //
            Position = (int)stream.Position;
            writer.Write(Count);

            if (topics is ArrayList)
            {
                bool first = true;
                foreach (Topic t in (ArrayList)topics)
                {
                    if (first)
                    {
                        writer.Write(maker.GetCode(t.Caption));
                        first = false;
                    }
                    writer.Write(maker.GetCode(t.Url));
                }
            }
            else
            {
                Topic t = (Topic)topics;

                writer.Write(maker.GetCode(t.Caption));
                writer.Write(maker.GetCode(t.Url));
            }
        }
Example #2
0
        public void GenerateIndex()
        {
            IndexMaker indexMaker = new IndexMaker();

            foreach (HelpSource current in this.helpSources)
            {
                current.PopulateIndex(indexMaker);
            }
            string text = Path.Combine(this.basedir, "monodoc.index");

            try {
                indexMaker.Save(text);
            } catch (UnauthorizedAccessException) {
                text = Path.Combine(ConfigurationManager.AppSettings["docDir"], "monodoc.index");
                try {
                    indexMaker.Save(text);
                } catch (UnauthorizedAccessException) {
                    Console.WriteLine("Unable to write index file in {0}", Path.Combine(ConfigurationManager.AppSettings["docDir"], "monodoc.index"));
                    return;
                }
            }
            if (RootTree.IsUnix)
            {
                RootTree.chmod(text, 420);
            }

            Console.WriteLine("Documentation index at {0} updated", text);
        }
Example #3
0
 //
 // Populates the index.
 //
 public virtual void PopulateIndex(IndexMaker index_maker)
 {
 }
Example #4
0
		public void WriteTopics (IndexMaker maker, Stream stream, BinaryWriter writer)
		{
			//
			// Convention: entries with the same SortKey should have the same Caption
			//
			Position = (int) stream.Position;
			writer.Write (Count);

			if (topics is ArrayList){
				bool first = true;
				foreach (Topic t in (ArrayList) topics){
					if (first){
						writer.Write (maker.GetCode (t.Caption));
						first = false;
					}
					writer.Write (maker.GetCode (t.Url));
				}
			} else {
				Topic t = (Topic) topics;

				writer.Write (maker.GetCode (t.Caption));
				writer.Write (maker.GetCode (t.Url));
			}
		}