• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Monodoc.Tree类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Monodoc.Tree的典型用法代码示例。如果您正苦于以下问题:C# Tree类的具体用法?C# Tree怎么用?C# Tree使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Tree类属于Monodoc命名空间,在下文中一共展示了Tree类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: PopulateTree

	public override void PopulateTree (Tree tree)
	{
		foreach(string TocFile in tocFiles) {

			XmlDocument doc = new XmlDocument();
			doc.Load(TocFile);

			XmlNodeList nodeList = doc.GetElementsByTagName("manpage");
			Node nodeToAddChildrenTo = tree;

			foreach(XmlNode node in nodeList) {

				XmlAttribute name = node.Attributes["name"];
				XmlAttribute page = node.Attributes["page"];

				if (name == null || page == null) continue;

				if (!File.Exists (page.Value))
					continue;

				string target = "man:" + name.Value;
				nodeToAddChildrenTo.CreateNode (name.Value, target);

				if (File.Exists(page.Value))
					nodeToAddChildrenTo.tree.HelpSource.PackFile (page.Value, name.Value);
			}
		}
	}
开发者ID:emtees,项目名称:old-code,代码行数:28,代码来源:man-provider.cs


示例2: PopulateTree

	public override void PopulateTree (Tree tree)
	{
		XPathNavigator n = new XPathDocument (Path.Combine (basedir, "toc.xml")).CreateNavigator ();
		n.MoveToRoot ();
		n.MoveToFirstChild ();
		PopulateNode (n.SelectChildren ("node", ""), tree);
	}
开发者ID:carrie901,项目名称:mono,代码行数:7,代码来源:ecmaspec-provider.cs


示例3: TestTreeLoading

		void TestTreeLoading (string treeFileName, int expectedVersion, int expectedNodeCount)
		{
			var filePath = Path.Combine (BaseDir, "trees", treeFileName);
			var tree = new Tree (null, filePath);
			Assert.AreEqual (expectedVersion, tree.VersionNumber);
			Assert.IsNotNull (tree.RootNode);
			Assert.AreEqual (expectedNodeCount, tree.RootNode.ChildNodes.Count);
		}
开发者ID:xzkmxd,项目名称:mono,代码行数:8,代码来源:TreeTest.cs


示例4: PopulateTree

	public override void PopulateTree (Tree tree)
	{
		Node top = tree.LookupNode ("Directory at: " + basedir, "simple:");
		
		foreach (string dir in Directory.GetDirectories (basedir)){
			string url = Path.GetFileName (dir);
			Node n = top.LookupNode ("Dir: " + url, url);
			PopulateDir (n, dir);
		}
	}
开发者ID:emtees,项目名称:old-code,代码行数:10,代码来源:simple-provider.cs


示例5: Main

	static int Main (string [] args)
	{
		int argc = args.Length;
		Tree t = null;
		
		for (int i = 0; i < argc; i++){
			string arg = args [i];
			
			switch (arg){
				
			default:
				if (t == null)
					t = new Tree (null, arg);
				break;
			}
		}

		if (t != null)
			Node.PrintTree (t);

		return 0;
	}
开发者ID:emtees,项目名称:old-code,代码行数:22,代码来源:dump.cs


示例6: PopulateTree

		public override void PopulateTree (Tree tree)
		{
			string fileId = tree.tree.HelpSource.PackFile (file);
			XmlDocument doc = new XmlDocument ();
			doc.Load (file);
			
			foreach (XmlElement addin in doc.SelectNodes ("Addins/Addin")) {

				string addinId = addin.GetAttribute ("fullId");
				Node newNode = tree.CreateNode (addin.GetAttribute ("name"), "addin:" + fileId + "#" + addinId);

				foreach (XmlElement node in addin.SelectNodes ("ExtensionPoint")) {
					string target = "extension-point:" + fileId + "#" + addinId + "#" + node.GetAttribute ("path");
					Node newExt = newNode.CreateNode (node.GetAttribute ("name"), target);
			
					foreach (XmlElement en in node.SelectNodes ("ExtensionNode")) {
						string nid = en.GetAttribute ("id");
						string nname = en.GetAttribute ("name");
						newExt.CreateNode (nname, "extension-node:" + fileId + "#" + addinId + "#" + nid);
					}
				}
			}
		}
开发者ID:emtees,项目名称:old-code,代码行数:23,代码来源:addins-provider.cs


