本文整理汇总了C#中TreeListNode类的典型用法代码示例。如果您正苦于以下问题:C# TreeListNode类的具体用法?C# TreeListNode怎么用?C# TreeListNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TreeListNode类属于命名空间,在下文中一共展示了TreeListNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddTreeListNode
public TreeListNode AddTreeListNode(TreeList treelist, TreeListNode node, Type type, string propertyName, string defaultFunction, string validationFunction)
{
TreeListNode newNode = treelist.AppendNode(new object[] { propertyName, defaultFunction, validationFunction }, node);
//newNode.ImageIndex = newNode.SelectImageIndex = (int)image;
newNode.Tag = type;
return newNode;
}
示例2: AddNodeDataToDataTable
public void AddNodeDataToDataTable(DataTable dt, TreeListNode node, List<string> listColID)
{
DataRow newRow = dt.NewRow();
foreach (string colID in listColID)
{
//���������ڶ��㼰�Ժ���ǰ��ӿո�
if (colID == "StuffName" && node.ParentNode != null)
{
newRow[colID] = "����" + node[colID];
}
else
{
newRow[colID] = node[colID];
}
}
//�����������ӿ���
if (node.ParentNode == null && dt.Rows.Count > 0)
{
dt.Rows.Add(new object[] { });
}
dt.Rows.Add(newRow);
foreach (TreeListNode nd in node.Nodes)
{
AddNodeDataToDataTable(dt, nd, listColID);
}
}
示例3: DeleteNode
//删除元件
public void DeleteNode(TreeListNode tln)
{
if (tln.HasChildren)
{
for (int i = 0; i < tln.Nodes.Count; i++)
{
DeleteNode(tln.Nodes[i]);
}
DeleteNode(tln);
}
else
{
Ps_pdtypenode pf = new Ps_pdtypenode();
pf.ID = tln["ID"].ToString();
string nodestr = tln["AreaName"].ToString();
try
{
TreeListNode node = tln.TreeList.FindNodeByKeyID(pf.ID);
if (node != null)
tln.TreeList.DeleteNode(node);
RemoveDataTableRow(dt, pf.ID);
Services.BaseService.Delete<Ps_pdtypenode>(pf);
}
catch (Exception e)
{
MessageBox.Show(e.Message + "删除结点出错!");
}
}
}
示例4: PopulateTreeFromMessageGroups
private void PopulateTreeFromMessageGroups(IEnumerable<IGrouping<string, MessageDto>> messageGroups)
{
foreach (var group in messageGroups)
{
var firstOrDefault = group.FirstOrDefault();
if (firstOrDefault == null) continue;
var parent = new TreeListNode(firstOrDefault.ApplicationName);
foreach (var message in group)
{
var child = new TreeListNode(message.ApplicationName);
child.SubItems.Add(message.MachineName);
child.SubItems.Add(message.InsertDate.ToString());
child.SubItems.Add(message.ExceptionType);
child.SubItems.Add(message.ExceptionMessage);
child.SubItems.Add(message.HelpText);
child.SubItems.Add(message.CommandLineArgs);
child.SubItems.Add(message.StackTrace);
child.SubItems.Add(message.Id.ToString());
parent.Nodes.Add(child);
TotalMessages++;
}
tlvMessages.Nodes.Add(parent);
}
}
示例5: InitFolder
private void InitFolder(TreeListNode treeListNode)
{
fileTree.BeginDataUpdate();
InitFolders(treeListNode);
InitFiles(treeListNode);
fileTree.EndDataUpdate();
}
示例6: FindChildNode
public override IEnumerable<TreeListNode> FindChildNode(TreeListNode mine, Guid id)
{
var result = new List<TreeListNode>();
if (Id == id) result.Add(mine);
return result;
}
示例7: ApplyChangeForApiExtensions
private static void ApplyChangeForApiExtensions(TreeListNode node)
{
var tagName = (string)node.GetValue(0);
object theirValue = node.GetValue(1);
switch (tagName)
{
case "Category":
((UserOption)node.ParentNode.Tag).Category = (string)theirValue;
break;
case "DefaultValue":
((UserOption)node.ParentNode.Tag).DefaultValueFunctionBody = (string)theirValue;
break;
case "Description":
((UserOption)node.ParentNode.Tag).Description = (string)theirValue;
break;
case "IteratorType":
((UserOption)node.ParentNode.Tag).IteratorType = (Type)theirValue;
break;
case "ResetPerSession":
((UserOption)node.ParentNode.Tag).ResetPerSession = (bool)theirValue;
break;
case "Text":
((UserOption)node.ParentNode.Tag).Text = (string)theirValue;
break;
case "VariableName":
((UserOption)node.ParentNode.Tag).VariableName = (string)theirValue;
break;
case "VarType":
((UserOption)node.ParentNode.Tag).VarType = (Type)theirValue;
break;
default:
throw new NotImplementedException("Node not hendled yet: " + tagName);
}
}
示例8: DeleteNode
//删除结点
public void DeleteNode(TreeListNode tln)
{
if (tln.HasChildren) {
for (int i = 0; i < tln.Nodes.Count; i++) {
DeleteNode(tln.Nodes[i]);
}
DeleteNode(tln);
} else {
Ps_pdreltype pf = new Ps_pdreltype();
pf.ID = tln["ID"].ToString();
string nodestr = tln["Title"].ToString();
try {
TreeListNode node = tln.TreeList.FindNodeByKeyID(pf.ID);
if (node != null)
tln.TreeList.DeleteNode(node);
RemoveDataTableRow(dataTable, pf.ID);
Ps_pdtypenode pn = new Ps_pdtypenode();
pn.pdreltypeid = pf.ID;
Itop.Client.Common.Services.BaseService.Update("DeletePs_pdtypepdreltypeid", pn);
Itop.Client.Common.Services.BaseService.Delete<Ps_pdreltype>(pf);
} catch (Exception e) {
MessageBox.Show(e.Message + "删除结点出错!");
}
}
}
示例9: Execute
public void Execute(TreeListNode node)
{
if (node == null)
{
throw new ArgumentNullException("node");
}
if (node.Nodes.Count > 0)
{
return;
}
ChoiceActionItem choiceActionItem = node.Tag as ChoiceActionItem;
if (choiceActionItem == null)
{
return;
}
if (!this.IsConfirmed(choiceActionItem))
{
return;
}
// workaround for xpand master-detail
// master-detail подписывается на событие Executing ВСЕХ action главного фрейма и отменяет их, когда в интерфейсе выбран detail
// убираем эту подписку с нашего action
Aurum.Menu.Utils.EventHelper.RemoveEventHandler(this.action, "Executing", d => d.Method != null && d.Method.Name != null && d.Method.Name.Contains("PushExecutionToNestedFrame"));
this.action.DoExecute(choiceActionItem);
}
示例10: InitFolders
private void InitFolders(TreeListNode treeListNode)
{
Directory item = treeListNode.Content as Directory;
if (item == null) return;
try
{
string[] root = Helper.GetDirectories(item.Path);
foreach (string s in root)
{
TreeListNode node = new TreeListNode()
{
Content = new Directory() { Name = Helper.GetDirectoryName(s), Parent = item },
Image = FileSystemImages.ClosedFolderImage
};
treeListNode.Nodes.Add(node);
node.IsExpandButtonVisible = HasFiles(s) ?
DefaultBoolean.True : DefaultBoolean.False;
}
}
catch
{
treeListNode.IsExpandButtonVisible = DefaultBoolean.False;
}
}
示例11: BuildTree
private void BuildTree(TreeListNode aNode,int ParentId)
{
try
{
treeList1.BeginUnboundLoad();
TreeListNode node;
TreeListNode devicenode;
TreeListNode camnode;
foreach (KeyValuePair<int, GroupInfo> item in listGroup)
{
if (item.Value.ParentId == ParentId)
{
node = treeList1.AppendNode(new object[] { item.Value.Name }, aNode);
node.Tag = item.Key.ToString() + ";G";
foreach (KeyValuePair<int, DeviceInfo> device in item.Value.ListDevice)
{
devicenode = treeList1.AppendNode(new object[] { device.Value.Name }, node);
devicenode.Tag = device.Key.ToString() + ";D";
foreach (KeyValuePair<int, CameraInfo> cam in device.Value.ListCamera)
{
camnode = treeList1.AppendNode(new object[] { cam.Value.Name }, devicenode);
camnode.Tag = cam.Key.ToString() + ";C";
}
}
BuildTree(node, item.Key);
}
}
}
catch (Exception ex)
{
}
}
示例12: AddNodeTheirs
private TreeListNode AddNodeTheirs(string name, object theirValue, object myValue, TreeListNode parentNode, object tag)
{
TreeListNode node = treeListTheirs.AppendNode(new object[] { name, theirValue, "", myValue }, parentNode);
node.Tag = tag;
node.StateImageIndex = (int)TreeNodeImages.Unchecked;
return node;
}
示例13: SetForChildren
private void SetForChildren(TreeListNode node, bool value)
{
foreach (TreeListNode childNode in node.Nodes)
{
((ReconTrade)childNode.Content).Visible = value;
SetForChildren(childNode, value);
}
}
示例14: GetSelection
private void GetSelection(List<AuthorizationCommand> list, TreeListNode node)
{
foreach (TreeListNode child in node.Nodes) {
if (child.CheckState == CheckState.Checked && child.Tag != null)
list.Add(child.Tag as AuthorizationCommand);
if (child.Nodes.Count > 0)
GetSelection(list, child);
}
}
示例15: AppendNode
public override TreeListNode AppendNode(object nodeData, TreeListNode parentNode)
{
TreeListNode node = base.AppendNode(nodeData, parentNode);
if (this.OnNewNode != null)
{
this.OnNewNode(node);
}
return node;
}