當前位置: 首頁>>代碼示例>>C#>>正文


C# BlamLib.GetReferenceName方法代碼示例

本文整理匯總了C#中BlamLib.GetReferenceName方法的典型用法代碼示例。如果您正苦於以下問題:C# BlamLib.GetReferenceName方法的具體用法?C# BlamLib.GetReferenceName怎麽用?C# BlamLib.GetReferenceName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BlamLib的用法示例。


在下文中一共展示了BlamLib.GetReferenceName方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CacheOpenDoWorkGenerateTagTreeNodes

		static TreeNode[] CacheOpenDoWorkGenerateTagTreeNodes(CacheView cv, BlamLib.Blam.CacheFile cache)
		{
			List<TreeNode> tg_nodes;
			Dictionary<BlamLib.TagInterface.TagGroup, TreeNode> tg_dic;
			BlamLib.TagInterface.TagGroupCollection tg_coll, tg_invalid_for_cv;
			{
				var game_man = BlamLib.Program.GetManager(cache.EngineVersion);
				tg_dic = new Dictionary<BlamLib.TagInterface.TagGroup, TreeNode>(game_man.TagGroups.Count);
				tg_coll = game_man.TagGroups;
				tg_invalid_for_cv = game_man.TagGroupsInvalidForCacheViewer;
				cv.m_groupsInvalidForExtraction = game_man.TagGroupsInvalidForExtraction;

				tg_nodes = new List<TreeNode>(game_man.TagGroups.Count);
			};

			#region Build tag group parent nodes
			foreach (var tg in tg_coll)
			{
				if (tg == BlamLib.TagInterface.TagGroup.Null || tg_invalid_for_cv.Contains(tg)) continue;

				var node = new TreeNode(tg.Name);
				node.Tag = tg;
				node.Checked = false;
				node.ForeColor = Color.LightGreen;
				node.BackColor = SystemColors.ControlDarkDark;
				tg_dic.Add(tg, node);
				tg_nodes.Add(node);
			}
			#endregion

			#region Build tag instances
			foreach (var inst in cache.Index.Tags)
			{
				if (inst.IsEmpty) continue;

				TreeNode tg_node;
				if (!tg_dic.TryGetValue(inst.GroupTag, out tg_node)) continue;

				var node = new TreeNode(cache.GetReferenceName(inst.ReferenceName));
				node.Tag = inst;
				node.Checked = false;
				node.ContextMenuStrip = cv.MenuTagInstance;
				node.ForeColor = Color.LightGreen;
				node.BackColor = SystemColors.ControlDarkDark;
				tg_node.Nodes.Add(node);
			}
			#endregion

			#region Clean up the parent nodes
			tg_nodes.TrimExcess();
			for (int x = 0; x < tg_nodes.Count; x++)
				if (tg_nodes[x].Nodes.Count == 0)
					tg_nodes.RemoveAt(x--);
			#endregion

			return tg_nodes.ToArray();
		}
開發者ID:CodeAsm,項目名稱:open-sauce,代碼行數:57,代碼來源:CacheView.cs


注:本文中的BlamLib.GetReferenceName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。