本文整理汇总了C#中System.Windows.Forms.TreeNode.IsRootEventsNode方法的典型用法代码示例。如果您正苦于以下问题:C# TreeNode.IsRootEventsNode方法的具体用法?C# TreeNode.IsRootEventsNode怎么用?C# TreeNode.IsRootEventsNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TreeNode
的用法示例。
在下文中一共展示了TreeNode.IsRootEventsNode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleItemSelect
private void HandleItemSelect(TreeNode selectedTreeNode)
{
bool shouldShow = selectedTreeNode.IsRootEventsNode();
if (shouldShow)
{
EventsViewModel evm = new EventsViewModel();
evm.BackingElement = GlueState.Self.CurrentElement;
mEventItemList.DataContext = evm;
if (!mContainer.Controls.Contains(mTab))
{
mContainer.Controls.Add(mTab);
mContainer.SelectTab(mContainer.Controls.Count - 1);
}
}
else if(mContainer.Controls.Contains(mTab))
{
mContainer.Controls.Remove(mTab);
}
}
示例2: PopulateRightClickItems
//.........这里部分代码省略.........
}
#endregion
#region IsRootScreenNode
else if (node.IsRootScreenNode())
{
menu.Items.Add(form.addScreenToolStripMenuItem);
mImportElement.Text = "Import Screen";
menu.Items.Add(mImportElement);
}
#endregion
#region IsRootBehaviorsNode
else if (node.IsRootBehaviorsNode())
{
menu.Items.Add(form.addBehaviorToolStripMenuItem);
menu.Items.Add(form.openBehaviorFolderToolStripMenuItem);
menu.Items.Add(form.importBehaviorToolStripMenuItem);
}
#endregion
#region IsRootCustomVariables
else if (node.IsRootCustomVariablesNode())
{
menu.Items.Add(form.addVariableToolStripMenuItem);
}
#endregion
#region IsRootEventNode
else if (node.IsRootEventsNode())
{
menu.Items.Add(mAddEventMenuItem);
}
#endregion
#region IsNamedObjectNode
else if (node.IsNamedObjectNode())
{
AddRemoveFromProjectItems(form, menu);
menu.Items.Add(form.editResetVariablesToolStripMenuItem);
menu.Items.Add(mFindAllReferences);
menu.Items.Add("-");
menu.Items.Add(mDuplicate);
menu.Items.Add("-");
menu.Items.Add(mMoveToTop);
menu.Items.Add(mMoveUp);
menu.Items.Add(mMoveDown);
menu.Items.Add(mMoveToBottom);
menu.Items.Add("-");
NamedObjectSave currentNamedObject = EditorLogic.CurrentNamedObject;
if (currentNamedObject.SourceType == SourceType.FlatRedBallType &&
currentNamedObject.SourceClassType == "PositionedObjectList<T>" &&
!string.IsNullOrEmpty(currentNamedObject.SourceClassGenericType) &&
示例3: MoveNamedObject
private static void MoveNamedObject(TreeNode treeNodeMoving, TreeNode targetNode)
{
if (targetNode != null)
{
NamedObjectSave targetNos = targetNode.Tag as NamedObjectSave;
NamedObjectSave movingNos = treeNodeMoving.Tag as NamedObjectSave;
bool succeeded = false;
if (targetNode == null)
{
// Didn't move on to anything
}
else if (targetNode.IsRootNamedObjectNode())
{
succeeded = MoveObjectOnObjectsRoot(treeNodeMoving, targetNode, movingNos, succeeded);
}
else if (targetNode.IsRootCustomVariablesNode())
{
MoveObjectOnRootCustomVariablesNode(treeNodeMoving, targetNode);
}
else if (targetNode.Tag is IElement)
{
succeeded = DragDropNosIntoElement(movingNos, targetNode.Tag as IElement);
}
else if (targetNode.IsRootEventsNode())
{
succeeded = DragDropNosOnRootEventsNode(treeNodeMoving, targetNode);
}
else if (targetNos != null && targetNos.SourceType == SourceType.FlatRedBallType)
{
string targetClassType = targetNos.SourceClassType;
#region Failure cases
if (string.IsNullOrEmpty(targetClassType))
{
MessageBox.Show("The target Object does not have a defined type. This operation is not valid");
}
#endregion
#region Moving on to a Layer
else if (targetClassType == "Layer")
{
// Only allow this if the NOS's are on the same object
if (ObjectFinder.Self.GetElementContaining(movingNos) ==
ObjectFinder.Self.GetElementContaining(targetNos))
{
succeeded = true;
movingNos.LayerOn = targetNos.InstanceName;
MainGlueWindow.Self.PropertyGrid.Refresh();
}
}
#endregion
#region Moving on to a PositionedObjectList
else if (targetClassType == "PositionedObjectList<T>")
{
succeeded = HandleDropOnList(treeNodeMoving, targetNode, targetNos, movingNos);
}
#endregion
}
else
{
MessageBox.Show("Invalid movement");
}
if (succeeded)
{
if (EditorLogic.CurrentElement != null)
{
ElementViewWindow.GenerateSelectedElementCode();
}
else
{
ContentLoadWriter.UpdateLoadGlobalContentCode();
}
ProjectManager.SaveProjects();
GluxCommands.Self.SaveGlux();
}
}
}
示例4: MoveCustomVariable
private static void MoveCustomVariable(TreeNode nodeMoving, TreeNode targetNode)
{
CustomVariable customVariable = nodeMoving.Tag as CustomVariable;
if (targetNode.IsRootEventsNode())
{
// The user dragged a variable onto the events node, so they want to make
// an event for this. We'll assume an "after" event since I think no one makes
// before events
if (customVariable != null)
{
customVariable.CreatesEvent = true;
FlatRedBall.Glue.Events.EventResponseSave eventResponseSave = new Events.EventResponseSave();
eventResponseSave.EventName = "After" + customVariable.Name + "Set";
eventResponseSave.SourceObject = null;
eventResponseSave.SourceObjectEvent = null;
eventResponseSave.SourceVariable = customVariable.Name;
eventResponseSave.BeforeOrAfter = BeforeOrAfter.After;
eventResponseSave.DelegateType = null;
RightClickHelper.AddEventToElementAndSave(EditorLogic.CurrentElement, eventResponseSave);
}
}
else if (targetNode.IsRootCustomVariablesNode())
{
// let's see if the user is moving a variable from one element to another
IElement sourceElement = nodeMoving.GetContainingElementTreeNode().Tag as IElement;
IElement targetElement = targetNode.GetContainingElementTreeNode().Tag as IElement;
if (sourceElement != targetElement)
{
// copying a variable from one element to another
// eventually we need to add some error checking here.
CustomVariable newVariable = customVariable.Clone();
targetElement.CustomVariables.Add(newVariable);
GlueCommands.Self.GenerateCodeCommands.GenerateElementCode(targetElement);
GlueCommands.Self.RefreshCommands.RefreshUi(targetElement);
}
}
}