////////////////////////////////////////////////////////////////////////////
		// Tab Context Menu
		
		void SetDeletedState(SideTabItem item)
		{
			if (item != null) {
				SetDeletedState(item.CanBeDeleted);
			} else {
				SetDeletedState(false);
			}
		}
Beispiel #2
0
			protected override object StartItemDrag(SideTabItem draggedItem)
			{
				if (this.ActiveTab.ChosenItem != draggedItem && this.ActiveTab.Items.Contains(draggedItem)) {
					this.ActiveTab.ChosenItem = draggedItem;
				}
				
				if (draggedItem.Tag != null) {
					return new System.Windows.DataObject(draggedItem.Tag);
				}
				else {
					return new System.Windows.DataObject();
				}
			}
		protected override object StartItemDrag(SideTabItem draggedItem)
		{
			if (this.ActiveTab.ChoosedItem != draggedItem && this.ActiveTab.Items.Contains(draggedItem)) {
				this.ActiveTab.ChoosedItem = draggedItem;
			}
			var dataObject = new System.Windows.DataObject();
			dataObject.SetText(draggedItem.Tag.ToString());
			return dataObject;
		}
		void SetRenameState(SideTabItem item)
		{
			if (item != null) {
				SetRenameState(item.CanBeRenamed);
			} else {
				SetRenameState(false);
			}
		}
Beispiel #5
0
		protected override object StartItemDrag(SideTabItem draggedItem)
		{
			if (ActiveTab.ChoosedItem != draggedItem && ActiveTab.Items.Contains(draggedItem))
			{
				ActiveTab.ChoosedItem = draggedItem;
			}
			return new System.Windows.DataObject(draggedItem.Tag);
		}
Beispiel #6
0
            protected override void OnDragOver(DragEventArgs e)
            {
                base.OnDragOver(e);
                sideBar.ExitRenameMode();
                Point p = PointToClient(new Point(e.X, e.Y));

                if (e.Data.GetDataPresent(typeof(SideTabItem)))
                {
                    // drag move item inside the activeTabMembarArea
                    if (sideBar.activeTab.CanDragDrop)
                    {
                        SideTabItem item = sideBar.activeTab.GetItemAt(p.X, p.Y);
                        if (item == null)
                        {
                            sideBar.ClearDraggings(sideBar.activeTab);
                            sideBar.Refresh();
                        }
                        else
                        if (item != sideBar.activeTab.ChosenItem)
                        {
                            if (item.SideTabItemStatus != SideTabItemStatus.Drag)
                            {
                                sideBar.ClearDraggings(sideBar.activeTab);
                                item.SideTabItemStatus   = SideTabItemStatus.Drag;
                                sideBar.Tabs.DragOverTab = sideBar.activeTab;
                                sideBar.Refresh();
                            }
                        }
                        else
                        {
                            sideBar.ClearDraggings(sideBar.activeTab);
                            sideBar.activeTab.SideTabStatus = SideTabStatus.Dragged;
                            sideBar.Refresh();
                        }

                        e.Effect = GetDragDropEffect(e);
                    }
                    else
                    {
                        e.Effect = DragDropEffects.None;
                    }
                }
                else if (e.Data.GetDataPresent(typeof(string)))
                {
                    if (sideBar.activeTab != sideBar.Tabs.DragOverTab)
                    {
                        sideBar.Tabs.DragOverTab = sideBar.activeTab;
                        sideBar.Refresh();
                    }
                }

                //			else if (e.Data.GetDataPresent(typeof(SideTab))) {
                //				int tabIndex = GetTabIndexAt(p.X, p.Y);
                //				if (tabIndex != -1) {
                //					SideTab tab = Tabs.DragOverTab;
                //					Tabs.Remove(tab);
                //					Tabs.Insert(tabIndex, tab);
                //					Refresh();
                //				}
                //				e.Effect = DragDropEffects.Move;
                //			}
            }
Beispiel #7
0
 public SideTabItemExchangeEventArgs(SideTabItem item1, SideTabItem item2)
 {
     this.item1 = item1;
     this.item2 = item2;
 }
Beispiel #8
0
 public SideTabItemEventArgs(SideTabItem item)
 {
     this.item = item;
 }