private bool CreateIntArrayNodePred(DataNode dataNode, out GroupCapabilities caps) { caps = GroupCapabilities.Single; return (dataNode != null) && dataNode.CanCreateTag(TagType.TAG_INT_ARRAY); }
private bool CreateStringNodePred(DataNode dataNode, out GroupCapabilities caps) { caps = GroupCapabilities.Single; return (dataNode != null) && dataNode.CanCreateTag(TagType.TAG_STRING); }
private bool CreateDoubleNodePred(DataNode dataNode, out GroupCapabilities caps) { caps = GroupCapabilities.Single; return (dataNode != null) && dataNode.CanCreateTag(TagType.TAG_DOUBLE); }
private bool CreateFloatNodePred(DataNode dataNode, out GroupCapabilities caps) { caps = GroupCapabilities.Single; return (dataNode != null) && dataNode.CanCreateTag(TagType.TAG_FLOAT); }
private bool CreateCompoundNodePred(DataNode dataNode, out GroupCapabilities caps) { caps = GroupCapabilities.Single; return (dataNode != null) && dataNode.CanCreateTag(TagType.TAG_COMPOUND); }
private void UpdateUI(DataNode node) { if (node == null) return; _buttonAddTagByte.Enabled = node.CanCreateTag(TagType.TAG_BYTE); _buttonAddTagByteArray.Enabled = node.CanCreateTag(TagType.TAG_BYTE_ARRAY); _buttonAddTagCompound.Enabled = node.CanCreateTag(TagType.TAG_COMPOUND); _buttonAddTagDouble.Enabled = node.CanCreateTag(TagType.TAG_DOUBLE); _buttonAddTagFloat.Enabled = node.CanCreateTag(TagType.TAG_FLOAT); _buttonAddTagInt.Enabled = node.CanCreateTag(TagType.TAG_INT); _buttonAddTagIntArray.Enabled = node.CanCreateTag(TagType.TAG_INT_ARRAY); _buttonAddTagList.Enabled = node.CanCreateTag(TagType.TAG_LIST); _buttonAddTagLong.Enabled = node.CanCreateTag(TagType.TAG_LONG); _buttonAddTagShort.Enabled = node.CanCreateTag(TagType.TAG_SHORT); _buttonAddTagString.Enabled = node.CanCreateTag(TagType.TAG_STRING); _buttonSave.Enabled = CheckModifications(); _buttonCopy.Enabled = node.CanCopyNode && NbtClipboardController.IsInitialized; _buttonCut.Enabled = node.CanCutNode && NbtClipboardController.IsInitialized; _buttonDelete.Enabled = node.CanDeleteNode; _buttonEdit.Enabled = node.CanEditNode; _buttonFindNext.Enabled = node.CanSearchNode || _searchState != null; _buttonPaste.Enabled = node.CanPasteIntoNode && NbtClipboardController.IsInitialized; _buttonRename.Enabled = node.CanRenameNode; _buttonRefresh.Enabled = node.CanRefreshNode; _menuItemSave.Enabled = _buttonSave.Enabled; _menuItemCopy.Enabled = node.CanCopyNode && NbtClipboardController.IsInitialized; _menuItemCut.Enabled = node.CanCutNode && NbtClipboardController.IsInitialized; _menuItemDelete.Enabled = node.CanDeleteNode; _menuItemEditValue.Enabled = node.CanEditNode; _menuItemFind.Enabled = node.CanSearchNode; _menuItemPaste.Enabled = node.CanPasteIntoNode && NbtClipboardController.IsInitialized; _menuItemRename.Enabled = node.CanRenameNode; _menuItemRefresh.Enabled = node.CanRefreshNode; _menuItemFind.Enabled = node.CanSearchNode; _menuItemFindNext.Enabled = _searchState != null; UpdateUI(_nodeTree.SelectedNodes); }
private void UpdateUI (DataNode node) { if (_appDelegate == null || node == null) return; _appDelegate.MenuInsertByte.Enabled = node.CanCreateTag(TagType.TAG_BYTE); _appDelegate.MenuInsertShort.Enabled = node.CanCreateTag(TagType.TAG_SHORT); _appDelegate.MenuInsertInt.Enabled = node.CanCreateTag(TagType.TAG_INT); _appDelegate.MenuInsertLong.Enabled = node.CanCreateTag(TagType.TAG_LONG); _appDelegate.MenuInsertFloat.Enabled = node.CanCreateTag(TagType.TAG_FLOAT); _appDelegate.MenuInsertDouble.Enabled = node.CanCreateTag(TagType.TAG_DOUBLE); _appDelegate.MenuInsertByteArray.Enabled = node.CanCreateTag(TagType.TAG_BYTE_ARRAY); _appDelegate.MenuInsertIntArray.Enabled = node.CanCreateTag(TagType.TAG_INT_ARRAY); _appDelegate.MenuInsertString.Enabled = node.CanCreateTag(TagType.TAG_STRING); _appDelegate.MenuInsertList.Enabled = node.CanCreateTag(TagType.TAG_LIST); _appDelegate.MenuInsertCompound.Enabled = node.CanCreateTag(TagType.TAG_COMPOUND); _appDelegate.MenuSave.Enabled = CheckModifications(); _appDelegate.MenuCopy.Enabled = node.CanCopyNode && NbtClipboardController.IsInitialized; _appDelegate.MenuCut.Enabled = node.CanCutNode && NbtClipboardController.IsInitialized; _appDelegate.MenuPaste.Enabled = node.CanPasteIntoNode && NbtClipboardController.IsInitialized; _appDelegate.MenuDelete.Enabled = node.CanDeleteNode; _appDelegate.MenuEditValue.Enabled = node.CanEditNode; _appDelegate.MenuRename.Enabled = node.CanRenameNode; _appDelegate.MenuMoveUp.Enabled = node.CanMoveNodeUp; _appDelegate.MenuMoveDown.Enabled = node.CanMoveNodeDown; _appDelegate.MenuFind.Enabled = node.CanSearchNode; _appDelegate.MenuFindNext.Enabled = _searchState != null; _toolbarByte.Enabled = _appDelegate.MenuInsertByte.Enabled; _toolbarShort.Enabled = _appDelegate.MenuInsertShort.Enabled; _toolbarInt.Enabled = _appDelegate.MenuInsertInt.Enabled; _toolbarLong.Enabled = _appDelegate.MenuInsertLong.Enabled; _toolbarFloat.Enabled = _appDelegate.MenuInsertFloat.Enabled; _toolbarDouble.Enabled = _appDelegate.MenuInsertDouble.Enabled; _toolbarByteArray.Enabled = _appDelegate.MenuInsertByteArray.Enabled; _toolbarIntArray.Enabled = _appDelegate.MenuInsertIntArray.Enabled; _toolbarString.Enabled = _appDelegate.MenuInsertString.Enabled; _toolbarList.Enabled = _appDelegate.MenuInsertList.Enabled; _toolbarCompound.Enabled = _appDelegate.MenuInsertCompound.Enabled; _toolbarSave.Enabled = _appDelegate.MenuSave.Enabled; _toolbarDelete.Enabled = _appDelegate.MenuDelete.Enabled; _toolbarEdit.Enabled = _appDelegate.MenuEditValue.Enabled; _toolbarRename.Enabled = _appDelegate.MenuRename.Enabled; }
public static bool CreateListNodePred (DataNode dataNode, out GroupCapabilities caps) { caps = GroupCapabilities.Single; return (dataNode != null) && dataNode.CanCreateTag(TagType.TAG_LIST); }
public static bool CreateByteArrayNodePred (DataNode dataNode, out GroupCapabilities caps) { caps = GroupCapabilities.Single; return (dataNode != null) && dataNode.CanCreateTag(TagType.TAG_BYTE_ARRAY); }