本文整理汇总了C#中TreelistView类的典型用法代码示例。如果您正苦于以下问题:C# TreelistView类的具体用法?C# TreelistView怎么用?C# TreelistView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TreelistView类属于命名空间,在下文中一共展示了TreelistView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: inputLayouts_NodeDoubleClick
private void inputLayouts_NodeDoubleClick(TreelistView.Node node)
{
(new BufferViewer(m_Core, true)).Show(m_DockContent.DockPanel);
}
开发者ID:bobvodka,项目名称:renderdoc,代码行数:4,代码来源:GLPipelineStateViewer.cs
示例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);
}
}
开发者ID:Cry-Filami,项目名称:renderdoc,代码行数:9,代码来源:D3D11PipelineStateViewer.cs
示例3: ViewDetailsRow
private void ViewDetailsRow(TreelistView.Node node)
{
node.BackColor = Color.Aquamarine;
m_ViewDetailNodes.Add(node);
}
开发者ID:Cry-Filami,项目名称:renderdoc,代码行数:5,代码来源:D3D11PipelineStateViewer.cs
示例4: InactiveRow
private void InactiveRow(TreelistView.Node node)
{
node.Italic = true;
}
开发者ID:Cry-Filami,项目名称:renderdoc,代码行数:4,代码来源:D3D11PipelineStateViewer.cs
示例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);
}
//.........这里部分代码省略.........
开发者ID:Cry-Filami,项目名称:renderdoc,代码行数:101,代码来源:D3D11PipelineStateViewer.cs
示例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;
}
开发者ID:ksenglee,项目名称:renderdoc,代码行数:24,代码来源:EventBrowser.cs
示例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;
}
开发者ID:ksenglee,项目名称:renderdoc,代码行数:31,代码来源:EventBrowser.cs
示例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);
}
}
}
开发者ID:Nexuapex,项目名称:renderdoc,代码行数:13,代码来源:EventBrowser.cs
示例9: GetNodeEventID
private uint GetNodeEventID(TreelistView.Node n)
{
DeferredEvent def = n.Tag as DeferredEvent;
if (def != null)
return def.eventID;
return 0;
}
开发者ID:Nexuapex,项目名称:renderdoc,代码行数:9,代码来源:EventBrowser.cs
示例10: hosts_NodeDoubleClicked
private void hosts_NodeDoubleClicked(TreelistView.Node node)
{
ConnectToHost(node);
}
开发者ID:lanphon,项目名称:renderdoc,代码行数:4,代码来源:RemoteHostSelect.cs
示例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;
}
开发者ID:Nexuapex,项目名称:renderdoc,代码行数:82,代码来源:EventBrowser.cs
示例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();
}
}
开发者ID:lanphon,项目名称:renderdoc,代码行数:11,代码来源:RemoteHostSelect.cs
示例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);
}
}
}
开发者ID:Waferix,项目名称:renderdoc,代码行数:20,代码来源:ConstantBufferPreviewer.cs
示例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 &&
//.........这里部分代码省略.........
开发者ID:bobvodka,项目名称:renderdoc,代码行数:101,代码来源:GLPipelineStateViewer.cs
示例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;
}
开发者ID:ksenglee,项目名称:renderdoc,代码行数:16,代码来源:EventBrowser.cs
示例16: GetDefaults
public static PersistData GetDefaults(TreelistView.TreeListView view)
{
PersistData data = new PersistData();
foreach (var c in view.Columns)
{
ColumnArrangement a = new ColumnArrangement();
a.fieldname = c.Fieldname;
a.visibleindex = c.VisibleIndex;
a.width = c.Width;
data.visibleColumns.Add(a);
}
return data;
}
开发者ID:ksenglee,项目名称:renderdoc,代码行数:15,代码来源:EventBrowser.cs
示例17: ClearFindIcons
private void ClearFindIcons(TreelistView.NodeCollection nodes)
{
foreach (var n in nodes)
{
if (!IsBookmarked((UInt32)n["EID"]))
n.Image = null;
if (n.Nodes.Count > 0)
{
ClearFindIcons(n.Nodes);
}
}
}
开发者ID:ksenglee,项目名称:renderdoc,代码行数:13,代码来源:EventBrowser.cs
示例18: DataToString
private string DataToString(TreelistView.TreeListColumn column, object data)
{
if (column.Fieldname == "Duration")
{
double f = (double)data;
if (f < 0.0)
return "";
if (m_Core.Config.EventBrowser_TimeUnit != m_TimeUnit)
UpdateDurationColumn();
if (m_Core.Config.EventBrowser_TimeUnit == PersistantConfig.TimeUnit.Milliseconds)
f *= 1000.0;
else if (m_Core.Config.EventBrowser_TimeUnit == PersistantConfig.TimeUnit.Microseconds)
f *= 1000000.0;
else if (m_Core.Config.EventBrowser_TimeUnit == PersistantConfig.TimeUnit.Nanoseconds)
f *= 1000000000.0;
return Formatter.Format(f);
}
return data.ToString();
}
开发者ID:ksenglee,项目名称:renderdoc,代码行数:23,代码来源:EventBrowser.cs
示例19: FindNode
private TreelistView.Node FindNode(TreelistView.NodeCollection nodes, string filter, UInt32 after)
{
foreach (var n in nodes)
{
if (n.Tag is DeferredEvent)
{
if ((UInt32)n["EID"] > after && n["Name"].ToString().ToUpperInvariant().Contains(filter))
return n;
}
if (n.Nodes.Count > 0)
{
TreelistView.Node found = FindNode(n.Nodes, filter, after);
if (found != null)
return found;
}
}
return null;
}
开发者ID:ksenglee,项目名称:renderdoc,代码行数:21,代码来源:EventBrowser.cs
示例20: 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 = MakeNode(eventNum, drawcall.drawcallID, drawcall.name, 0.0);
DeferredEvent def = new DeferredEvent();
def.frameID = m_Core.CurFrame;
def.eventID = eventNum;
def.marker = (drawcall.flags & DrawcallFlags.SetMarker) != 0;
if (drawcall.context != m_Core.FrameInfo[m_Core.CurFrame].immContextId)
{
def.defCtx = drawcall.context;
def.lastDefEv = drawcall.eventID;
FetchDrawcall parent = drawcall.parent;
while(!parent.name.Contains("ExecuteCommand"))
parent = parent.parent;
def.eventID = parent.eventID-1;
def.firstDefEv = parent.children[0].eventID;
if(parent.children[0].events.Length > 0)
def.firstDefEv = parent.children[0].events[0].eventID;
}
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)
{
drawNode.Nodes[drawNode.Nodes.Count - 2].Tag = drawNode.Nodes.LastNode.Tag;
}
}
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;
}
开发者ID:ksenglee,项目名称:renderdoc,代码行数:71,代码来源:EventBrowser.cs
注:本文中的TreelistView类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论