示例7: Run

		public override void Run (IEnumerable<string> args)
		{
			var validFormats = RootTree.GetSupportedFormats ();
			string cur_format = "";
			var formats = new Dictionary<string, List<string>> ();
			var options = new OptionSet () {
				{ "f|format=",
					"The documentation {FORMAT} used in FILES.  " + 
						"Valid formats include:\n  " +
						string.Join ("\n  ", validFormats) + "\n" +
						"If not specified, no HelpSource is used.  This may " +
						"impact the PublicUrls displayed for nodes.",
					v => {
						if (Array.IndexOf (validFormats, v) < 0)
							Error ("Invalid documentation format: {0}.", v);
						cur_format = v;
					} },
				{ "<>", v => AddFormat (formats, cur_format, v) },
			};
			List<string> files = Parse (options, args, "dump-tree", 
					"[OPTIONS]+ FILES",
					"Print out the nodes within the assembled .tree FILES,\n" + 
					"as produced by 'mdoc assemble'.");
			if (files == null)
				return;

			foreach (string format in formats.Keys) {
				foreach (string file in formats [format]) {
					HelpSource hs = format == ""
						? null
						: RootTree.GetHelpSource (format, file.Replace (".tree", ""));
					Tree t = new Tree (hs, file);
					TreeDumper.PrintTree (t.RootNode);
				}
			}
		}
开发者ID:nobled,项目名称:mono,代码行数:36,代码来源:dump.cs


示例8: HelpSource

	public HelpSource (string base_filename, bool create)
	{
		this.name = Path.GetFileName (base_filename);
		tree_filename = base_filename + ".tree";
		zip_filename = base_filename + ".zip";

		if (create)
			SetupForOutput ();
		else 
			Tree = new Tree (this, tree_filename);

		source_id = id++;
		try {
			FileInfo fi = new FileInfo (zip_filename);
			zipFileWriteTime = fi.LastWriteTime;
		} catch {
			zipFileWriteTime = DateTime.Now;
		}
	}
开发者ID:emtees,项目名称:old-code,代码行数:19,代码来源:provider.cs


示例9: AddImageFiles

	void AddImageFiles (HelpSource hs, Tree tree)
	{
		foreach (string asm in asm_dirs) {
			string path = Path.Combine (asm, "_images");
			if (!Directory.Exists (path))
				return;

#if NET_2_0
			foreach (var img in Directory.GetFiles (path))
#else
			foreach (var img in Directory.EnumerateFiles (path))
#endif
				hs.PackFile (img, Path.GetFileName (img));
		}
	}
开发者ID:RAOF,项目名称:mono,代码行数:15,代码来源:ecma-provider.cs


示例10: CloseTree

	//
	// Packs a file with the summary data
	//
	public override void CloseTree (HelpSource hs, Tree tree)
	{
		foreach (DictionaryEntry de in class_summaries){
			XmlDocument doc = new XmlDocument ();
			string ns = (string) de.Key;
			
			ArrayList list = (ArrayList) de.Value;
			list.Sort();

			XmlElement elements = doc.CreateElement ("elements");
			doc.AppendChild (elements);
			
			if (namespace_summaries [ns] != null)
				elements.AppendChild (doc.ImportNode ((XmlNode)namespace_summaries [ns],true));
			else
				elements.AppendChild (doc.CreateElement("summary"));
			
			if (namespace_remarks [ns] != null)
				elements.AppendChild (doc.ImportNode ((XmlNode)namespace_remarks [ns],true));
			else
				elements.AppendChild (doc.CreateElement("remarks"));
			
			hs.Message (TraceLevel.Info, "Have {0} elements in the {1}", list.Count, ns);
			foreach (TypeInfo p in list){
				XmlElement e = null;
				
				switch (p.type_kind){
				case "Class":
					e = doc.CreateElement ("class"); 
					break;
					
				case "Enumeration":
					e = doc.CreateElement ("enum");
					break;
					
				case "Structure":
					e = doc.CreateElement ("struct");
					break;
					
				case "Delegate":
					e = doc.CreateElement ("delegate");
					break;
					
				case "Interface":
					e = doc.CreateElement ("interface");
					break;
				}
				
				e.SetAttribute ("name", p.type_name);
				e.SetAttribute ("fullname", p.type_full);
				e.SetAttribute ("assembly", p.type_assembly);
				XmlNode copy = doc.ImportNode (p.type_doc, true);
				e.AppendChild (copy);
				elements.AppendChild (e);
			}
			hs.PackXml ("xml.summary." + ns, doc,(string) namespace_realpath[ns]);
		}
		
		
		XmlDocument nsSummary = new XmlDocument ();
		XmlElement root = nsSummary.CreateElement ("elements");
		nsSummary.AppendChild (root);
		
		foreach (DictionaryEntry de in namespace_summaries) {
			XmlNode n = (XmlNode)de.Value;
			XmlElement summary = nsSummary.CreateElement ("namespace");
			summary.SetAttribute ("ns", (string)de.Key);
			root.AppendChild (summary);
			if (n != null)
				summary.AppendChild (nsSummary.ImportNode (n,true));
			else
				summary.AppendChild (nsSummary.CreateElement("summary"));
		}
		tree.HelpSource.PackXml ("mastersummary.xml", nsSummary, null);
		AddExtensionMethods (tree);
		AddImageFiles (hs, tree);
	}
