예제 #1
0
        private void AddHdfsServer()
        {
            var form = new HdfsDriveForm();

            if (form.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            var drive = form.Drive;

            if (!_drives.ContainsKey(drive.Key))
            {
                _drives.Add(drive.Key, drive);
                StoreHdfsDrives();
                var node = leftDirectoryTree.Nodes.Add(drive.Key, drive.Label);
                node.Nodes.Add(Resources.LoadingText);
                node = rightDirectoryTree.Nodes.Add(drive.Key, drive.Label);
                node.Nodes.Add(Resources.LoadingText);
            }
            else
            {
                MessageBox.Show(Resources.HdfsDriveExistsMessage, Resources.ErrorCaption,
                                MessageBoxButtons.OK, MessageBoxIcon.Error,
                                MessageBoxDefaultButton.Button1);
            }
        }
예제 #2
0
        private void EditHdfsServer(HdfsDrive drive)
        {
            var currentDriveKey = drive.Key;
            var driveForm       = new HdfsDriveForm {
                Drive = drive
            };

            if (driveForm.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            _drives.Remove(currentDriveKey);
            var newDrive = driveForm.Drive;

            if (!_drives.ContainsKey(newDrive.Key))
            {
                _drives.Add(newDrive.Key, newDrive);
                StoreHdfsDrives();
                var nodes = leftDirectoryTree.Nodes.Find(currentDriveKey, false);
                if (nodes.Length == 1)
                {
                    leftDirectoryTree.Nodes[nodes[0].Index].Name = newDrive.Key;
                    leftDirectoryTree.Nodes[nodes[0].Index].Text = newDrive.Label;
                    leftDirectoryTree.Nodes[nodes[0].Index].Nodes.Clear();
                    leftDirectoryTree.Nodes[nodes[0].Index].Nodes.Add(Resources.LoadingText);
                }
                nodes = rightDirectoryTree.Nodes.Find(currentDriveKey, false);
                if (nodes.Length == 1)
                {
                    rightDirectoryTree.Nodes[nodes[0].Index].Name = newDrive.Key;
                    rightDirectoryTree.Nodes[nodes[0].Index].Text = newDrive.Label;
                    rightDirectoryTree.Nodes[nodes[0].Index].Nodes.Clear();
                    rightDirectoryTree.Nodes[nodes[0].Index].Nodes.Add(Resources.LoadingText);
                }
            }
            else
            {
                MessageBox.Show(Resources.HdfsDriveExistsMessage, Resources.ErrorCaption,
                                MessageBoxButtons.OK, MessageBoxIcon.Error,
                                MessageBoxDefaultButton.Button1);
            }
        }
예제 #3
0
        private void EditHdfsServer(HdfsDrive drive)
        {
            var currentDriveKey = drive.Key;
            var driveForm = new HdfsDriveForm { Drive = drive };
            if (driveForm.ShowDialog() != DialogResult.OK) return;

            _drives.Remove(currentDriveKey);
            var newDrive = driveForm.Drive;
            if (!_drives.ContainsKey(newDrive.Key))
            {
                _drives.Add(newDrive.Key, newDrive);
                StoreHdfsDrives();
                var nodes = leftDirectoryTree.Nodes.Find(currentDriveKey, false);
                if (nodes.Length == 1)
                {
                    leftDirectoryTree.Nodes[nodes[0].Index].Name = newDrive.Key;
                    leftDirectoryTree.Nodes[nodes[0].Index].Text = newDrive.Label;
                    leftDirectoryTree.Nodes[nodes[0].Index].Nodes.Clear();
                    leftDirectoryTree.Nodes[nodes[0].Index].Nodes.Add(Resources.LoadingText);
                }
                nodes = rightDirectoryTree.Nodes.Find(currentDriveKey, false);
                if (nodes.Length == 1)
                {
                    rightDirectoryTree.Nodes[nodes[0].Index].Name = newDrive.Key;
                    rightDirectoryTree.Nodes[nodes[0].Index].Text = newDrive.Label;
                    rightDirectoryTree.Nodes[nodes[0].Index].Nodes.Clear();
                    rightDirectoryTree.Nodes[nodes[0].Index].Nodes.Add(Resources.LoadingText);
                }
            }
            else
            {
                MessageBox.Show(Resources.HdfsDriveExistsMessage, Resources.ErrorCaption,
                                MessageBoxButtons.OK, MessageBoxIcon.Error,
                                MessageBoxDefaultButton.Button1);
            }
        }
예제 #4
0
        private void AddHdfsServer()
        {
            var form = new HdfsDriveForm();
            if (form.ShowDialog() != DialogResult.OK) return;

            var drive = form.Drive;
            if (!_drives.ContainsKey(drive.Key))
            {
                _drives.Add(drive.Key, drive);
                StoreHdfsDrives();
                var node = leftDirectoryTree.Nodes.Add(drive.Key, drive.Label);
                node.Nodes.Add(Resources.LoadingText);
                node = rightDirectoryTree.Nodes.Add(drive.Key, drive.Label);
                node.Nodes.Add(Resources.LoadingText);
            }
            else
            {
                MessageBox.Show(Resources.HdfsDriveExistsMessage, Resources.ErrorCaption,
                                MessageBoxButtons.OK, MessageBoxIcon.Error,
                                MessageBoxDefaultButton.Button1);
            }
        }