コード例 #1
0
        private void ShortcutProperties(bool isNew = false)
        {
            _shorcutProperties = new FormShortcutProperties();
            DesktopComposer.Implementation.Shortcut shortcut;
            if (isNew)
            {
                shortcut = new DesktopComposer.Implementation.Shortcut
                {
                    MenuPath = NodeRelativePath(tvStartMenu.SelectedNode.FullPath, true)
                };
            }
            else
            {
                shortcut = GetShorcutFromNode();
            }

            if (_shorcutProperties.ShowDialog(shortcut) == DialogResult.OK)
            {
                if (isNew)
                {
                    _Shortcuts.Add(shortcut);
                    AddNode(shortcut);
                }
                else
                {
                    tvStartMenu.SelectedNode.Text = shortcut.DisplayName;
                    imlIcons.Images[imlIcons.Images.IndexOfKey(tvStartMenu.SelectedNode.ImageKey)] = shortcut.IconCacheSmall.ToBitmap();
                }
                InvokeDataChanged();
            }
        }
コード例 #2
0
        private void ShortcutProperties(bool isNew = false)
        {
            _shorcutProperties = new FormShortcutProperties();
            DesktopComposer.Implementation.Shortcut shortcut;
            if (isNew)
            {
                shortcut = new DesktopComposer.Implementation.Shortcut
                {
                    MenuPath = NodeRelativePath(tvStartMenu.SelectedNode.FullPath, true)
                };
            }
            else
            {
                shortcut = GetShorcutFromNode();
            }

            if (_shorcutProperties.ShowDialog(shortcut) == DialogResult.OK)
            {
                if (isNew)
                {
                    _Shortcuts.Add(shortcut);
                    AddNode(shortcut);
                }
                else
                {
                    //Update Node
                }
                InvokeDataChanged();
            }
        }