本文整理汇总了C#中TreeGridNode类的典型用法代码示例。如果您正苦于以下问题:C# TreeGridNode类的具体用法?C# TreeGridNode怎么用?C# TreeGridNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TreeGridNode类属于命名空间,在下文中一共展示了TreeGridNode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ReturnHierarchy
public TreeGridView ReturnHierarchy(object currObj, string classname)
{
InitializeImageList();
TreeGridView treegrid = InitializeTreeGridView();
try
{
TreeGridNode rootNode = new TreeGridNode();
treegrid.Nodes.Add(rootNode);
IReflectClass rclass = DataLayerCommon.ReflectClassForName(classname);
IType type = ResolveType(rclass);
rootNode.Cells[0].Value = AppendIDTo(type.FullName, GetLocalID(currObj), type);
rootNode.Cells[1].Value = ClassNameFor(currObj.ToString());
SetFieldType(rootNode, type);
rootNode.Tag = currObj;
rootNode.Cells[1].ReadOnly = true;
rootNode.Expand();
rootNode.ImageIndex = 0;
classname = DataLayerCommon.RemoveGFromClassName(classname);
TraverseObjTree(ref rootNode, currObj, classname);
}
catch (Exception oEx)
{
LoggingHelper.HandleException(oEx);
}
return treegrid;
}
开发者ID:erdincay,项目名称:db4o,代码行数:30,代码来源:RenderHierarchy.cs
示例2: SetObjectToNode
private TreeGridNode SetObjectToNode(TreeGridNode parent, string key, IDictionary value, string path)
{
TreeGridNode node = SetValueToNode(parent, key, string.Empty, "D", path);
AddNodeToGrid(node, value, path);
return node;
}
开发者ID:hmanjarawala,项目名称:GitRepo,代码行数:7,代码来源:JsonViewerPresenter.cs
示例3: TreeGridView
public TreeGridView()
{
try
{
rOpen = new VisualStyleRenderer(VisualStyleElement.TreeView.Glyph.Opened);
rClosed = new VisualStyleRenderer(VisualStyleElement.TreeView.Glyph.Closed);
}
catch (Exception)
{
rOpen = null;
rClosed = null;
}
// Control when edit occurs because edit mode shouldn't start when expanding/collapsing
this.EditMode = DataGridViewEditMode.EditProgrammatically;
this.RowTemplate = new TreeGridNode() as DataGridViewRow;
// This sample does not support adding or deleting rows by the user.
this.AllowUserToAddRows = false;
this.AllowUserToDeleteRows = false;
this._root = new TreeGridNode(this);
this._root.IsRoot = true;
// Ensures that all rows are added unshared by listening to the CollectionChanged event.
base.Rows.CollectionChanged += delegate(object sender, System.ComponentModel.CollectionChangeEventArgs e){};
}
开发者ID:brookpatten,项目名称:VisualSail,代码行数:25,代码来源:TreeGridView.cs
示例4: SetArrayToNode
private TreeGridNode SetArrayToNode(TreeGridNode parent, string key, IList value, string path)
{
TreeGridNode node = SetValueToNode(parent, key, string.Empty, "A", path);
int index = 0;
foreach (var item in value)
{
CreateNode(node, Convert.ToString(index), item, path + "[" + Convert.ToString(index++) + "]");
}
return node;
}
开发者ID:hmanjarawala,项目名称:GitRepo,代码行数:11,代码来源:JsonViewerPresenter.cs
示例5: SetValueToNode
private TreeGridNode SetValueToNode(TreeGridNode parent, string key, object value, string type, string path)
{
if (parent != null)
{
return parent.Nodes.Add(key, value, type, path);
}
else
{
return _view.AddNodeToGrid(key, value, type, path);
}
}
开发者ID:hmanjarawala,项目名称:GitRepo,代码行数:11,代码来源:JsonViewerPresenter.cs
示例6: PopulateNode
private void PopulateNode(TreeGridNode rootNode, ProxyTreeGridRenderer item)
{
rootNode.Cells[0].Value = item.DisplayFieldName;
rootNode.Cells[0].Tag = item.QualifiedName ;
rootNode.Cells[1].Value = item.FieldValue;
rootNode.Cells[1].Tag = item.FieldName ;
rootNode.Cells[2].Value = item.FieldType;
rootNode.Cells[2].Tag = item.ObjectType;
rootNode.Tag = item.ObjectId;
rootNode.Cells[1].ReadOnly = item.ReadOnlyStatus;
}
开发者ID:superyfwy,项目名称:db4o,代码行数:11,代码来源:RenderTreeGridView.cs
示例7: AddNodesToTreeview
public void AddNodesToTreeview(TreeGridNode node, bool activate)
{
List<ProxyTreeGridRenderer> proxyList =
AssemblyInspectorObject.DataPopulation.ExpandTreeGidNode
(OMEInteraction.GetCurrentConnParams().ConnectionReadOnly,
node.Tag, activate);
if (proxyList == null)
return;
foreach (ProxyTreeGridRenderer item1 in proxyList)
{
PopulateTreeGridNode(node, item1);
}
}
开发者ID:superyfwy,项目名称:db4o,代码行数:14,代码来源:RenderTreeGridView.cs
示例8: CreateNode
private TreeGridNode CreateNode(TreeGridNode parent, string key, object value, string path)
{
if (IsObject(value))
{
return SetObjectToNode(parent, key, value as IDictionary, path);
}
else if (IsArray(value))
{
return SetArrayToNode(parent, key, (IList)value, path);
}
else
{
return SetValueToNode(parent, key, value, "V", path);
}
}
开发者ID:hmanjarawala,项目名称:GitRepo,代码行数:15,代码来源:JsonViewerPresenter.cs
示例9: PopulateTreeGridNode
private void PopulateTreeGridNode(TreeGridNode rootNode, ProxyTreeGridRenderer NodeDetails)
{
TreeGridNode node = new TreeGridNode();
rootNode.Nodes.Add(node);
PopulateNode(node, NodeDetails);
node.ImageIndex = 0;
node.Collapse();
if (NodeDetails.HasSubNode || NodeDetails.ObjectId != 0)
{
TreeGridNode treenodeDummyChildNode = new TreeGridNode();
node.Nodes.Add(treenodeDummyChildNode);
treenodeDummyChildNode.Cells[0].Value = BusinessConstants.DB4OBJECTS_DUMMY;
if (NodeDetails.HasSubNode && NodeDetails.ObjectId == 0)
node.Tag = NodeDetails.SubObject;
}
}
开发者ID:superyfwy,项目名称:db4o,代码行数:16,代码来源:RenderTreeGridView.cs
示例10: TreeGridView
//internal VisualStyleRenderer rOpen; //= new VisualStyleRenderer(VisualStyleElement.TreeView.Glyph.Opened);
//internal VisualStyleRenderer rClosed; //= new VisualStyleRenderer(VisualStyleElement.TreeView.Glyph.Closed);
#region Constructor
public TreeGridView()
{
// Control when edit occurs because edit mode shouldn't start when expanding/collapsing
this.EditMode = DataGridViewEditMode.EditProgrammatically;
this.RowTemplate = new TreeGridNode() as DataGridViewRow;
// This sample does not support adding or deleting rows by the user.
this.AllowUserToAddRows = false;
this.AllowUserToDeleteRows = false;
this._root = new TreeGridNode(this);
this._root.IsRoot = true;
// Ensures that all rows are added unshared by listening to the CollectionChanged event.
base.Rows.CollectionChanged += delegate(object sender, System.ComponentModel.CollectionChangeEventArgs e){};
this.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(210, 163, 119);
this.EnableHeadersVisualStyles = false;//for gridheader color tobe effective.
}
开发者ID:hmanjarawala,项目名称:GitRepo,代码行数:21,代码来源:TreeGridView.cs
示例11: RenderTreeGridViewDetails
public TreeGridView RenderTreeGridViewDetails(long id, string classname)
{
InitializeImageList();
treegrid = InitializeTreeGridView();
bool readOnly=OMEInteraction.GetCurrentConnParams().ConnectionReadOnly;
ProxyTreeGridRenderer item = AssemblyInspectorObject.DataPopulation.GetTreeGridViewDetails(readOnly,id, classname);
TreeGridNode rootNode = new TreeGridNode();
treegrid.Nodes.Add(rootNode);
PopulateNode(rootNode, item);
rootNode.Expand();
rootNode.ImageIndex = 0;
List<ProxyTreeGridRenderer> proxyList = AssemblyInspectorObject.DataPopulation.TransverseTreeGridViewDetails(readOnly,id,classname);
foreach (ProxyTreeGridRenderer item1 in proxyList)
{
PopulateTreeGridNode(rootNode, item1);
}
return treegrid;
}
开发者ID:superyfwy,项目名称:db4o,代码行数:19,代码来源:RenderTreeGridView.cs
示例12: TreeGridView
public TreeGridView()
{
this.SetStyle(ControlStyles.CacheText |
ControlStyles.AllPaintingInWmPaint |
ControlStyles.UserPaint |
ControlStyles.OptimizedDoubleBuffer |
ControlStyles.Opaque, true);
// Control when edit occurs because edit mode shouldn't start when expanding/collapsing
this.EditMode = DataGridViewEditMode.EditProgrammatically;
this.RowTemplate = new TreeGridNode() as DataGridViewRow;
// This sample does not support adding or deleting rows by the user.
this.AllowUserToAddRows = false;
this.AllowUserToDeleteRows = false;
this._root = new TreeGridNode(this);
this._root.IsRoot = true;
SetDefaultProperties();
// Ensures that all rows are added unshared by listening to the CollectionChanged event.
base.Rows.CollectionChanged += delegate(object sender, System.ComponentModel.CollectionChangeEventArgs e){};
}
开发者ID:Galigator,项目名称:db4o,代码行数:22,代码来源:TreeGridView.cs
示例13: AddNodeToGrid
private void AddNodeToGrid(TreeGridNode parent, object nodes, string path)
{
IDictionary dict = nodes as IDictionary;
if (dict != null)
{
foreach (var node in dict.Keys)
{
TreeGridNode tnode = CreateNode(parent, node.ToString(), dict[node], path + "." + node.ToString());
}
}
IList list = nodes as IList;
if (list != null)
{
int index = 0;
foreach (var item in list)
{
TreeGridNode tnode = CreateNode(parent, Convert.ToString(index), item, path + "[" + Convert.ToString(index++) + "]");
}
}
}
开发者ID:hmanjarawala,项目名称:GitRepo,代码行数:23,代码来源:JsonViewerPresenter.cs
示例14: SiteNode
protected internal virtual void SiteNode(TreeGridNode node, int index)
{
if (index < base.Rows.Count)
{
base.Rows.Insert(index, node);
}
else
{
// for the last item.
base.Rows.Add(node);
}
}
开发者ID:swatt6400,项目名称:NetOffice,代码行数:12,代码来源:TreeGridView.cs
示例15: ExpandNode
protected internal virtual bool ExpandNode(TreeGridNode node)
{
if (!node.IsExpanded || this._virtualNodes)
{
ExpandingEventArgs exp = new ExpandingEventArgs(node);
this.OnNodeExpanding(exp);
if (!exp.Cancel)
{
this.LockVerticalScrollBarUpdate(true);
this.SuspendLayout();
_inExpandCollapse = true;
node.IsExpanded = true;
//TODO Convert this to a InsertRange
foreach (TreeGridNode childNode in node.Nodes)
{
Debug.Assert(childNode.RowIndex == -1, "Row is already in the grid.");
this.SiteNode(childNode);
//this.BaseRows.Insert(rowIndex + 1, childRow);
//TODO : remove -- just a test.
//childNode.Cells[0].Value = "child";
}
ExpandedEventArgs exped = new ExpandedEventArgs(node);
this.OnNodeExpanded(exped);
//TODO: Convert this to a specific NodeCell property
_inExpandCollapse = false;
this.LockVerticalScrollBarUpdate(false);
this.ResumeLayout(true);
this.InvalidateCell(node.Cells[0]);
}
return !exp.Cancel;
}
else
{
// row is already expanded, so we didn't do anything.
return false;
}
}
开发者ID:swatt6400,项目名称:NetOffice,代码行数:42,代码来源:TreeGridView.cs
示例16: CollapseNode
protected internal virtual bool CollapseNode(TreeGridNode node)
{
if (node.IsExpanded)
{
CollapsingEventArgs exp = new CollapsingEventArgs(node);
this.OnNodeCollapsing(exp);
if (!exp.Cancel)
{
this.LockVerticalScrollBarUpdate(true);
this.SuspendLayout();
_inExpandCollapse = true;
node.IsExpanded = false;
foreach (TreeGridNode childNode in node.Nodes)
{
Debug.Assert(childNode.RowIndex != -1, "Row is NOT in the grid.");
this.UnSiteNode(childNode);
}
CollapsedEventArgs exped = new CollapsedEventArgs(node);
this.OnNodeCollapsed(exped);
//TODO: Convert this to a specific NodeCell property
_inExpandCollapse = false;
this.LockVerticalScrollBarUpdate(false);
this.ResumeLayout(true);
this.InvalidateCell(node.Cells[0]);
}
return !exp.Cancel;
}
else
{
// row isn't expanded, so we didn't do anything.
return false;
}
}
开发者ID:swatt6400,项目名称:NetOffice,代码行数:38,代码来源:TreeGridView.cs
示例17: UpdateChildNodes
private void UpdateChildNodes(TreeGridNode node)
{
if (node.HasChildren)
{
foreach (TreeGridNode childNode in node.Nodes)
{
childNode._grid = node._grid;
this.UpdateChildNodes(childNode);
}
}
}
开发者ID:Ricordanza,项目名称:Ricordanza.kernel,代码行数:11,代码来源:TreeGridNode.cs
示例18: RemoveChildNode
internal protected virtual bool RemoveChildNode(TreeGridNode node)
{
if ((this.IsRoot || this._isSited) && this.IsExpanded )
{
//We only unsite out child node if we are sited and expanded.
this._grid.UnSiteNode(node);
}
node._grid = null;
node._parent = null;
return true;
}
开发者ID:Ricordanza,项目名称:Ricordanza.kernel,代码行数:13,代码来源:TreeGridNode.cs
示例19: AddChildNode
internal protected virtual bool AddChildNode(TreeGridNode node)
{
node._parent = this;
node._grid = this._grid;
// ensure that all children of this node has their grid set
if (this._grid != null)
UpdateChildNodes(node);
if ((this._isSited || this.IsRoot) && this.IsExpanded && !node._isSited)
this._grid.SiteNode(node);
return true;
}
开发者ID:Ricordanza,项目名称:Ricordanza.kernel,代码行数:14,代码来源:TreeGridNode.cs
示例20: InsertChildNode
internal protected virtual bool InsertChildNode(int index, TreeGridNode node)
{
node._parent = this;
node._grid = this._grid;
// ensure that all children of this node has their grid set
if (this._grid != null)
UpdateChildNodes(node);
//TODO: do we need to use index parameter?
if ((this._isSited || this.IsRoot) && this.IsExpanded)
this._grid.SiteNode(node);
return true;
}
开发者ID:Ricordanza,项目名称:Ricordanza.kernel,代码行数:14,代码来源:TreeGridNode.cs
注:本文中的TreeGridNode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论