Exemple #1
0
 private bool CreateStringNodePred(DataNode dataNode, out GroupCapabilities caps)
 {
     caps = GroupCapabilities.Single;
     return (dataNode != null) && dataNode.CanCreateTag(TagType.TAG_STRING);
 }
Exemple #2
0
 private bool CreateIntArrayNodePred(DataNode dataNode, out GroupCapabilities caps)
 {
     caps = GroupCapabilities.Single;
     return (dataNode != null) && dataNode.CanCreateTag(TagType.TAG_INT_ARRAY);
 }
Exemple #3
0
 private bool CreateFloatNodePred(DataNode dataNode, out GroupCapabilities caps)
 {
     caps = GroupCapabilities.Single;
     return (dataNode != null) && dataNode.CanCreateTag(TagType.TAG_FLOAT);
 }
Exemple #4
0
 private bool CreateDoubleNodePred(DataNode dataNode, out GroupCapabilities caps)
 {
     caps = GroupCapabilities.Single;
     return (dataNode != null) && dataNode.CanCreateTag(TagType.TAG_DOUBLE);
 }
Exemple #5
0
 private bool CreateCompoundNodePred(DataNode dataNode, out GroupCapabilities caps)
 {
     caps = GroupCapabilities.Single;
     return (dataNode != null) && dataNode.CanCreateTag(TagType.TAG_COMPOUND);
 }
Exemple #6
0
        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;
            _menuItemCopyJSON.Enabled = true;
            _menuItemCut.Enabled = node.CanCutNode && NbtClipboardController.IsInitialized;
            _menuItemDelete.Enabled = node.CanDeleteNode;
            _menuItemEditValue.Enabled = node.CanEditNode;
            _menuItemCopy2.Enabled = node.CanCopyNode && NbtClipboardController.IsInitialized;
            _menuItemCopyJSON2.Enabled = true;
            _menuItemCut2.Enabled = node.CanCutNode && NbtClipboardController.IsInitialized;
            _menuItemDelete2.Enabled = node.CanDeleteNode;
            _menuItemEditValue2.Enabled = node.CanEditNode;
            _menuItemFind.Enabled = node.CanSearchNode;
            _menuItemPaste.Enabled = node.CanPasteIntoNode && NbtClipboardController.IsInitialized;
            _menuItemRename.Enabled = node.CanRenameNode;
            _menuItemPaste2.Enabled = node.CanPasteIntoNode && NbtClipboardController.IsInitialized;
            _menuItemRename2.Enabled = node.CanRenameNode;
            _menuItemRefresh.Enabled = node.CanRefreshNode;
            _menuItemFind.Enabled = node.CanSearchNode;
            _menuItemFindNext.Enabled = _searchState != null;

            UpdateUI(_nodeTree.SelectedNodes);
        }