当前位置: 首页>>代码示例>>C#>>正文


C# DragDropEffects类代码示例

本文整理汇总了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);
			}
开发者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


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