Example #1
0
        internal void InvokeDragEvent(DragEventType eventType, DragEventArgs dragEvent)
        {
            switch (eventType)
            {
                case DragEventType.Enter:
                    this.OnDragEnter(dragEvent);
                    break;

                case DragEventType.Leave:
                    this.OnDragLeave(EventArgs.Empty);
                    break;

                case DragEventType.Drop:
                    this.OnDragDrop(dragEvent);
                    break;

                case DragEventType.Over:
                    this.OnDragOver(dragEvent);
                    break;

                case DragEventType.Hover:
                    this.OnDragHover(dragEvent);
                    break;
            }
        }
Example #2
0
			void IBranch.OnDragEvent(object sender, int row, int column, DragEventType eventType, DragEventArgs args)
			{
				switch (eventType)
				{
					case DragEventType.Drop:
					case DragEventType.Enter:
						IDataObject data = args.Data;
						if (data.GetDataPresent(typeof(Diagram)))
						{
							// A single diagram
							Diagram rowDiagram = myDiagrams[row];
							Diagram sourceDiagram = (Diagram)data.GetData(typeof(Diagram));
							if (null != sourceDiagram &&
								rowDiagram != sourceDiagram &&
								rowDiagram.Partition == sourceDiagram.Partition)
							{
								if (eventType == DragEventType.Drop)
								{
									MoveDiagramTo(sourceDiagram, row);
								}
								else
								{
									args.Effect = DragDropEffects.Move;
								}
							}
						}
						else if (data.GetDataPresent(typeof(VirtualTreeStartDragData[])))
						{
							Diagram rowDiagram = myDiagrams[row];
							Partition verifyPartition = rowDiagram.Partition;
							VirtualTreeStartDragData[] sourceDragDataItems = (VirtualTreeStartDragData[])data.GetData(typeof(VirtualTreeStartDragData[]));
							Diagram[] dropDiagrams = null;
							bool doDrop = eventType == DragEventType.Drop;
							for (int i = 0; i < sourceDragDataItems.Length; ++i)
							{
								IDataObject sourceData;
								Diagram sourceDiagram;
								if (null == (sourceData = sourceDragDataItems[i].Data as IDataObject) ||
									!sourceData.GetDataPresent(typeof(Diagram)) ||
									null == (sourceDiagram = (Diagram)sourceData.GetData(typeof(Diagram))) ||
									rowDiagram == sourceDiagram ||
									verifyPartition != sourceDiagram.Partition)
								{
									args.Effect = DragDropEffects.None;
									return;
								}
								else if (doDrop)
								{
									(dropDiagrams ?? (dropDiagrams = new Diagram[sourceDragDataItems.Length]))[i] = sourceDiagram;
								}
							}
							if (doDrop)
							{
								MoveDiagramsTo(dropDiagrams, row);
							}
							else
							{
								args.Effect = DragDropEffects.Move;
							}
						}
						break;
				}
			}
 /// <summary>
 ///     IBranch interface implementation.
 /// </summary>
 public virtual void /* IBranch */ OnDragEvent(object sender, int row, int column, DragEventType eventType, DragEventArgs args)
 {
 }
Example #4
0
 /// <summary>
 ///     IBranch interface implementation.
 /// </summary>
 public void OnDragEvent(object sender, int row, int column, DragEventType eventType, DragEventArgs args)
 {
 }
			void IBranch.OnDragEvent(object sender, int row, int column, DragEventType eventType, System.Windows.Forms.DragEventArgs args)
			{
			}
 void IBranch.OnDragEvent(object sender, int row, int column, DragEventType eventType, DragEventArgs args)
 {
     var branch = FindBranchForRow(ref row);
     branch.OnDragEvent(sender, row, column, eventType, args);
 }
 private void ForwardDragEvent(DragEventType dragType, DragEventArgs args)
 {
     var info = myTree.GetItemInfo(myDropRow, myDropColumn, false);
     info.Branch.OnDragEvent(this, info.Row, info.Column, dragType, args);
 }
Example #8
0
			void IBranch.OnDragEvent(object sender, int row, int column, DragEventType eventType, DragEventArgs args)
			{
				BranchPartitionSection section;
				row = TranslateRow(row, out section);
				if (row == -1)
				{
					args.Effect = DragDropEffects.None;
				}
				myInnerBranch.OnDragEvent(sender, row, column, eventType, args);
			}