本文整理汇总了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();
}