Example #1
0
            public virtual void Rename()
            {
                RenameDialog dialog = new RenameDialog();

                dialog.SetString(Text);

                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    Text = dialog.textBox1.Text;
                }
            }
Example #2
0
        private void RenameAction(object sender, EventArgs args)
        {
            RenameDialog dialog = new RenameDialog();

            dialog.SetString(Text);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                Text = dialog.textBox1.Text;
            }
        }
Example #3
0
        public void Rename()
        {
            RenameDialog dialog = new RenameDialog();

            dialog.SetString(Text);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                RenameBone(dialog.textBox1.Text);
            }
        }
Example #4
0
        private void RenameFont(TreeNode selectedNode, int index)
        {
            RenameDialog dlg = new RenameDialog();

            dlg.SetString(selectedNode.Text);
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                ActiveLayout.Fonts[index] = dlg.textBox1.Text;
                selectedNode.Text         = dlg.textBox1.Text;
            }
        }
Example #5
0
        private void cmdRenameLayer_Execute()
        {
            RenameDialog rd = new RenameDialog();

            rd.textBox.Text = CurrentLayer.LayerName;
            if (rd.ShowDialog() == false)
            {
                return;
            }
            Layers.ElementAt(CurrentLayer.LayerNumber).LayerName = rd.textBox.Text;
        }
Example #6
0
        private void Rename(object sender, EventArgs args)
        {
            RenameDialog dialog = new RenameDialog();

            dialog.SetString(Text);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                ((FMDL)Parent.Parent).materials.Remove(Text);
                Text = dialog.textBox1.Text;
                ((FMDL)Parent.Parent).materials.Add(Text, this);
            }
        }
Example #7
0
        private void renameButton()
        {
            using (var dlg = new RenameDialog())
            {
                if (dlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                CharSetName = dlg.NewName;
                SetText();
            }
        }
Example #8
0
        private void Rename()
        {
            RenameDialog renameDialog = new RenameDialog(this.DashboardTitle);

            renameDialog.Owner = this;
            var result = renameDialog.ShowDialog().Value;

            if (result == true)
            {
                this.DashboardTitle       = renameDialog.textBox1.Text;
                this.DashboardReport.Name = this.DashboardTitle;
            }
        }
Example #9
0
        private void searchToolStripMenuItem_Click(object sender, EventArgs e)
        {
            return;

            RenameDialog search = new RenameDialog();

            search.Text = "Search";
            search.LoadTree(treeView1);
            if (search.ShowDialog() == DialogResult.OK)
            {
                string NameLookup = search.textBox1.Text;
            }
        }
Example #10
0
        public override void Rename()
        {
            RenameDialog dialog = new RenameDialog();

            dialog.SetString(Text);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                //Update dictionary key
                ((BFRESGroupNode)Parent).ResourceNodes.Remove(Text);
                Text = dialog.textBox1.Text;
                ((BFRESGroupNode)Parent).ResourceNodes.Add(Text, this);
            }
        }
Example #11
0
        private void OnRenameList(object parameter)
        {
            Log.Instance.LogInfo(string.Format("MainViewModel.OnRenameList {0}", parameter));

            if (TaskListGroup != null)
            {
                RenameDialog w = new RenameDialog(TaskListGroup.ListName(SelectedTaskList), OnDoRename);
                w.ShowDialog();
            }
            else
            {
                Log.Instance.LogDebug("MainViewModel.OnRenameList - TaskListGroup is null, skipping");
            }
        }
Example #12
0
        private void SetDuplicateShapeName(FSHP shape)
        {
            DialogResult dialogResult = MessageBox.Show($"A shape {shape.Text} already exists with that name", "", MessageBoxButtons.OK);

            if (dialogResult == DialogResult.OK)
            {
                RenameDialog renameDialog = new RenameDialog();
                renameDialog.Text = "Rename Texture";
                if (renameDialog.ShowDialog() == DialogResult.OK)
                {
                    shape.Text = renameDialog.textBox1.Text;
                }
            }
        }
Example #13
0
        private void Rename(object sender, EventArgs args)
        {
            RenameDialog dialog = new RenameDialog();

            dialog.SetString(Text);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                ((BinaryTextureContainer)Parent).Textures.Remove(Text);
                Text = dialog.textBox1.Text;

                ((BinaryTextureContainer)Parent).Textures.Add(Text, this);
            }
        }
Example #14
0
        public override void RenameParamEntry(ListViewItem SelectedItem)
        {
            if (SelectedItem.Tag != null && SelectedItem.Tag is ParamEntry)
            {
                RenameDialog dialog = new RenameDialog();
                dialog.SetString(SelectedItem.Text);
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    string NewString = dialog.textBox1.Text;

                    ((ParamEntry)SelectedItem.Tag).HashString = NewString;
                }
            }
        }
