• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# DragDropEffects类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中DragDropEffects的典型用法代码示例。如果您正苦于以下问题:C# DragDropEffects类的具体用法?C# DragDropEffects怎么用?C# DragDropEffects使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DragDropEffects类属于命名空间,在下文中一共展示了DragDropEffects类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
			}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:7,代码来源:TreeView_DragHandler.cs


示例2: FinishDrag

 public override void FinishDrag(UIElement draggedElt, DragDropEffects finalEffects)
 {
     if ((finalEffects & DragDropEffects.Move) == DragDropEffects.Move)
     {
         (SourceUI as Canvas).Children.Remove(draggedElt);
     }
 }
开发者ID:atombender,项目名称:learning,代码行数:7,代码来源:CanvasDragDropAdvisor.cs


示例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;
		}
开发者ID:netgrim,项目名称:MapKit,代码行数:7,代码来源:DropNodeValidatingEventArgs.cs


示例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;
		}
开发者ID:micdenny,项目名称:Radical.Windows,代码行数:14,代码来源:DragLeaveArgs.cs


示例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);
             }
         }
     }
 }
开发者ID:Reegenerator,项目名称:Sample-CustomizeDatasetCS,代码行数:25,代码来源:DropSourceBehavior.cs


示例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;
        }
开发者ID:mcneel,项目名称:Rhino4Samples_DotNet,代码行数:37,代码来源:SampleCsDropTarget.cs


示例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;
 }
开发者ID:NicolasR,项目名称:Composants,代码行数:15,代码来源:DragDropCommon.cs


示例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;
 }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:12,代码来源:TreeDragFeedbackEventArgs.cs


示例9: FinishDrag

        public void FinishDrag(UIElement draggedElt, DragDropEffects finalEffects)
        {
            //if ((finalEffects & DragDropEffects.Move) == DragDropEffects.Move)
            //{
                //TODO: should I have something here????

            //}
        }
开发者ID:tablesmit,项目名称:FabTab,代码行数:8,代码来源:FabTabDragDropAdvisor.cs


示例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);
		}
开发者ID:hbaes,项目名称:updateSystem.NET,代码行数:17,代码来源:SwfDropTargetHelperExtensions.cs


示例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;
 }
开发者ID:cipjota,项目名称:Chronos,代码行数:8,代码来源:DragHelper.cs


示例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;
		}
开发者ID:micdenny,项目名称:Radical.Windows,代码行数:16,代码来源:DragOverArgs.cs


示例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;
 }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:13,代码来源:DataFormatHandler.cs


示例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);
 }
开发者ID:killbug2004,项目名称:WSProf,代码行数:17,代码来源:WpfDropTargetHelperExtensions.cs


示例15: FinishDrag

 public void FinishDrag(UIElement draggedElement, Point location, DragDropEffects finalEffects)
 {
     ToolboxItem item = GetToolboxItem(draggedElement);
     if (item != null)
     {
         item.IsBeingDragged = false;
     }
 }
开发者ID:Heliflyer,项目名称:helios,代码行数:8,代码来源:ToolboxDragAdvisor.cs


示例16: DragEventArgs

 /// <summary>
 /// Constructor with parameters</summary>
 /// <param name="data">System.Windows.Forms.IDataObject that contains the data associated with this event</param>
 /// <param name="keyState">Current state of the Shift, Ctrl, and Alt keys</param>
 /// <param name="x">X-coordinate of mouse pointer</param>
 /// <param name="y">Y-coordinate of mouse pointer</param>
 /// <param name="allowedEffect">>Drag and drop operations allowed by the originator (or source) of the drag and drop event</param>
 /// <param name="effect">Drag and drop operations allowed by the target of the drag and drop event</param>
 public DragEventArgs(object data, int keyState, int x, int y, DragDropEffects allowedEffect, DragDropEffects effect) { 
     this.data = data;
     this.keyState = keyState; 
     this.x = x; 
     this.y = y;
     this.allowedEffect = allowedEffect; 
     this.effect = effect;
 }
开发者ID:JanDeHud,项目名称:LevelEditor,代码行数:16,代码来源:DragEventArgs.cs


示例17: DragEventArgs

		public DragEventArgs(IDataObject data, int keyState, int x, int y, DragDropEffects allowedEffect, DragDropEffects effect) {
			this.x=x;
			this.y=y;
			this.keystate=keyState;
			this.allowed_effect=allowedEffect;	
			this.current_effect=effect;
			this.data_object=data;
		}
开发者ID:nagyist,项目名称:MonoMac.Windows.Form,代码行数:8,代码来源:DragEventArgs.cs


示例18: DragAdorner

 public DragAdorner(UIElement adornedElement, UIElement adornment, DragDropEffects effects = DragDropEffects.None)
   : base(adornedElement)
 {
   this.m_AdornerLayer = AdornerLayer.GetAdornerLayer(adornedElement);
   this.m_AdornerLayer.Add(this);
   this.m_Adornment = adornment;
   this.IsHitTestVisible = false;
   this.Effects = effects;
 }
开发者ID:DeadlyEmbrace,项目名称:gong-wpf-dragdrop,代码行数:9,代码来源:DragAdorner.cs


示例19: DoDragDropSelectedNodes

 public void DoDragDropSelectedNodes(DragDropEffects allowedEffects)
 {
     if (SelectedNodes.Count > 0)
     {
         TreeNodeAdv[] nodes = new TreeNodeAdv[SelectedNodes.Count];
         SelectedNodes.CopyTo(nodes, 0);
         DoDragDrop(nodes, allowedEffects);
     }
 }
开发者ID:redoz,项目名称:bitdiffer,代码行数:9,代码来源:TreeViewAdv.Input.cs


示例20: GetDragDropAction

		public static DragDropOption GetDragDropAction(DragDropEffects dragDropEffects)
		{
			DragDropOption action = DragDropOption.None;
			if ((dragDropEffects & DragDropEffects.Move) == DragDropEffects.Move)
				action |= DragDropOption.Move;
			if ((dragDropEffects & DragDropEffects.Copy) == DragDropEffects.Copy)
				action |= DragDropOption.Copy;
			return action;
		}
开发者ID:nhannd,项目名称:Xian,代码行数:9,代码来源:ConvertEnum.cs



注:本文中的DragDropEffects类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DragDropInfo类代码示例发布时间:2022-05-24
下一篇:
C# DragDropAction类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap