本文整理汇总了C#中DevComponents.AdvTree.Node类的典型用法代码示例。如果您正苦于以下问题:C# Node类的具体用法?C# Node怎么用?C# Node使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Node类属于DevComponents.AdvTree命名空间,在下文中一共展示了Node类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AddCondition
private void AddCondition(Rotation rotation, AdvTree advTree)
{
var node = new Node();
node.Text = rotation.Name;
node.Tag = rotation;
AddNode(node, advTree);
}
开发者ID:civicacid,项目名称:myevo,代码行数:7,代码来源:RotationManagerForm.cs
示例2: TreeDragDropEventArgs
public TreeDragDropEventArgs(eTreeAction action, Node[] nodes, Node oldParentNode, Node newParentNode, int insertPosition)
: base(action, nodes)
{
this.NewParentNode = newParentNode;
this.OldParentNode = oldParentNode;
this.InsertPosition = insertPosition;
}
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:7,代码来源:TreeDragDropEventArgs.cs
示例3: TreeDragFeedbackEventArgs
/// <summary>
/// Initializes a new instance of the TreeDragFeedbackEventArgs class.
/// </summary>
/// <param name="parentNode"></param>
/// <param name="insertPosition"></param>
public TreeDragFeedbackEventArgs(Node parentNode, int insertPosition, Node dragNode, DragDropEffects effect)
{
ParentNode = parentNode;
InsertPosition = insertPosition;
_DragNode = dragNode;
_Effect = effect;
}
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:12,代码来源:TreeDragFeedbackEventArgs.cs
示例4: FormLoadSettings
public FormLoadSettings(Tileset[] tilesets)
{
InitializeComponent();
this.tilesets = tilesets;
foreach (var tileset in tilesets)
{
Node node = new Node(tileset.File);
if (String.IsNullOrEmpty(tileset.File))
{
node.Text = String.Format("Not Specified [w: {0}, h: {1}]", tileset.Size.X, tileset.Size.Y);
}
node.Cells.Add(new Cell("<browse for file>"));
node.Cells[0].Editable = false;
node.Cells[1].Editable = false;
node.NodeDoubleClick += node_NodeDoubleClick;
tilesetFilesList.Nodes.Add(node);
}
}
开发者ID:AustinBrunkhorst,项目名称:XNA-World-Editor,代码行数:25,代码来源:FormLoadSettings.cs
示例5: FormSaveSettings
public FormSaveSettings(string saveLocation, FormWorld world)
{
InitializeComponent();
this.saveLocation = saveLocation;
this.world = world;
var saveUri = new Uri(saveLocation);
foreach (var tileset in world.Tilesets)
{
string relative = saveUri.MakeRelativeUri(new Uri(tileset.Filename)).ToString();
Node node = new Node(Path.GetFileName(tileset.Filename))
{
CheckBoxVisible = true,
Checked = tileset.ShouldBuild
};
Cell cell = new Cell()
{
Text = tileset.BuildLocation != null ? tileset.BuildLocation :
Path.Combine(Path.GetDirectoryName(relative), Path.GetFileNameWithoutExtension(relative)),
Editable = true
};
node.Cells[0].Editable = false;
node.Cells.Add(cell);
tilesetFilesList.Nodes.Add(node);
}
}
开发者ID:AustinBrunkhorst,项目名称:XNA-World-Editor,代码行数:33,代码来源:FormSaveSettings.cs
示例6: onWorldChange
/// <summary>
/// Called when the selected world changes
/// </summary>
void onWorldChange()
{
// closed last world open
if (world == null)
{
layersList.Nodes.Clear();
btnAddLayer.Enabled = false;
return;
}
btnAddLayer.Enabled = true;
// cache index before it gets changed from
// modifying the list
int index = world.SelectedLayer;
layersList.Nodes.Clear();
// collision layer
Node collision = new Node("Collision Layer")
{
CheckBoxVisible = true,
Checked = true,
ImageIndex = 1,
Editable = false
};
layersList.Nodes.Add(collision);
// add layers from new world
for (int i = world.LayerCount - 2; i >= 0; i--)
addLayer(world.GetLayerName(i), i == world.SelectedLayer, world.GetLayerVisibility(i));
SetLayer(index);
}
开发者ID:AustinBrunkhorst,项目名称:XNA-World-Editor,代码行数:38,代码来源:LayersPanel.cs
示例7: AddCondition
private void AddCondition(Rule rule, AdvTree advTree)
{
var node = new Node();
node.Text = rule.Name;
node.Tag = rule;
AddNode(node, advTree);
}
开发者ID:civicacid,项目名称:myevo,代码行数:7,代码来源:RotationForm.cs
示例8: GetLastNode
/// <summary>
/// Gets the last child tree node. The LastNode is the last child Node in the NodeCollection stored in the Nodes property of the current tree node. If the Node has no child tree node, the LastNode property returns a null reference (Nothing in Visual Basic).
/// </summary>
/// <param name="node">Reference node.</param>
/// <returns>Last node if found or null if there is no last node.</returns>
public static Node GetLastNode(Node node)
{
if(node.Nodes.Count>0)
{
return node.Nodes[node.Nodes.Count-1];
}
return null;
}
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:13,代码来源:NodeOperations.cs
示例9: AddSchool
private void AddSchool(string name)
{
var add = new Node(name);
add.Tag = name;
ListSchoolItems.BeginUpdate();
ListSchoolItems.Nodes.Add(add);
ListSchoolItems.EndUpdate();
}
开发者ID:acidburn974,项目名称:lazybot,代码行数:8,代码来源:Settings.cs
示例10: TreeNodeMouseEventArgs
public TreeNodeMouseEventArgs(Node node, MouseButtons button, int clicks, int delta, int x, int y)
{
this.Node = node;
this.Button = button;
this.Clicks = clicks;
this.Delta = delta;
this.X = x;
this.Y = y;
}
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:9,代码来源:TreeNodeMouseEventArgs.cs
示例11: CreateControl
public Node CreateControl(string name, string tag, Control control)
{
var node = new Node();
node.Expanded = true;
node.Name = name;
node.Tag = tag;
node.HostedControl = control;
node.DragDropEnabled = false;
return node;
}
开发者ID:civicacid,项目名称:myevo,代码行数:10,代码来源:AbstractCondition.cs
示例12: CreateRadioButton
public Node CreateRadioButton(string name, string text, string tag, bool selected = false)
{
var node = new Node();
node.CheckBoxStyle = eCheckBoxStyle.RadioButton;
node.CheckBoxVisible = true;
node.Expanded = true;
node.Name = name;
node.Text = text;
node.Tag = tag;
node.Checked = selected;
node.DragDropEnabled = false;
return node;
}
开发者ID:civicacid,项目名称:myevo,代码行数:13,代码来源:AbstractCondition.cs
示例13: GetFullPath
/// <summary>
/// Returns full path to the given node.
/// </summary>
/// <param name="node">Node to return path to.</param>
/// <returns>Full path to the node.</returns>
public static string GetFullPath(Node node,string pathSeparator)
{
if(node==null)
throw new ArgumentNullException("node");
StringBuilder sb=new StringBuilder(node.Text);
node=node.Parent;
while(node!=null)
{
sb.Insert(0, node.Text + pathSeparator);
node=node.Parent;
}
return sb.ToString();
}
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:20,代码来源:NodeOperations.cs
示例14: addProperty
/// <summary>
/// Adds a temporary property to the list
/// </summary>
void addProperty(string name = newPropertyText, string value = "", bool valueEditable = false)
{
Node node = new Node(name)
{
ContextMenu = propertyMenu
};
Cell cell = new Cell(value)
{
Editable = valueEditable
};
node.Cells.Add(cell);
propertiesList.Nodes.Add(node);
}
开发者ID:AustinBrunkhorst,项目名称:XNA-World-Editor,代码行数:19,代码来源:FormWorldProperties.cs
示例15: Add
/// <summary>
/// Adds new object to the collection and provides information about the source of the command
/// </summary>
/// <param name="node">Node to add</param>
/// <param name="action">Source action</param>
/// <returns></returns>
public override int Add(Node node, eTreeAction action)
{
if (this.List.Contains(node)) return -1;
if (TreeSelectionControl.MultiSelect)
{
if (TreeSelectionControl.MultiSelectRule == eMultiSelectRule.SameParent && this.Count>0)
{
if (this[0].Parent != node.Parent)
throw new InvalidOperationException("Node being added does not belong to the same parent as currently selected nodes. See AdvTree.MultiSelectRule property");
}
if (!SuspendEvents)
{
AdvTreeNodeCancelEventArgs cancelArgs = new AdvTreeNodeCancelEventArgs(action, node);
TreeSelectionControl.InvokeOnBeforeNodeSelect(cancelArgs);
if (cancelArgs.Cancel)
return -1;
}
}
return base.Add(node, action);
}
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:27,代码来源:SelectedNodesCollection.cs
示例16: Populate
private void Populate()
{
nodeNewTables.Nodes.Clear();
advTreeTables.BeginUpdate();
try
{
// Fetch all schemas for
IDatabaseLoader loader = FormDatabase.Instance.CreateDatabaseLoader();
IDatabase newDb = loader.LoadDatabase(loader.DatabaseObjectsToFetch, null);
foreach (var schema in newDb.Tables.Select(s => s.Schema).Distinct().Where(s => !ExistingSchemas.Contains(s)).OrderBy(s => s))
{
Node schemaNode = new Node(schema)
{
CheckBoxVisible = true,
Checked = false
};
nodeNewTables.Nodes.Add(schemaNode);
foreach (var table in newDb.Tables.Where(t => t.Schema == schema).Select(t => t.Name).OrderBy(t => t))
{
Node tableNode = new Node(table)
{
CheckBoxVisible = true,
Checked = false
};
schemaNode.Nodes.Add(tableNode);
}
}
}
finally
{
advTreeTables.EndUpdate();
}
}
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:36,代码来源:FormSelectSchemas.cs
示例17: Fill
public void Fill(DatabaseMergeResult results, IDatabase db1, IDatabase db2)
{
if (InvokeRequired)
{
Invoke(new MethodInvoker(() => Fill(results, db1, db2)));
return;
}
DB1 = db1;
DB2 = db2;
advTreeTables.BeginUpdate();
nodeNewEntities.Nodes.Clear();
nodeModifiedEntities.Nodes.Clear();
nodeRemovedEntities.Nodes.Clear();
nodeNewEntities.Checked = true;
nodeModifiedEntities.Checked = true;
nodeRemovedEntities.Checked = false;
try
{
#region Database-only
foreach (TableAdditionOperation addedTableOperation in results.TableOperations.Where(r => r is TableAdditionOperation))
{
Node node = new Node(string.Format("{0}.{1}", addedTableOperation.Object.Schema, addedTableOperation.Object.Name));
node.Tag = addedTableOperation;
node.CheckBoxVisible = true;
node.Checked = false;
node.ImageIndex = IMG_NEW;
nodeRemovedEntities.Nodes.Add(node);
}
#endregion
#region Model-only
IList<SynchroGrid.SynchroCanvas.TableMatch> MatchesModelOnly = new List<SynchroGrid.SynchroCanvas.TableMatch>();
foreach (TableRemovalOperation removedTableOperation in results.TableOperations.Where(r => r is TableRemovalOperation))
{
Node node = new Node(string.Format("{0}.{1}", removedTableOperation.Object.Schema, removedTableOperation.Object.Name));
node.Tag = removedTableOperation;
node.CheckBoxVisible = true;
node.Checked = true;
node.ImageIndex = IMG_REMOVED;
nodeNewEntities.Nodes.Add(node);
}
#endregion
#region Changes
HashSet<string> changedTables = new HashSet<string>();
#region Get tables with changes
foreach (var result in results.ColumnOperations)
changedTables.Add(string.Format("{0}.{1}", result.Object.Parent.Schema, result.Object.Parent.Name));
foreach (var result in results.IndexOperations)
changedTables.Add(string.Format("{0}.{1}", result.Object.Parent.Schema, result.Object.Parent.Name));
foreach (var result in results.KeyOperations)
changedTables.Add(string.Format("{0}.{1}", result.Object.Parent.Schema, result.Object.Parent.Name));
//foreach (var result in results.RelationshipOperations)
// changedTables.Add(string.Format("{0}.{1}", result.Object.PrimaryTable.Schema, result.Object.PrimaryTable.Name));
#endregion
foreach (string changedTable in changedTables)
{
Node node = new Node(changedTable);
node.Tag = changedTable;
node.CheckBoxVisible = true;
node.Checked = true;
node.ImageIndex = IMG_CHANGED;
nodeModifiedEntities.Nodes.Add(node);
#region Columns
foreach (ColumnAdditionOperation newColumn in results.ColumnOperations.Where(r => r is ColumnAdditionOperation).Where(c => string.Format("{0}.{1}", c.Object.Parent.Schema, c.Object.Parent.Name) == changedTable))
{
Node columnnode = new Node(string.Format("Remove column from database: [{0}]", newColumn.Object.Name));
columnnode.Tag = newColumn;
node.Nodes.Add(columnnode);
}
foreach (ColumnChangeOperation changedColumn in results.ColumnOperations.Where(r => r is ColumnChangeOperation).Where(c => string.Format("{0}.{1}", c.Object.Parent.Schema, c.Object.Parent.Name) == changedTable))
{
Node columnnode = new Node(string.Format("Update column in database [{0}]", changedColumn.Object.Name));
columnnode.Tag = changedColumn;
node.Nodes.Add(columnnode);
foreach (string d in changedColumn.Description.Split(','))
columnnode.Nodes.Add(new Node(d));
}
foreach (ColumnRemovalOperation removedColumn in results.ColumnOperations.Where(r => r is ColumnRemovalOperation).Where(c => string.Format("{0}.{1}", c.Object.Parent.Schema, c.Object.Parent.Name) == changedTable))
{
Node columnnode = new Node(string.Format("Add column to database: [{0}]", removedColumn.Object.Name));
columnnode.Tag = removedColumn;
node.Nodes.Add(columnnode);
}
#endregion
//.........这里部分代码省略.........
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:101,代码来源:ModelChanges.cs
示例18: RefreshByUnAlloc
/// <summary>
/// 根據未排時數更新班級列表,同時考量到關鍵字搜尋
/// </summary>
private void RefreshByUnAlloc(string idWho)
{
int Total = 0;
//根據分課的未排時數進行分類
SortedDictionary<int, List<string>> UnAllocWhos = new SortedDictionary<int, List<string>>();
foreach (Class Whom in schLocal.Classes)
{
if (Whom.Name.Equals("無"))
continue;
int UnAlloc = Whom.TotalHour - Whom.AllocHour;
//若未排時數不在字典中則新增
if (!UnAllocWhos.ContainsKey(UnAlloc))
UnAllocWhos.Add(UnAlloc, new List<string>());
if (IsAddWhom(Whom.ClassID))
if (!UnAllocWhos[UnAlloc].Contains(Whom.ClassID))
UnAllocWhos[UnAlloc].Add(Whom.ClassID);
}
nodeTree.Nodes.Clear();
Node nodeRoot = new Node("所有班級");
nodeRoot.TagString = "所有班級";
Node nodeNull = new Node("無班級");
nodeNull.TagString = "無";
nodeTree.Nodes.Add(nodeRoot);
nodeTree.Nodes.Add(nodeNull);
foreach (int vUnAlloc in UnAllocWhos.Keys.ToList().OrderByDescending(x => x))
{
Node UnAlloc = new Node("" + vUnAlloc);
List<string> Names = new List<string>();
foreach (string vWhomID in UnAllocWhos[vUnAlloc])
{
if (schLocal.Classes.Exists(vWhomID))
{
Class whomPaint = schLocal.Classes[vWhomID];
if (whomPaint.TotalHour > 0)
{
int UnAllocHour = whomPaint.TotalHour - whomPaint.AllocHour;
Node nodeWhom = new Node(whomPaint.Name + "(" + UnAllocHour + "/" + whomPaint.TotalHour + ")");
nodeWhom.TagString = whomPaint.ClassID;
Names.Add(whomPaint.ClassID);
UnAlloc.Nodes.Add(nodeWhom);
Total++;
}
}
}
if (UnAlloc.Nodes.Count > 0)
{
UnAlloc.Text = UnAlloc.Text + "(" + UnAlloc.Nodes.Count + ")";
UnAlloc.TagString = string.Join(";", Names.ToArray());
nodeRoot.Nodes.Add(UnAlloc);
nodeRoot.Expand();
}
}
nodeRoot.Text = nodeRoot.Text + "(" + schLocal.Classes.HasTotalHourCount + ")";
nodeRoot.ExpandAll();
}
开发者ID:KunHsiang,项目名称:ischedule,代码行数:73,代码来源:usrClassList.cs
示例19: RefreshByTotalHour
/// <summary>
/// 根據總時數更新班級列表,同時考量到關鍵字搜尋
/// </summary>
private void RefreshByTotalHour(string idWhom)
{
int Total = 0;
//根據分課的總時數進行分類
SortedDictionary<int, List<string>> TotalWhoms = new SortedDictionary<int, List<string>>();
foreach (Class Whom in schLocal.Classes)
{
if (Whom.Name.Equals("無"))
continue;
int TotalHour = Whom.TotalHour;
if (!TotalWhoms.ContainsKey(TotalHour))
TotalWhoms.Add(TotalHour, new List<string>());
if (IsAddWhom(Whom.Name))
if (!TotalWhoms[TotalHour].Contains(Whom.ClassID))
TotalWhoms[TotalHour].Add(Whom.ClassID);
}
nodeTree.Nodes.Clear();
Node nodeRoot = new Node("所有班級");
nodeRoot.TagString = "所有班級";
Node nodeNull = new Node("無班級");
nodeNull.TagString = "無";
nodeTree.Nodes.Add(nodeRoot);
nodeTree.Nodes.Add(nodeNull);
foreach (int vTotalHour in TotalWhoms.Keys.ToList().OrderByDescending(x => x))
{
Node nodeTotalHour = new Node("" + vTotalHour);
List<string> Names = new List<string>();
foreach (string vWhomID in TotalWhoms[vTotalHour])
{
if (schLocal.Classes.Exists(vWhomID))
{
Class whomPaint = schLocal.Classes[vWhomID];
if (whomPaint.TotalHour > 0)
{
int UnAllocHour = whomPaint.TotalHour - whomPaint.AllocHour;
Node nodeWhom = new Node(whomPaint.Name + "(" + UnAllocHour + "/" + whomPaint.TotalHour + ")");
nodeWhom.TagString = whomPaint.ClassID;
Names.Add(whomPaint.ClassID);
nodeTotalHour.Nodes.Add(nodeWhom);
Total++;
}
}
}
if (nodeTotalHour.Nodes.Count > 0)
{
nodeTotalHour.Text = nodeTotalHour.Text + "(" + nodeTotalHour.Nodes.Count + ")";
nodeTotalHour.TagString = string.Join(";", Names.ToArray());
nodeRoot.Nodes.Add(nodeTotalHour);
nodeRoot.Expand();
}
}
nodeRoot.Text = nodeRoot.Text + "(" + schLocal.Classes.HasTotalHourCount + ")";
nodeRoot.ExpandAll();
}
开发者ID:KunHsiang,项目名称:ischedule,代码行数:72,代码来源:usrClassList.cs
示例20: RefreshBySchool
/// <summary>
/// 根據學校更新班級列表,同時考量到關鍵字搜尋
/// </summary>
private void RefreshBySchool(string idWhom)
{
int Total = 0;
//根據分課的總時數進行分類
SortedDictionary<string, List<string>> TotalClasses = new SortedDictionary<string, List<string>>();
foreach (Class Class in schLocal.Classes)
{
if (Class.Name.Equals("無"))
continue;
string[] ClassIDs = Class.ClassID.Split(new char[] { ',' });
string DSNS = ClassIDs[0];
string SchoolName = DSNS;
if (Global.AvailDSNSNames != null)
{
SchoolDSNSName School = Global.AvailDSNSNames
.Find(x => x.DSNSName.Equals(DSNS));
if (School != null)
SchoolName = School.SchoolName;
}
if (!TotalClasses.ContainsKey(SchoolName))
TotalClasses.Add(SchoolName, new List<string>());
if (IsAddWhom(Class.Name))
if (!TotalClasses[SchoolName].Contains(Class.ClassID))
TotalClasses[SchoolName].Add(Class.ClassID);
}
nodeTree.Nodes.Clear();
//Node nodeRoot = new Node("所有班級");
//nodeRoot.TagString = "所有班級";
//Node nodeNull = new Node("無班級");
//nodeNull.TagString = "無";
//nodeTree.Nodes.Add(nodeRoot);
//nodeTree.Nodes.Add(nodeNull);
foreach (string School in TotalClasses.Keys.ToList().OrderByDescending(x => x))
{
Node nodeTotalHour = new Node("" + School);
List<string> Names = new List<string>();
TotalClasses[School].Sort();
foreach (string vWhomID in TotalClasses[School])
{
if (schLocal.Classes.Exists(vWhomID))
{
Class whomPaint = schLocal.Classes[vWhomID];
if (whomPaint.TotalHour > 0)
{
int UnAllocHour = whomPaint.TotalHour - whomPaint.AllocHour;
Node nodeWhom = new Node(whomPaint.Name + "(" + UnAllocHour + "/" + whomPaint.TotalHour + ")");
nodeWhom.TagString = whomPaint.ClassID;
Names.Add(whomPaint.ClassID);
nodeTotalHour.Nodes.Add(nodeWhom);
Total++;
}
}
}
if (nodeTotalHour.Nodes.Count > 0)
{
nodeTotalHour.Text = nodeTotalHour.Text + "(" + nodeTotalHour.Nodes.Count + ")";
nodeTotalHour.TagString = string.Join(";", Names.ToArray());
nodeTotalHour.Expand();
nodeTree.Nodes.Add(nodeTotalHour);
//nodeRoot.Nodes.Add(nodeTotalHour);
//nodeRoot.Expand();
}
}
//nodeRoot.Text = nodeRoot.Text + "(" + schLocal.Classes.HasTotalHourCount + ")";
//nodeRoot.ExpandAll();
}
开发者ID:KunHsiang,项目名称:ischedule,代码行数:91,代码来源:usrClassList.cs
注:本文中的DevComponents.AdvTree.Node类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论