Example #15
0
        private void RenameAction(object sender, EventArgs args)
        {
            RenameDialog dialog = new RenameDialog();

            dialog.SetString(Text);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                Text = dialog.textBox1.Text;
                if (DirectoryContainer != null)
                {
                    DirectoryContainer.Name = Text;
                }
            }
        }
Example #16
0
    private void ExecuteCreateTag(PrintElement project)
    {
        var dialog = new RenameDialog(_translationManager.GetTranslation(nameof(StringTable.Title_CreateTag)), _translationManager.GetTranslation(nameof(StringTable.Desc_CreateTag)), string.Empty, s => null)
        {
            CustomIcon = new IconPresenter {
                Icon = new MaterialDesignIcon(MaterialDesignIconCode.Plus)
            },
            SubmitButtonContent = _translationManager.GetTranslation(nameof(StringTable.Create)),
        };

        if (dialog.ShowDialog() == true)
        {
            AvailableTags.AddIfNotExists(dialog.NewName);
            project.Tags.AddIfNotExists(dialog.NewName);
        }
    }
Example #17
0
        void rename()
        {
            var rd = new RenameDialog();

            rd.FileName = System.IO.Path.GetFileNameWithoutExtension(PathFileName);
            var dr = rd.ShowDialog();

            if (dr == true && rd.FileName != System.IO.Path.GetFileNameWithoutExtension(PathFileName))
            {
                string fullNewName = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(PathFileName), rd.FileName, System.IO.Path.GetExtension(PathFileName));
                if (!smartRename(PathFileName, fullNewName))
                {
                    return;
                }
            }
        }
Example #18
0
    private void ExecuteRenameProject(PrintElement project)
    {
        string Validation(string newName)
        {
            if (string.Equals(project.Name, newName, StringComparison.OrdinalIgnoreCase))
            {
                return(null);
            }

            var path = Path.Combine(Path.GetDirectoryName(project.DirectoryLocation), newName);

            if (Directory.Exists(path))
            {
                return(string.Format(_translationManager.GetTranslation(nameof(StringTable.Msg_ProjectAlreadyExists)), newName));
            }

            return(null);
        }

        var dialog = new RenameDialog(
            _translationManager.GetTranslation(nameof(StringTable.Title_RenameProject)),
            string.Format(_translationManager.GetTranslation(nameof(StringTable.Desc_RenameProject)), project.Name),
            project.Name,
            Validation)
        {
            Owner = Application.Current.MainWindow,
        };

        if (dialog.ShowDialog() == true)
        {
            var newPath = Path.Combine(Path.GetDirectoryName(project.DirectoryLocation), dialog.NewName);

            SelectedElement = null;
            PrintElements.Remove(project);
            project.Dispose();

            Directory.Move(project.DirectoryLocation, newPath);

            var newProject = new PrintElement(newPath);
            PrintElements.Add(newProject);
            SelectedElement = newProject;
        }
    }
Example #19
0
        private void EditAndSave(BudgetVm aBudget, string aDialogText)
        {
            var lDlg = new RenameDialog()
            {
                Owner       = Window.GetWindow(this),
                Title       = aDialogText,
                Bezeichnung = aBudget.Bezeichnung
            };

            var lResult = lDlg.ShowDialog();

            if (!lResult.HasValue || !lResult.Value || string.IsNullOrEmpty(lDlg.Bezeichnung))
            {
                return;
            }

            aBudget.Bezeichnung = lDlg.Bezeichnung;
            aBudget.Save(false);
        }
Example #20
0
        /// <summary>
        /// Triggers and performs the to-do action.
        /// Renames all selected <see cref="Shape"/>s on the
        /// <see cref="Views.Canvas"/>.
        /// </summary>
        /// <seealso cref="UMLAction.Trigger()"/>
        public override void Trigger()
        {
            Shape[] selectedShapes = Canvas.SelectedShapes;

            if (selectedShapes.Length == 0)
            {
                MessageBox.Show("No object selected!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            RenameDialog dialog = new RenameDialog();

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                string name = dialog.ObjectName;
                RenameShapes(selectedShapes, name);

                Canvas.Invalidate();
            }
        }
Example #21
0
        private void BatchRenameGalaxy(object sender, EventArgs args)
        {
            string ActorName = Path.GetFileNameWithoutExtension(FileName);

            RenameDialog dialog = new RenameDialog();

            dialog.SetString(ActorName);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                string NewActorName = dialog.textBox1.Text;
                FileName = NewActorName + ".arc";

                foreach (var file in files)
                {
                    file.FileName = file.FileName.Replace(ActorName, NewActorName);
                    file.UpdateWrapper();
                }
            }
        }
