Beispiel #1
0
        internal static ToolObjectList MoveTool(Tools form, ObjectListUtil.Movement move, ToolObjectList toolObjectList)
        {
            TreeView toolTreeView = form.toolTreeView;

            TreeNode   selectedNode      = toolTreeView.SelectedNode;
            int        selectedNodeIndex = toolTreeView.SelectedNode.Index;
            ToolObject toolObject        = (ToolObject)toolObjectList[selectedNodeIndex];

            return((ToolObjectList)ObjectListUtil.MoveObject(move, toolObjectList, toolObject, toolTreeView, selectedNode, selectedNodeIndex));
        }
Beispiel #2
0
        internal static ExtensionObjectList MoveExtension(Extensions form, ObjectListUtil.Movement move, ExtensionObjectList extensionObjectList)
        {
            TreeView extensionTreeView = form.extensionTreeView;

            TreeNode        selectedNode      = extensionTreeView.SelectedNode;
            int             selectedNodeIndex = extensionTreeView.SelectedNode.Index;
            ExtensionObject extensionObject   = (ExtensionObject)extensionObjectList[selectedNodeIndex];

            return((ExtensionObjectList)ObjectListUtil.MoveObject(move, extensionObjectList, extensionObject, extensionTreeView, selectedNode, selectedNodeIndex));
        }
Beispiel #3
0
        internal static TemplateObjectList MoveTemplate(Templates form, ObjectListUtil.Movement move, TemplateObjectList templateObjectList)
        {
            TreeView templateTreeView = form.templateTreeView;

            TreeNode       selectedNode      = templateTreeView.SelectedNode;
            int            selectedNodeIndex = templateTreeView.SelectedNode.Index;
            TemplateObject templateObject    = (TemplateObject)templateObjectList[selectedNodeIndex];

            return((TemplateObjectList)ObjectListUtil.MoveObject(move, templateObjectList, templateObject, templateTreeView, selectedNode, selectedNodeIndex));
        }
Beispiel #4
0
        internal static void MoveFavourite(Favourites form, Form1 form1, ObjectListUtil.Movement move)
        {
            ListBox favouritesListBox = form.favouritesListBox;
            Object  selectedItem      = favouritesListBox.SelectedItem;
            int     selectedItemIndex = favouritesListBox.SelectedIndex;

            favouritesListBox.Items.RemoveAt(selectedItemIndex);

            switch (move)
            {
            case ObjectListUtil.Movement.Up:
                favouritesListBox.Items.Insert(selectedItemIndex - 1, selectedItem);
                break;

            case ObjectListUtil.Movement.Down:
                favouritesListBox.Items.Insert(selectedItemIndex + 1, selectedItem);
                break;
            }

            favouritesListBox.SelectedItem = selectedItem;
            FileListManager.CreateFileFromListBox(form);
            FileListManager.LoadFavouriteFiles(form1, true);
        }