示例#1
0
        public FindReplace(MainForm main, NodeTreeController controller, DataNode searchRoot)
        {
            InitializeComponent();

            _main           = main;
            _mainController = controller;
            _mainSearchRoot = searchRoot;

            _findController = new RuleTreeController(treeView1);
            treeView1.NodeMouseDoubleClick += (s, e) => { _findController.EditSelection(); };

            //_findController.VirtualRootDisplay = "Find Rules";

            _replaceController              = new NodeTreeController(treeView2);
            treeView2.NodeMouseDoubleClick += (s, e) => { _replaceController.EditSelection(); };

            _replaceController.VirtualRootDisplay = "Replacement Tags";

            _explorerStrip.Renderer  = new ToolStripExplorerRenderer();
            _explorerStrip.ImageList = _mainController.IconList;

            _explorerManager = new ExplorerBarController(_explorerStrip, _mainController.IconRegistry,
                                                         _mainController.IconList, searchRoot);
            _explorerManager.SearchRootChanged += (s, e) =>
            {
                _mainSearchRoot = _explorerManager.SearchRoot;
                Reset();
            };
        }
示例#2
0
        public MainForm()
        {
            InitializeComponent();
            InitializeIconRegistry();
            FormHandlers.Register();
            NbtClipboardController.Initialize(new NbtClipboardControllerWin());

            _controller = new NodeTreeController(_nodeTree);
            _controller.ConfirmAction        += _controller_ConfirmAction;
            _controller.SelectionInvalidated += _controller_SelectionInvalidated;

            FormClosing += MainForm_Closing;

            _nodeTree.BeforeExpand         += _nodeTree_BeforeExpand;
            _nodeTree.AfterCollapse        += _nodeTree_AfterCollapse;
            _nodeTree.AfterSelect          += _nodeTree_AfterSelect;
            _nodeTree.NodeMouseDoubleClick += _nodeTree_NodeMouseDoubleClick;
            _nodeTree.NodeMouseClick       += _nodeTree_NodeMouseClick;
            _nodeTree.DragEnter            += _nodeTree_DragEnter;
            _nodeTree.DragDrop             += _nodeTree_DragDrop;

            _buttonOpen.Click            += _buttonOpen_Click;
            _buttonOpenFolder.Click      += _buttonOpenFolder_Click;
            _buttonSave.Click            += _buttonSave_Click;
            _buttonEdit.Click            += _buttonEdit_Click;
            _buttonRename.Click          += _buttonRename_Click;
            _buttonDelete.Click          += _buttonDelete_Click;
            _buttonCopy.Click            += _buttonCopy_Click;
            _buttonCut.Click             += _buttonCut_Click;
            _buttonPaste.Click           += _buttonPaste_Click;
            _buttonAddTagByte.Click      += _buttonAddTagByte_Click;
            _buttonAddTagByteArray.Click += _buttonAddTagByteArray_Click;
            _buttonAddTagCompound.Click  += _buttonAddTagCompound_Click;
            _buttonAddTagDouble.Click    += _buttonAddTagDouble_Click;
            _buttonAddTagFloat.Click     += _buttonAddTagFloat_Click;
            _buttonAddTagInt.Click       += _buttonAddTagInt_Click;
            _buttonAddTagIntArray.Click  += _buttonAddTagIntArray_Click;
            _buttonAddTagList.Click      += _buttonAddTagList_Click;
            _buttonAddTagLong.Click      += _buttonAddTagLong_Click;
            _buttonAddTagLongArray.Click += _buttonAddTagLongArray_Click;
            _buttonAddTagShort.Click     += _buttonAddTagShort_Click;
            _buttonAddTagString.Click    += _buttonAddTagString_Click;
            _buttonFindNext.Click        += _buttonFindNext_Click;

            _menuItemOpen.Click       += _menuItemOpen_Click;
            _menuItemOpenFolder.Click += _menuItemOpenFolder_Click;
            _menuItemOpenMinecraftSaveFolder.Click += _menuItemOpenMinecraftSaveFolder_Click;
            _menuItemSave.Click           += _menuItemSave_Click;
            _menuItemExit.Click           += _menuItemExit_Click;
            _menuItemEditValue.Click      += _menuItemEditValue_Click;
            _menuItemRename.Click         += _menuItemRename_Click;
            _menuItemDelete.Click         += _menuItemDelete_Click;
            _menuItemCopy.Click           += _menuItemCopy_Click;
            _menuItemCut.Click            += _menuItemCut_Click;
            _menuItemPaste.Click          += _menuItemPaste_Click;
            _menuItemFind.Click           += _menuItemFind_Click;
            _menuItemFindNext.Click       += _menuItemFindNext_Click;
            _menuItemAbout.Click          += _menuItemAbout_Click;
            _menuItemOpenInExplorer.Click += _menuItemOpenInExplorer_Click;

            string[] args = Environment.GetCommandLineArgs();
            if (args.Length > 1)
            {
                string[] paths = new string[args.Length - 1];
                Array.Copy(args, 1, paths, 0, paths.Length);
                OpenPaths(paths);
            }
            else
            {
                OpenMinecraftDirectory();
            }

            UpdateOpenMenu();
        }