Ejemplo n.º 1
0
        private void LoadBookmarks()
        {
            panelContent.Controls.Clear();
            SelectedBookmark = null;

            foreach (var bm in BookmarkStorage.Instance.bookmarks)
            {
                var ctrl = new BookmarkControl
                {
                    Bookmark         = bm,
                    ImageList        = imgList,
                    Parent           = panelContent,
                    AllowDrop        = true,
                    ContextMenuStrip = contextMenu
                };
                ctrl.DragEnter += CellDragEnter;
                ctrl.DragDrop  += CellDragDrop;
                ctrl.DragOver  += CellDragOver;
                ctrl.MouseDown += CellMouseDown;
                ctrl.Clicked   += CtrlOnClicked;
                ctrl.DragLeave += CellDragLeave;

                ctrl.CloseClicked += CtrlOnCloseClicked;
                ctrl.CalculateSize();
                panelContent.Controls.Add(ctrl);
            }

            ArrangeBookmarks(false);
            // выделить первую закладку
            SelectedBookmark = ((BookmarkControl)panelContent.Controls[0]).Bookmark;
        }
Ejemplo n.º 2
0
        private BookmarkControl AddBookmarkControl(TerminalBookmark bm, int left)
        {
            var btn = new BookmarkControl
            {
                Bookmark  = bm,
                ImageList = ImgList,
                Parent    = this,
                Left      = left,
                ModeEdit  = false
            };

            btn.Click += BtnOnClick;
            btn.CalculateSize();
            Controls.Add(btn);
            return(btn);
        }
Ejemplo n.º 3
0
        private void GoOnBookmark(BookmarkControl entering)
        {
            var leaving = (BookmarkControl)Controls[1];

            // перерисовать контролы
            for (var i = 1; i < Controls.Count; i++)
            {
                var btn        = (BookmarkControl)Controls[i];
                var isSelected = btn == entering;
                if (btn.Selected != isSelected)
                {
                    btn.Selected = isSelected;
                    if (!btn.Selected)
                    {
                        leaving = btn;
                    }
                    btn.Invalidate();
                }
            }

            // перейти на "вкладку"
            selectedTabChanged(leaving.Bookmark, entering.Bookmark);
        }
Ejemplo n.º 4
0
        private void GoOnBookmark(BookmarkControl entering)
        {
            var leaving = (BookmarkControl)Controls[1];

            // перерисовать контролы
            for (var i = 1; i < Controls.Count; i++)
            {
                var btn = (BookmarkControl)Controls[i];
                var isSelected = btn == entering;
                if (btn.Selected != isSelected)
                {
                    btn.Selected = isSelected;
                    if (!btn.Selected)
                        leaving = btn;
                    btn.Invalidate();
                }
            }

            // перейти на "вкладку"
            selectedTabChanged(leaving.Bookmark, entering.Bookmark);
        }
Ejemplo n.º 5
0
 private BookmarkControl AddBookmarkControl(TerminalBookmark bm, int left)
 {
     var btn = new BookmarkControl
         {
             Bookmark = bm,
             ImageList = ImgList,
             Parent = this,
             Left = left,
             ModeEdit = false
         };
     btn.Click += BtnOnClick;
     btn.CalculateSize();
     Controls.Add(btn);
     return btn;
 }
Ejemplo n.º 6
0
        private void LoadBookmarks()
        {
            panelContent.Controls.Clear();
            SelectedBookmark = null;

            foreach (var bm in BookmarkStorage.Instance.bookmarks)
            {
                var ctrl = new BookmarkControl
                    {
                        Bookmark = bm,
                        ImageList = imgList,
                        Parent = panelContent,
                        AllowDrop = true,
                        ContextMenuStrip = contextMenu
                    };
                ctrl.DragEnter += CellDragEnter;
                ctrl.DragDrop += CellDragDrop;
                ctrl.DragOver += CellDragOver;
                ctrl.MouseDown += CellMouseDown;
                ctrl.Clicked += CtrlOnClicked;
                ctrl.DragLeave += CellDragLeave;

                ctrl.CloseClicked += CtrlOnCloseClicked;
                ctrl.CalculateSize();
                panelContent.Controls.Add(ctrl);
            }

            ArrangeBookmarks(false);
            // выделить первую закладку
            SelectedBookmark = ((BookmarkControl)panelContent.Controls[0]).Bookmark;
        }