Esempio n. 1
0
	public void Add (Topic t)
	{
		Count++;
		if (topics == null)
			topics = t;
		else {
			if (!(topics is ArrayList)){
				Topic temp = (Topic) topics;

				topics = new ArrayList ();
				((ArrayList)topics).Add (temp);
			}
			((ArrayList)topics).Add (t);
		}
	}
Esempio n. 2
0
			// Names from the ECMA provider are somewhat
			// ambigious (you have like a million ToString
			// methods), so lets give the user the full name
			string RenderTopicMatch (Topic t)
			{
				// Filter out non-ecma
				if (t.Url [1] != ':')
					return t.Caption;
	
				switch (t.Url [0]) {
				case 'C': return t.Url.Substring (2) + " constructor";
				case 'M': return t.Url.Substring (2) + " method";
				case 'P': return t.Url.Substring (2) + " property";
				case 'F': return t.Url.Substring (2) + " field";
				case 'E': return t.Url.Substring (2) + " event";
				}
				return t.Caption;
			}
Esempio n. 3
0
		public void Add (Topic t)
		{
			Count++;
			topics.Add (t);
		}
Esempio n. 4
0
		public void Add (string caption, string sort_key, string url)
		{
			Topic t = new Topic (caption, sort_key, url);
			AddTopic (t);
		}
Esempio n. 5
0
		public void AddTopic (Topic topic)
		{
			IndexEntry entry;
			if (!entries.TryGetValue (topic.SortKey, out entry)) {
				entry = new IndexEntry ();
				entries[topic.SortKey] = entry;
			}

			AddString (topic.SortKey);
			AddString (topic.Caption);
			AddString (topic.Url);
			entry.Add (topic);
		}
Esempio n. 6
0
	//
	// Constructor from a stream
	//
	public IndexEntry (FileStream fs, BinaryReader reader, int position)
	{
		Count = reader.ReadInt32 ();
		int caption_offset = reader.ReadInt32 ();
		string caption;
		
		if (Count == 1){
			int url_offset = reader.ReadInt32 ();
			fs.Position = caption_offset;
			caption = reader.ReadString ();
			fs.Position = url_offset;
			string url = reader.ReadString ();
			topics = new Topic (caption, "", url);
		} else {
			ArrayList l = new ArrayList (Count);
			topics = l;
			int [] offsets = new int [Count];
			for (int i = 0; i < Count; i++){
				offsets [i] = reader.ReadInt32 ();
			}
			fs.Position = caption_offset;
			caption = reader.ReadString ();
			for (int i = 0; i < Count; i++){
				fs.Position = offsets [i];
				string url = reader.ReadString ();
				l.Add (new Topic (caption, "", url));
			}
		}
	}
Esempio n. 7
0
	public void AddTopic (Topic topic)
	{
		IndexEntry entry = (IndexEntry) entries [topic.SortKey];
		if (entry == null){
			entry = new IndexEntry ();
			entries [topic.SortKey] = entry;
		}

		add_string (topic.SortKey);
		add_string (topic.Caption);
		add_string (topic.Url);
		entry.Add (topic);
	}