本文整理汇总了C#中TreelistView类的典型用法代码示例。如果您正苦于以下问题:C# TreelistView类的具体用法?C# TreelistView怎么用?C# TreelistView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TreelistView类属于命名空间,在下文中一共展示了TreelistView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: inputLayouts_NodeDoubleClick
private void inputLayouts_NodeDoubleClick(TreelistView.Node node)
{
(new BufferViewer(m_Core, true)).Show(m_DockContent.DockPanel);
}
示例2: cbuffers_NodeDoubleClicked
private void cbuffers_NodeDoubleClicked(TreelistView.Node node)
{
D3D11PipelineState.ShaderStage stage = GetStageForSender(node.OwnerView);
if (stage != null && node.Tag is UInt32)
{
ShowCBuffer(stage, (UInt32)node.Tag);
}
}
示例3: ViewDetailsRow
private void ViewDetailsRow(TreelistView.Node node)
{
node.BackColor = Color.Aquamarine;
m_ViewDetailNodes.Add(node);
}
示例4: InactiveRow
private void InactiveRow(TreelistView.Node node)
{
node.Italic = true;
}
示例5: SetShaderState
// Set a shader stage's resources and values
private void SetShaderState(FetchTexture[] texs, FetchBuffer[] bufs,
D3D11PipelineState.ShaderStage stage,
Label shader, TreelistView.TreeListView resources, TreelistView.TreeListView samplers,
TreelistView.TreeListView cbuffers, TreelistView.TreeListView classes)
{
ShaderReflection shaderDetails = stage.ShaderDetails;
if (stage.Shader == ResourceId.Null)
shader.Text = "Unbound";
else
shader.Text = stage.ShaderName;
if (shaderDetails != null && shaderDetails.DebugInfo.entryFunc.Length > 0 && shaderDetails.DebugInfo.files.Length > 0)
{
string shaderfn = "";
int entryFile = shaderDetails.DebugInfo.entryFile;
if (entryFile < 0 || entryFile >= shaderDetails.DebugInfo.files.Length)
entryFile = 0;
shaderfn = shaderDetails.DebugInfo.files[entryFile].BaseFilename;
shader.Text = shaderDetails.DebugInfo.entryFunc + "()" + " - " + shaderfn;
}
int vs = 0;
vs = resources.VScrollValue();
resources.BeginUpdate();
resources.Nodes.Clear();
if (stage.SRVs != null)
{
int i = 0;
foreach (var r in stage.SRVs)
{
ShaderResource shaderInput = null;
if (shaderDetails != null)
{
foreach (var bind in shaderDetails.ReadOnlyResources)
{
if (bind.IsSRV && bind.bindPoint == i)
{
shaderInput = bind;
break;
}
}
}
bool filledSlot = (r.Resource != ResourceId.Null);
bool usedSlot = (shaderInput != null);
// show if
if (usedSlot || // it's referenced by the shader - regardless of empty or not
(showDisabled.Checked && !usedSlot && filledSlot) || // it's bound, but not referenced, and we have "show disabled"
(showEmpty.Checked && !filledSlot) // it's empty, and we have "show empty"
)
{
string slotname = i.ToString();
if (shaderInput != null && shaderInput.name.Length > 0)
slotname += ": " + shaderInput.name;
UInt64 w = 1;
UInt32 h = 1, d = 1;
UInt32 a = 1;
string format = "Unknown";
string name = "Shader Resource " + r.Resource.ToString();
string typename = "Unknown";
object tag = null;
bool viewDetails = false;
if (!filledSlot)
{
name = "Empty";
format = "-";
typename = "-";
w = h = d = a = 0;
}
// check to see if it's a texture
for (int t = 0; t < texs.Length; t++)
{
if (texs[t].ID == r.Resource)
{
w = texs[t].width;
h = texs[t].height;
d = texs[t].depth;
a = texs[t].arraysize;
format = texs[t].format.ToString();
name = texs[t].name;
typename = texs[t].resType.Str();
if (texs[t].resType == ShaderResourceType.Texture2DMS ||
texs[t].resType == ShaderResourceType.Texture2DMSArray)
{
typename += String.Format(" {0}x", texs[t].msSamp);
}
//.........这里部分代码省略.........
示例6: SetFindIcons
private int SetFindIcons(TreelistView.NodeCollection nodes, string filter)
{
int results = 0;
foreach (var n in nodes)
{
if (n.Tag is DeferredEvent)
{
if (n["Name"].ToString().ToUpperInvariant().Contains(filter))
{
if (!IsBookmarked((UInt32)n["EID"]))
n.Image = global::renderdocui.Properties.Resources.find;
results++;
}
}
if (n.Nodes.Count > 0)
{
results += SetFindIcons(n.Nodes, filter);
}
}
return results;
}
示例7: FindEvent
private int FindEvent(TreelistView.NodeCollection nodes, string filter, UInt32 after, bool forward)
{
if(nodes == null) return -1;
for (int i = forward ? 0 : nodes.Count - 1;
i >= 0 && i < nodes.Count;
i += forward ? 1 : -1)
{
var n = nodes[i];
if (n.Tag is DeferredEvent)
{
DeferredEvent def = n.Tag as DeferredEvent;
bool matchesAfter = (forward && def.eventID > after) || (!forward && def.eventID < after);
if (matchesAfter && n["Name"].ToString().ToUpperInvariant().Contains(filter))
return (int)def.eventID;
}
if (n.Nodes.Count > 0)
{
int found = FindEvent(n.Nodes, filter, after, forward);
if (found > 0)
return found;
}
}
return -1;
}
示例8: ClearFindIcons
private void ClearFindIcons(TreelistView.NodeCollection nodes)
{
foreach (var n in nodes)
{
if (!IsBookmarked(GetNodeEventID(n)))
n.Image = null;
if (n.Nodes.Count > 0)
{
ClearFindIcons(n.Nodes);
}
}
}
示例9: GetNodeEventID
private uint GetNodeEventID(TreelistView.Node n)
{
DeferredEvent def = n.Tag as DeferredEvent;
if (def != null)
return def.eventID;
return 0;
}
示例10: hosts_NodeDoubleClicked
private void hosts_NodeDoubleClicked(TreelistView.Node node)
{
ConnectToHost(node);
}
示例11: AddDrawcall
private TreelistView.Node AddDrawcall(FetchDrawcall drawcall, TreelistView.Node root)
{
if (m_Core.Config.EventBrowser_HideEmpty)
{
if ((drawcall.children == null || drawcall.children.Length == 0) && (drawcall.flags & DrawcallFlags.PushMarker) != 0)
return null;
}
UInt32 eventNum = drawcall.eventID;
TreelistView.Node drawNode = null;
if(drawcall.children.Length > 0)
drawNode = MakeNode(eventNum, GetEndEventID(drawcall), drawcall.drawcallID, GetEndDrawID(drawcall), drawcall.name, 0.0);
else
drawNode = MakeNode(eventNum, drawcall.drawcallID, drawcall.name, 0.0);
if (m_Core.Config.EventBrowser_ApplyColours)
{
// if alpha isn't 0, assume the colour is valid
if ((drawcall.flags & (DrawcallFlags.PushMarker | DrawcallFlags.SetMarker)) > 0 && drawcall.markerColour[3] > 0.0f)
{
float red = drawcall.markerColour[0];
float green = drawcall.markerColour[1];
float blue = drawcall.markerColour[2];
float alpha = drawcall.markerColour[3];
drawNode.TreeLineColor = drawcall.GetColor();
drawNode.TreeLineWidth = 3.0f;
if (m_Core.Config.EventBrowser_ColourEventRow)
{
drawNode.BackColor = drawcall.GetColor();
drawNode.ForeColor = drawcall.GetTextColor(eventView.ForeColor);
}
}
}
DeferredEvent def = new DeferredEvent();
def.eventID = eventNum;
def.marker = (drawcall.flags & DrawcallFlags.SetMarker) != 0;
drawNode.Tag = def;
if (drawcall.children != null && drawcall.children.Length > 0)
{
for (int i = 0; i < drawcall.children.Length; i++)
{
AddDrawcall(drawcall.children[i], drawNode);
if (i > 0 && drawNode.Nodes.Count >= 2 &&
(drawcall.children[i - 1].flags & DrawcallFlags.SetMarker) > 0)
{
DeferredEvent markerTag = drawNode.Nodes[drawNode.Nodes.Count - 2].Tag as DeferredEvent;
DeferredEvent drawTag = drawNode.Nodes.LastNode.Tag as DeferredEvent;
markerTag.eventID = drawTag.eventID;
}
}
bool found = false;
for (int i = drawNode.Nodes.Count - 1; i >= 0; i--)
{
DeferredEvent t = drawNode.Nodes[i].Tag as DeferredEvent;
if (t != null && !t.marker)
{
drawNode.Tag = drawNode.Nodes[i].Tag;
found = true;
break;
}
}
if (!found && !drawNode.Nodes.IsEmpty())
drawNode.Tag = drawNode.Nodes.LastNode.Tag;
}
if (drawNode.Nodes.IsEmpty() && (drawcall.flags & DrawcallFlags.PushMarker) != 0 && m_Core.Config.EventBrowser_HideEmpty)
return null;
root.Nodes.Add(drawNode);
return drawNode;
}
示例12: ConnectToHost
private void ConnectToHost(TreelistView.Node node)
{
if (node != null &&
node.Tag != null)
{
var connect = node.Tag as RemoteConnect;
var live = new LiveCapture(m_Core, connect.host, connect.ident, m_Main);
m_Main.ShowLiveCapture(live);
Close();
}
}
示例13: AddVariables
private void AddVariables(TreelistView.NodeCollection root, ShaderVariable[] vars)
{
foreach (var v in vars)
{
TreelistView.Node n = root.Add(new TreelistView.Node(new object[] { v.name, v, v.TypeString() }));
if (v.rows > 1)
{
for (int i = 0; i < v.rows; i++)
{
n.Nodes.Add(new TreelistView.Node(new object[] { String.Format("{0}.row{1}", v.name, i), v.Row(i), v.RowTypeString() }));
}
}
if (v.members.Length > 0)
{
AddVariables(n.Nodes, v.members);
}
}
}
示例14: SetShaderState
// Set a shader stage's resources and values
private void SetShaderState(FetchTexture[] texs, FetchBuffer[] bufs,
GLPipelineState state, GLPipelineState.ShaderStage stage,
TableLayoutPanel table, Label shader,
TreelistView.TreeListView textures, TreelistView.TreeListView samplers,
TreelistView.TreeListView cbuffers, TreelistView.TreeListView subs,
TreelistView.TreeListView readwrites)
{
ShaderReflection shaderDetails = stage.ShaderDetails;
var mapping = stage.BindpointMapping;
if (stage.Shader == ResourceId.Null)
shader.Text = "Unbound";
else
shader.Text = stage.stage.Str(APIPipelineStateType.OpenGL) + " Shader " + stage.Shader.ToString();
// disabled since entry function is always main, and filenames have no names, so this is useless.
/*
if (shaderDetails != null && shaderDetails.DebugInfo.entryFunc != "" && shaderDetails.DebugInfo.files.Length > 0)
shader.Text = shaderDetails.DebugInfo.entryFunc + "()" + " - " +
Path.GetFileName(shaderDetails.DebugInfo.files[0].filename);
*/
int vs = 0;
int vs2 = 0;
// simultaneous update of resources and samplers
vs = textures.VScrollValue();
textures.BeginUpdate();
textures.Nodes.Clear();
vs2 = samplers.VScrollValue();
samplers.BeginUpdate();
samplers.Nodes.Clear();
if (state.Textures != null)
{
for (int i = 0; i < state.Textures.Length; i++)
{
var r = state.Textures[i];
var s = state.Samplers[i];
ShaderResource shaderInput = null;
BindpointMap map = null;
if (shaderDetails != null)
{
foreach (var bind in shaderDetails.Resources)
{
if (bind.IsSRV && !bind.IsReadWrite && mapping.Resources[bind.bindPoint].bind == i)
{
shaderInput = bind;
map = mapping.Resources[bind.bindPoint];
}
}
}
bool filledSlot = (r.Resource != ResourceId.Null);
bool usedSlot = (shaderInput != null && map.used);
// show if
if (usedSlot || // it's referenced by the shader - regardless of empty or not
(showDisabled.Checked && !usedSlot && filledSlot) || // it's bound, but not referenced, and we have "show disabled"
(showEmpty.Checked && !filledSlot) // it's empty, and we have "show empty"
)
{
// do texture
{
string slotname = i.ToString();
if (shaderInput != null && shaderInput.name != "")
slotname += ": " + shaderInput.name;
UInt32 w = 1, h = 1, d = 1;
UInt32 a = 1;
string format = "Unknown";
string name = "Shader Resource " + r.Resource.ToString();
string typename = "Unknown";
object tag = null;
if (!filledSlot)
{
name = "Empty";
format = "-";
typename = "-";
w = h = d = a = 0;
}
// check to see if it's a texture
for (int t = 0; t < texs.Length; t++)
{
if (texs[t].ID == r.Resource)
{
w = texs[t].width;
h = texs[t].height;
d = texs[t].depth;
a = texs[t].arraysize;
format = texs[t].format.ToString();
name = texs[t].name;
typename = texs[t].resType.Str();
if (texs[t].format.special &&
//.........这里部分代码省略.........
示例15: FindEventNode
private bool FindEventNode(ref TreelistView.Node found, UInt32 frameID, UInt32 eventID)
{
bool ret = FindEventNode(ref found, eventView.Nodes[0].Nodes, frameID, eventID);
while (found != null && found.NextSibling != null && found.NextSibling.Tag is DeferredEvent)
{
DeferredEvent def = found.NextSibling.Tag as DeferredEvent;
if (def.eventID == eventID)
found = found.NextSibling;
else
break;
}
return ret;
}