// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Threading; using System.Xml; using System.Reflection; using System.Text; using PascalABCCompiler.Parsers; namespace CodeCompletion { public class UnitDocCache { private static Hashtable ht = new Hashtable(); private static List elem_cache = new List(); private static System.Threading.Thread th = null; public static AbstractDispatcher dispatcher=null; public static void Reset() { if (th != null) while (th.ThreadState == ThreadState.Running); elem_cache.Clear(); //namespace_elem_cache.Clear(); //doc_namespace_list.Clear(); } public static void Load(SymScope unit, string fileName) { if (ht[unit] != null) return; string xml_loc = CodeCompletionTools.XmlDoc.LookupLocalizedXmlDocForUnit(fileName, CodeCompletionController.currentLanguageISO); if (xml_loc != null) { CodeCompletionTools.XmlDoc xdoc = CodeCompletionTools.XmlDoc.Load(xml_loc, Environment.GetEnvironmentVariable("TEMP"), false); ht[unit] = xdoc; } } public static void LoadWithSources(SymScope unit, string fileName) { if (ht[unit] != null) return; string xml_loc = CodeCompletionTools.XmlDoc.LookupLocalizedXmlDocForUnitWithSources(fileName, CodeCompletionController.currentLanguageISO); if (xml_loc != null) { CodeCompletionTools.XmlDoc xdoc = CodeCompletionTools.XmlDoc.Load(xml_loc, Environment.GetEnvironmentVariable("TEMP"), false); ht[unit] = xdoc; } } private static void internalCompleteDocumentation() { try { if (dispatcher == null) return; for (int i=0; i 0) { sb.Append("("); for (int i=0; i