Example #22
0
        private void mBtnAddBudget_Click(object sender, RoutedEventArgs e)
        {
            var lDlg = new RenameDialog()
            {
                Owner       = Window.GetWindow(this),
                Title       = "Budget erstellen",
                Bezeichnung = string.Empty
            };

            var lResult = lDlg.ShowDialog();

            if (!lResult.HasValue || !lResult.Value || string.IsNullOrEmpty(lDlg.Bezeichnung))
            {
                return;
            }

            string lBezeichnung = lDlg.Bezeichnung;
            var    lBudget      = this.KontoVm.CreateBudget(lBezeichnung);

            this.mDtgBudgets.SelectedItem = lBudget;
        }
        private void RenameTextureAction(object sender, EventArgs e)
        {
            var selectedNode = treeView1.SelectedNode;

            if (selectedNode == null)
            {
                return;
            }

            int    index     = (int)selectedNode.Tag;
            string activeTex = ActiveLayout.Textures[index];

            RenameDialog dlg = new RenameDialog();

            dlg.SetString(activeTex);

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                ActiveLayout.Textures[index] = dlg.textBox1.Text;
                selectedNode.Text            = dlg.textBox1.Text;
            }
        }
Example #24
0
        private void renameBreakpointToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Instruction instr = this.GetContextInstruction();

            if (instr == null)
            {
                return;
            }

            Breakpoint   bp     = instr.Breakpoint;
            RenameDialog dialog = new RenameDialog();

            dialog.Target = RenameTarget.Breakpoint;
            dialog.Value  = bp.Name ?? "";
            if (dialog.ShowDialog(this.FindForm()) == DialogResult.OK)
            {
                bp.Name = dialog.Value;
                _debugger.Breakpoints.Save();
            }

            this.ContextReturn();
        }
Example #25
0
        private static void HandleKeys()
        {
            Debug.Write("New game", "N");
            Debug.Write("Save game", "S");
            Debug.Write("Load game", "L");
            Debug.Write("Nickname", userName);
            Debug.Write("Change nick", "C");

            if (Keyboard.Pressed[Keys.N])
            {
                Keyboard.Pressed[Keys.N] = false;
                StartNewGame();
            }

            if (Keyboard.Pressed[Keys.S])
            {
                Keyboard.Pressed[Keys.S] = false;
                SaveMap();
            }

            if (Keyboard.Pressed[Keys.L])
            {
                Keyboard.Pressed[Keys.L] = false;
                LoadSave();
            }

            if (Keyboard.Pressed[Keys.C])
            {
                Keyboard.Pressed[Keys.C] = false;
                PauseGame();
                renameDialog.UserName = userName;
                renameDialog.ShowDialog();
                userName = renameDialog.UserName;
                FetchUserExists();
                StartNewGame();
                ResumeGame();
            }
        }
Example #26
0
        private void mBtnAddKonto_Click(object sender, RoutedEventArgs e)
        {
            var lDlg = new RenameDialog()
            {
                Owner       = Window.GetWindow(this),
                Title       = "Konto erstellen",
                Bezeichnung = string.Empty
            };

            var lResult = lDlg.ShowDialog();

            if (!lResult.HasValue || !lResult.Value || string.IsNullOrEmpty(lDlg.Bezeichnung))
            {
                return;
            }

            string lBezeichnung = lDlg.Bezeichnung;
            var    lKonto       = DataManager.Konto.CreateKonto(lBezeichnung);

            DataManager.Konto.SaveKonto(lKonto);

            this.ReloadKontos();
        }
Example #27
0
        private void renameToolStripMenuItem_Click(object sender, System.EventArgs e)
        {
            MethodBody method;
            Line       line = this.GetContextLine(out method);

            if (line == null)
            {
                return;
            }
            RenameTarget target = RenameTarget.Method;
            string       value  = "";

            switch (line.Type)
            {
            case LineType.Header:
                target = RenameTarget.Method;
                value  = method.Name;
                break;

            case LineType.Label:
                target = RenameTarget.Label;
                value  = line.Instruction.Label.Name;
                break;

            default:
                return;
            }

            RenameDialog dialog = new RenameDialog();

            dialog.Target = target;
            dialog.Value  = value;
            if (dialog.ShowDialog(this.FindForm()) == DialogResult.OK)
            {
                switch (line.Type)
                {
                case LineType.Header:
                    method.Name = dialog.Value;
                    {
                        bool found = false;
                        foreach (TagInfo tag in _debugger.UserData.CodeTags.MethodNames)
                        {
                            if (tag.Address == method.Address)
                            {
                                found     = true;
                                tag.Value = dialog.Value;
                                break;
                            }
                        }
                        if (found == false)
                        {
                            TagInfo tag = new TagInfo();
                            tag.Address = method.Address;
                            tag.Value   = dialog.Value;
                            _debugger.UserData.CodeTags.MethodNames.Add(tag);
                        }
                        _debugger.CodeCache.Version++;
                        _debugger.UserData.Save();
                    }
                    break;

                case LineType.Label:
                    line.Instruction.Label.Name = dialog.Value;
                    {
                        bool found = false;
                        foreach (TagInfo tag in _debugger.UserData.CodeTags.LabelNames)
                        {
                            if (tag.Address == line.Instruction.Address)
                            {
                                found     = true;
                                tag.Value = dialog.Value;
                                break;
                            }
                        }
                        if (found == false)
                        {
                            TagInfo tag = new TagInfo();
                            tag.Address = line.Instruction.Address;
                            tag.Value   = dialog.Value;
                            _debugger.UserData.CodeTags.LabelNames.Add(tag);
                        }
                        _debugger.CodeCache.Version++;
                        _debugger.UserData.Save();
                    }
                    break;
                }
                this.Invalidate();
            }

            this.ContextReturn();
        }