开发者ID:RAOF,项目名称:mono,代码行数:80,代码来源:ecma-provider.cs


示例11: CloseTree

		public override void CloseTree (HelpSource hs, Tree tree)
		{
			Hashtable entries = config.Compile ();
			MemoryStream ms = new MemoryStream ();
			XmlSerializer writer = new XmlSerializer (typeof (ErrorDocumentation));
			
			foreach (DictionaryEntry de in entries) {
				ErrorDocumentation d = (ErrorDocumentation)de.Value;
				string s = (string)de.Key;

				tree.LookupNode (s, "error:" + s);
				
				writer.Serialize (ms, d);
				ms.Position = 0;
				hs.PackStream (ms, s);
				ms.SetLength (0);
			}
			
			tree.Sort ();
		}
开发者ID:emtees,项目名称:old-code,代码行数:20,代码来源:error-provider.cs


示例12: CloseTree

	//
	// Called at shutdown time after the tree has been populated to perform
	// any fixups or final tasks.
	//
	public abstract void CloseTree (HelpSource hs, Tree tree);
开发者ID:wamiq,项目名称:debian-mono,代码行数:5,代码来源:provider.cs


示例13: SetupForOutput

	void SetupForOutput ()
	{
		Tree = new Tree (this, "", "");

		FileStream stream = File.Create (zip_filename);
		
		zip_output = new ZipOutputStream (stream);
		zip_output.SetLevel (9);

		buffer = new byte [buffer_size];
	}		
开发者ID:wamiq,项目名称:debian-mono,代码行数:11,代码来源:provider.cs


示例14: PrintTree

		public static void PrintTree (Tree t)
		{
			TreeDumper.PrintTree (t.RootNode);
		}
开发者ID:REALTOBIZ,项目名称:mono,代码行数:4,代码来源:Node_Legacy.cs


示例15: HelpSource

	public HelpSource (string base_filename, bool create)
	{
		this.name = Path.GetFileName (base_filename);
		tree_filename = base_filename + ".tree";
		zip_filename = base_filename + ".zip";
		base_dir = XmlDocUtils.GetCacheDirectory (base_filename);
		if (UseWebdocCache && !create && Directory.Exists (base_dir)) {
			nozip = true;
		}

		if (create)
			SetupForOutput ();
		else 
			Tree = new Tree (this, tree_filename);

		source_id = id++;
		try {
			FileInfo fi = new FileInfo (zip_filename);
			zipFileWriteTime = fi.LastWriteTime;
		} catch {
			zipFileWriteTime = DateTime.Now;
		}
	}
开发者ID:wamiq,项目名称:debian-mono,代码行数:23,代码来源:provider.cs


示例16: PopulateTree

	public override void PopulateTree (Tree tree)
	{
		new SimpleHandbookTOCParser(tree, tocFile);
	}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:4,代码来源:xhtml-provider.cs


示例17: PopulateTree

	public abstract void PopulateTree (Tree tree);
开发者ID:wamiq,项目名称:debian-mono,代码行数:1,代码来源:provider.cs


示例18: SimpleHandbookTOCParser

  	public SimpleHandbookTOCParser(Tree monodocTree, string tocFile)
  	{
		XmlDocument doc = new XmlDocument();
		doc.Load(tocFile);

		XmlNodeList nodeList = doc.GetElementsByTagName("body");
		XmlNodeList bodylist = nodeList[0].ChildNodes[1].ChildNodes;
		//Node top = monodocTree.LookupNode ("Mono handbook root", "hb:");
		nodeToAddChildrenTo = monodocTree;
		ParseUl(bodylist[1].ChildNodes,monodocTree);

		foreach (string file in tempfiles)
			System.IO.File.Delete (file);
   	}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:14,代码来源:xhtml-provider.cs


示例19: PopulateTree

		public override void PopulateTree (Tree tree)
		{
			// everything is done in CloseTree so we can pack
		}
开发者ID:emtees,项目名称:old-code,代码行数:4,代码来源:error-provider.cs


示例20: CloseTree

	public override void CloseTree (HelpSource hs, Tree tree)
	{
	}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:3,代码来源:xhtml-provider.cs



注:本文中的Monodoc.Tree类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DB.MooDB类代码示例发布时间:2022-05-26
下一篇:
C# Monodoc.Node类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap