protected BrowserDataSource(IntPtr native_object) : base(native_object) { help_tree = RootTree.LoadTree(); foreach (Node node in help_tree.Nodes) { items.Add(new BrowserItem(node)); } }
static void Main(string[] args) { if (args.Length != 1) { Console.WriteLine("Usage: mod.exe Url"); return; } RootTree help_tree = RootTree.LoadTree(); Node n; Console.WriteLine(help_tree.RenderUrl(args[0], out n)); }
static void Main(string[] args) { if (args.Length < 1) { Console.WriteLine("Usage: mod.exe Url"); return; } bool index = (args.Length == 2); RootTree help_tree = RootTree.LoadTree(); if (index) { Console.WriteLine("Building index"); RootTree.MakeIndex(); return; } Node n; Console.WriteLine(help_tree.RenderUrl(args[0], out n)); }
public static RootTree LoadTree(string basedir, bool includeExternal = true) { if (string.IsNullOrEmpty(basedir)) { throw new ArgumentNullException("basedir"); } if (!Directory.Exists(basedir)) { throw new ArgumentException("basedir", string.Format("Base documentation directory at '{0}' doesn't exist", basedir)); } XmlDocument xmlDocument = new XmlDocument(); string filename = Path.Combine(basedir, "monodoc.xml"); xmlDocument.Load(filename); IEnumerable <string> sourceFiles = Directory.EnumerateFiles(Path.Combine(basedir, "sources"), "*.source"); if (includeExternal) { sourceFiles = sourceFiles.Concat(RootTree.ProbeExternalDirectorySources()); } return(RootTree.LoadTree(basedir, xmlDocument, sourceFiles)); }
public static RootTree LoadTree() { return(RootTree.LoadTree(RootTree.ProbeBaseDirectories())); }
public static void MakeSearchIndex() { RootTree rootTree = RootTree.LoadTree(); rootTree.GenerateSearchIndex(); }
static IndexDataSource() { index_reader = RootTree.LoadTree().GetIndex(); }
static int Main(string [] args) { string topic = null; for (int i = 0; i < args.Length; i++) { switch (args [i]) { case "--html": if (i + 1 == args.Length) { Console.WriteLine("--html needed argument"); return(1); } Node n; RootTree help_tree = RootTree.LoadTree(); string res = help_tree.RenderUrl(args [i + 1], out n); if (res != null) { Console.WriteLine(res); return(0); } else { return(1); } case "--make-index": RootTree.MakeIndex(); return(0); case "--help": Console.WriteLine("Options are:\n" + "browser [--html TOPIC] [--make-index] [TOPIC] [--merge-changes CHANGE_FILE TARGET_DIR+]"); return(0); case "--merge-changes": if (i + 2 == args.Length) { Console.WriteLine("--merge-changes 2+ args"); return(1); } ArrayList targetDirs = new ArrayList(); for (int j = i + 2; j < args.Length; j++) { targetDirs.Add(args [j]); } EditMerger e = new EditMerger( GlobalChangeset.LoadFromFile(args [i + 1]), targetDirs ); e.Merge(); return(0); default: topic = args [i]; break; } } Settings.RunningGUI = true; DocumentBrowser browser = new DocumentBrowser(); browser.Run(); return(0); }
static Controller() { help_tree = RootTree.LoadTree(); }