Example #28
0
 public void Rename()
 {
     using (RenameDialog dlg = new RenameDialog()) { dlg.ShowDialog(MainForm.Instance, _resource); }
 }
Example #29
0
        public void MergeWith(CHR0Node external)
        {
            if (external.FrameCount != FrameCount && MessageBox.Show(null, "Frame counts are not equal; the shorter animation will end early. Do you still wish to continue?", "", MessageBoxButtons.YesNo) == DialogResult.No)
            {
                return;
            }

            if (external.FrameCount > FrameCount)
            {
                FrameCount = external.FrameCount;
            }

            foreach (CHR0EntryNode _extTarget in external.Children)
            {
                CHR0EntryNode node = null;
                KeyframeEntry kfe  = null;

                CHR0EntryNode entry = new CHR0EntryNode()
                {
                    Name = _extTarget.Name
                };
                entry._numFrames = _extTarget.FrameCount;

                //Apply all external keyframes to current entry.
                for (int x = 0; x < _extTarget.FrameCount; x++)
                {
                    for (int i = 0x10; i < 0x19; i++)
                    {
                        if ((kfe = _extTarget.GetKeyframe((KeyFrameMode)i, x)) != null)
                        {
                            entry.Keyframes.SetFrameValue((KeyFrameMode)i, x, kfe._value)._tangent = kfe._tangent;
                        }
                    }
                }

                if ((node = FindChild(_extTarget.Name, false) as CHR0EntryNode) == null)
                {
                    AddChild(entry, true);
                }
                else
                {
                    DialogResult result = MessageBox.Show(null, "A bone entry with the name " + _extTarget.Name + " already exists.\nDo you want to rename this entry?\nOtherwise, you will have the option to merge the keyframes.", "Rename Entry?", MessageBoxButtons.YesNoCancel);
                    if (result == DialogResult.Yes)
                    {
Top:
                        RenameDialog d = new RenameDialog();
                        if (d.ShowDialog(null, entry) == DialogResult.OK)
                        {
                            if (entry.Name != _extTarget.Name)
                            {
                                AddChild(entry, true);
                            }
                            else
                            {
                                MessageBox.Show("The name wasn't changed!");
                                goto Top;
                            }
                        }
                    }
                    else if (result == DialogResult.No)
                    {
                        result = MessageBox.Show(null, "Do you want to merge the keyframes of the entries?", "Merge Keyframes?", MessageBoxButtons.YesNoCancel);
                        if (result == DialogResult.Yes)
                        {
                            KeyframeEntry kfe2 = null;

                            if (_extTarget.FrameCount > node.FrameCount)
                            {
                                node._numFrames = _extTarget.FrameCount;
                            }

                            //Merge all external keyframes with the current entry.
                            for (int x = 0; x < _extTarget.FrameCount; x++)
                            {
                                for (int i = 0x10; i < 0x19; i++)
                                {
                                    if ((kfe = _extTarget.GetKeyframe((KeyFrameMode)i, x)) != null)
                                    {
                                        if ((kfe2 = node.GetKeyframe((KeyFrameMode)i, x)) == null)
                                        {
                                            node.SetKeyframe((KeyFrameMode)i, x, kfe._value);
                                        }
                                        else
                                        {
                                            result = MessageBox.Show(null, "A keyframe at frame " + x + " already exists.\nOld value: " + kfe2._value + "\nNew value:" + kfe._value + "\nReplace the old value with the new one?", "Replace Keyframe?", MessageBoxButtons.YesNoCancel);
                                            if (result == DialogResult.Yes)
                                            {
                                                node.SetKeyframe((KeyFrameMode)i, x, kfe._value);
                                            }
                                            else if (result == DialogResult.Cancel)
                                            {
                                                Restore();
                                                return;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        else if (result == DialogResult.Cancel)
                        {
                            Restore();
                            return;
                        }
                    }
                    else if (result == DialogResult.Cancel)
                    {
                        Restore();
                        return;
                    }
                }
            }
        }