Пример #1
0
        private void AddSoundToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var AddNewVSSDialog = new Dialogs.AddEditVSSSound();
            var parentNode      = VSS_Tree.SelectedNode;
            var res             = AddNewVSSDialog.ShowDialog();

            if (res == DialogResult.OK)
            {
                parentNode.Nodes.Add(new VSS.VSS_Entry_Sound(AddNewVSSDialog.NameDesc, AddNewVSSDialog.Hotkey, AddNewVSSDialog.FilePath));
            }
        }
Пример #2
0
        private void EditNode()
        {
            var selectedNode = VSS_Tree.SelectedNode;

            if (selectedNode != VSS_RootEntry)
            {
                if (selectedNode.GetType() == typeof(VSS_Entry_Group))
                {
                    var nodeCast = (VSS_Entry_Group)selectedNode;

                    var EditVSSDialog = new Dialogs.AddEditVSSGroup(true)
                    {
                        ReturnKey = nodeCast.Hotkey,
                        NameDesc  = nodeCast.Description
                    };
                    var res = EditVSSDialog.ShowDialog();
                    if (res == DialogResult.OK)
                    {
                        nodeCast.Hotkey      = EditVSSDialog.ReturnKey;
                        nodeCast.Description = EditVSSDialog.NameDesc;
                        nodeCast.UpdateNodeDisplay();
                    }
                }
                else
                {
                    var nodeCast = (VSS_Entry_Sound)selectedNode;

                    var EditVSSDialog = new Dialogs.AddEditVSSSound(true)
                    {
                        Hotkey   = nodeCast.Hotkey,
                        NameDesc = nodeCast.Description,
                        FilePath = nodeCast.Filepath
                    };
                    var res = EditVSSDialog.ShowDialog();
                    if (res == DialogResult.OK)
                    {
                        nodeCast.Hotkey      = EditVSSDialog.Hotkey;
                        nodeCast.Description = EditVSSDialog.NameDesc;
                        nodeCast.Filepath    = EditVSSDialog.FilePath;
                        nodeCast.UpdateNodeDisplay();
                    }
                }
            }
        }