本文整理汇总了C#中DragDropEffects类的典型用法代码示例。如果您正苦于以下问题:C# DragDropEffects类的具体用法?C# DragDropEffects怎么用?C# DragDropEffects使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DragDropEffects类属于命名空间,在下文中一共展示了DragDropEffects类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Dropped
public void Dropped(IDropInfo dropInfo, DragDropEffects effects)
{
bool isCopy, isMove;
GuiHelper.ConvertDragDropEffectToCopyMove(effects, out isCopy, out isMove);
_projectBrowseControl._controller.FolderTree_DragEnded(isCopy, isMove);
}
示例2: FinishDrag
public override void FinishDrag(UIElement draggedElt, DragDropEffects finalEffects)
{
if ((finalEffects & DragDropEffects.Move) == DragDropEffects.Move)
{
(SourceUI as Canvas).Children.Remove(draggedElt);
}
}
示例3: DropNodeValidatingEventArgs
public DropNodeValidatingEventArgs(IDataObject data, int keyState, int x, int y, DragDropEffects allowedEffects, DragDropEffects effect, TreeNode sourceNode, TreeNode targetNode, NodePosition position)
:base (data, keyState, x, y, allowedEffects, effect)
{
SourceNode = sourceNode;
TargetNode = targetNode;
Position = position;
}
示例4: DragLeaveArgs
/// <summary>
/// Initializes a new instance of the <see cref="DragLeaveArgs" /> class.
/// </summary>
/// <param name="data">The data.</param>
/// <param name="keyStates">The key states.</param>
/// <param name="dropTarget">The drop target.</param>
/// <param name="allowedEffects">The allowed effects.</param>
public DragLeaveArgs( IDataObject data, DragDropKeyStates keyStates, Object dropTarget, DragDropEffects allowedEffects )
: base( data, keyStates, dropTarget )
{
Ensure.That( allowedEffects ).Named( "allowedEffects" ).IsTrue( v => v.IsDefined() );
this.AllowedEffects = allowedEffects;
}
示例5: DropSourceBehavior
internal DropSourceBehavior(ICollection dragComponents, Control source, Point initialMouseLocation)
{
this.serviceProviderSource = source.Site;
if (this.serviceProviderSource != null)
{
this.behaviorServiceSource = (BehaviorService) this.serviceProviderSource.GetService(typeof(BehaviorService));
if ((this.behaviorServiceSource != null) && ((dragComponents != null) && (dragComponents.Count > 0)))
{
this.srcHost = (IDesignerHost) this.serviceProviderSource.GetService(typeof(IDesignerHost));
if (this.srcHost != null)
{
this.data = new BehaviorDataObject(dragComponents, source, this);
this.allowedEffects = DragDropEffects.Move | DragDropEffects.Copy;
this.dragComponents = new DragComponent[dragComponents.Count];
this.parentGridSize = Size.Empty;
this.lastEffect = DragDropEffects.None;
this.lastFeedbackLocation = new Point(-1, -1);
this.lastSnapOffset = Point.Empty;
this.dragImageRect = Rectangle.Empty;
this.clearDragImageRect = Rectangle.Empty;
this.InitiateDrag(initialMouseLocation, dragComponents);
}
}
}
}
示例6: OnDropOnLayerListCtrl
/// <summary>
/// This method is called when the drag and drop operation is completed and
/// the item being dragged was dropped on the Rhino layer list control.
/// </summary>
public override bool OnDropOnLayerListCtrl(IWin32Window layerListCtrl, int layerIndex, DataObject data, DragDropEffects dropEffect, Point point)
{
SampleCsDragData dragData = GetSampleCsDragData(data);
if (null == dragData)
return false;
if (layerIndex < 0)
{
MessageBox.Show(
RhUtil.RhinoApp().MainWnd(),
"String \"" + dragData.DragString + "\" Dropped on layer list control, not on a layer",
"SampleCsDragDrop",
MessageBoxButtons.OK,
MessageBoxIcon.Information
);
}
else
{
MRhinoDoc doc = RhUtil.RhinoApp().ActiveDoc();
if (null != doc && layerIndex < doc.m_layer_table.LayerCount())
{
MessageBox.Show(
RhUtil.RhinoApp().MainWnd(),
"String \"" + dragData.DragString + "\" Dropped on layer \"" + doc.m_layer_table[layerIndex].m_name + "\"",
"SampleCsDragDrop",
MessageBoxButtons.OK,
MessageBoxIcon.Information
);
}
}
return true;
}
示例7: DragStartEventArgs
/// <summary>
/// Constructeur du descripteur d'événement
/// </summary>
/// <param name="allowedEffects">valeur initiale des effets possibles</param>
/// <param name="data">objet transitionnel de suivi de l'opération de glissement</param>
/// <param name="button">bouton lié au démarrage de l'opération de glissement</param>
/// <param name="location">coordonnées client de l'impact initial du bouton enfoncé</param>
/// <param name="cancel">valeur initiale de la propriété <see cref="Cancel"/></param>
public DragStartEventArgs( DragDropEffects allowedEffects, IDataObject data, MouseButtons button, Point location, bool cancel ) {
AllowedEffects = allowedEffects;
Data = data;
Button = button;
Location = location;
Cancel = cancel;
}
示例8: TreeDragFeedbackEventArgs
/// <summary>
/// Initializes a new instance of the TreeDragFeedbackEventArgs class.
/// </summary>
/// <param name="parentNode"></param>
/// <param name="insertPosition"></param>
public TreeDragFeedbackEventArgs(Node parentNode, int insertPosition, Node dragNode, DragDropEffects effect)
{
ParentNode = parentNode;
InsertPosition = insertPosition;
_DragNode = dragNode;
_Effect = effect;
}
示例9: FinishDrag
public void FinishDrag(UIElement draggedElt, DragDropEffects finalEffects)
{
//if ((finalEffects & DragDropEffects.Move) == DragDropEffects.Move)
//{
//TODO: should I have something here????
//}
}
示例10: DragEnter
/// <summary>
/// Notifies the DragDropHelper that the specified Control received
/// a DragEnter event.
/// </summary>
/// <param name="dropHelper">The DragDropHelper instance to notify.</param>
/// <param name="control">The Control the received the DragEnter event.</param>
/// <param name="data">The DataObject containing a drag image.</param>
/// <param name="cursorOffset">The current cursor's offset relative to the window.</param>
/// <param name="effect">The accepted drag drop effect.</param>
public static void DragEnter(this IDropTargetHelper dropHelper, Control control, System.Windows.Forms.IDataObject data,
Point cursorOffset, DragDropEffects effect) {
IntPtr controlHandle = IntPtr.Zero;
if (control != null)
controlHandle = control.Handle;
Win32Point pt = cursorOffset.ToWin32Point();
dropHelper.DragEnter(controlHandle, (ComIDataObject) data, ref pt, (int) effect);
}
示例11: DragHelper
public DragHelper(UIElement dragSource, IDataDropObjectProvider callback, UIElement dragScope)
{
this.allowedEffects = DragDropEffects.Copy | DragDropEffects.Move;
this.opacity = 0.7;
this.DragSource = dragSource;
this.Callback = callback;
this.DragScope = dragScope;
}
示例12: DragOverArgs
/// <summary>
/// Initializes a new instance of the <see cref="DragOverArgs" /> class.
/// </summary>
/// <param name="data">The data.</param>
/// <param name="keyStates">The key states.</param>
/// <param name="dropTarget">The drop target.</param>
/// <param name="allowedEffects">The allowed effects.</param>
/// <param name="position">The position.</param>
public DragOverArgs( IDataObject data, DragDropKeyStates keyStates, Object dropTarget, DragDropEffects allowedEffects, Point position )
: base( data, keyStates, dropTarget )
{
Ensure.That( allowedEffects ).Named( "allowedEffects" ).IsTrue( v => v.IsDefined() );
this.AllowedEffects = allowedEffects;
this.Position = position;
}
示例13: ProvideCopy
/// <summary>
/// Support only copy
/// </summary>
/// <param name="supportedEffects">Effects supported by the drag source</param>
/// <returns>Effets allowed by the drop target</returns>
protected DragDropEffects ProvideCopy(int keyState, DragDropEffects supportedEffects)
{
// allow only copy
if ((supportedEffects & DragDropEffects.Copy) > 0)
return DragDropEffects.Copy;
else
return DragDropEffects.None;
}
示例14: DragEnter
/// <summary>
/// Notifies the DragDropHelper that the specified Window received
/// a DragEnter event.
/// </summary>
/// <param name="dropHelper">The DragDropHelper instance to notify.</param>
/// <param name="window">The Window the received the DragEnter event.</param>
/// <param name="data">The DataObject containing a drag image.</param>
/// <param name="cursorOffset">The current cursor's offset relative to the window.</param>
/// <param name="effect">The accepted drag drop effect.</param>
public static void DragEnter(this IDropTargetHelper dropHelper, Window window, IDataObject data, Point cursorOffset, DragDropEffects effect)
{
IntPtr windowHandle = IntPtr.Zero;
if (window != null)
windowHandle = (new WindowInteropHelper(window)).Handle;
Win32Point pt = WpfDragDropLibExtensions.ToWin32Point(cursorOffset);
dropHelper.DragEnter(windowHandle, (ComIDataObject)data, ref pt, (int)effect);
}
示例15: FinishDrag
public void FinishDrag(UIElement draggedElement, Point location, DragDropEffects finalEffects)
{
ToolboxItem item = GetToolboxItem(draggedElement);
if (item != null)
{
item.IsBeingDragged = false;
}
}