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


C# DragOperation类代码示例

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


DragOperation类属于命名空间,在下文中一共展示了DragOperation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PinboardControl

        public PinboardControl()
        {
            InitializeComponent();

            bufferContext = new BufferedGraphicsContext();
            SizeGraphicsBuffer();
            SetStyle(ControlStyles.OptimizedDoubleBuffer, false);
            SetStyle(ControlStyles.DoubleBuffer, false);

            dragOp = DragOperation.None;
            nextRectNum = 0;
        }
开发者ID:dellis1972,项目名称:XnaBuildContent,代码行数:12,代码来源:PinboardControl.cs

示例2: CanDropNode

		public override bool CanDropNode (object dataObject, DragOperation operation)
		{
			return (dataObject is SolutionItem && ((ProjectFile) CurrentNode.DataItem).DependsOnFile == null);
		}
开发者ID:techsaint,项目名称:monodevelop,代码行数:4,代码来源:ProjectFileNodeBuilder.cs

示例3: CanDropNode

		public override bool CanDropNode (object dataObject, DragOperation operation)
		{
			return (dataObject is SolutionItem) || (dataObject is IFileItem);
		}
开发者ID:nomit007,项目名称:monodevelop,代码行数:4,代码来源:SolutionNodeBuilder.cs

示例4: CanDropNode

		// Currently only accepts packages and projects that compile into a static library
		public override bool CanDropNode (object dataObject, DragOperation operation)
		{
			if (dataObject is Package)
				return true;
			
			if (dataObject is CProject) {
				CProject project = (CProject)dataObject;
				
				if (((ProjectPackageCollection)CurrentNode.DataItem).Project.Equals (project))
					return false;
				
				CProjectConfiguration config = (CProjectConfiguration)project.GetConfiguration (IdeApp.Workspace.ActiveConfiguration);
				
				if (config.CompileTarget != CBinding.CompileTarget.Bin)
					return true;
			}
			
			return false;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:20,代码来源:ProjectPackagesFolderNodeBuilder.cs

示例5: CanDropNode

		public override bool CanDropNode (object dataObject, DragOperation operation)
		{
			return dataObject is ProjectReference || dataObject is Project;
		}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:4,代码来源:ProjectReferenceFolderNodeBuilder.cs

示例6: OnMultipleNodeDrop

		public virtual void OnMultipleNodeDrop (object[] dataObjects, DragOperation operation, DropPosition position)
		{
			cachedPosition = position;
			OnMultipleNodeDrop (dataObjects, operation);
		}
开发者ID:nieve,项目名称:monodevelop,代码行数:5,代码来源:NodeCommandHandler.cs

示例7: OnNodeDrop

		public virtual void OnNodeDrop (object dataObjects, DragOperation operation, DropPosition position)
		{
			OnNodeDrop (dataObjects, operation);
		}
开发者ID:nieve,项目名称:monodevelop,代码行数:4,代码来源:NodeCommandHandler.cs

示例8: CanDropNode

		public override bool CanDropNode (object dataObject, DragOperation operation)
		{
			if (operation == DragOperation.Move) {
				WorkspaceItem it = dataObject as WorkspaceItem;
				if (it != null) {
					Workspace ws = (Workspace) CurrentNode.DataItem;
					return it != ws && !ws.Items.Contains (it);
				}
			}
			return false;
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:11,代码来源:WorkspaceNodeBuilder.cs

示例9: OnMultipleNodeDrop

		public override void OnMultipleNodeDrop (object[] dataObjects, DragOperation operation, DropPosition pos)
		{
			DotNetProject p = (DotNetProject) CurrentNode.GetParentDataItem (typeof(Project), false);
			AddinData adata = p.GetAddinData ();
			
			ExtensionNodeInfo en = (ExtensionNodeInfo) CurrentNode.DataItem;

			foreach (ExtensionNodeInfo newNode in dataObjects) {
				if (newNode.Node.Parent is ExtensionNodeDescription)
					((ExtensionNodeDescription)newNode.Node.Parent).ChildNodes.Remove (en.Node);
				else
					((Extension)newNode.Node.Parent).ExtensionNodes.Remove (newNode.Node);
				InsertNode (adata, en, pos, newNode.Node);
				
				// Add all other nodes after the first node
				en = newNode;
				pos = DropPosition.After;
			}
			
			adata.CachedAddinManifest.Save ();
			adata.NotifyChanged (false);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:22,代码来源:ExtensionNodeNodeBuilder.cs

示例10: CanDropNode

		public override bool CanDropNode (object dataObject, DragOperation operation, DropPosition pos)
		{
			object parent1 = CurrentNode.GetParentDataItem (typeof(Extension), false);
			if (parent1 == null)
				parent1 = CurrentNode.GetParentDataItem (typeof(ExtensionPoint), false);
			
			ITreeNavigator nav = CurrentNode.Clone ();
			if (!nav.MoveToObject (dataObject))
				return false;
			object parent2 = nav.GetParentDataItem (parent1.GetType (), false);
			if (parent2 != parent1)
				return false;
			
			return true;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:15,代码来源:ExtensionNodeNodeBuilder.cs

示例11: OnNodeDrop

        public override void OnNodeDrop(object dataObject, DragOperation operation)
        {
            string targetPath = GetFolderPath (CurrentNode.DataItem);
            string what, source, where, how;
            Project targetProject = (Project) CurrentNode.GetParentDataItem (typeof(Project), true);
            Project sourceProject;

            bool ask;
            if (operation == DragOperation.Move)
                how = GettextCatalog.GetString ("move");
            else
                how = GettextCatalog.GetString ("copy");

            if (dataObject is ProjectFolder) {
                source = ((ProjectFolder) dataObject).Path;
                sourceProject = ((ProjectFolder) dataObject).Project;
                what = string.Format (GettextCatalog.GetString ("the folder '{0}'"), Path.GetFileName(source));
                ask = true;
            }
            else if (dataObject is ProjectFile) {
                source = ((ProjectFile)dataObject).Name;
                sourceProject = ((ProjectFile) dataObject).Project;
                what = string.Format (GettextCatalog.GetString ("the file '{0}'"), Path.GetFileName(source));
                ask = false;
            } else {
                return;
            }

            if (targetPath == targetProject.BaseDirectory)
                where = string.Format (GettextCatalog.GetString ("root folder of project '{0}'"), targetProject.Name);
            else
                where = string.Format (GettextCatalog.GetString ("folder '{0}'"), Path.GetFileName (targetPath));

            if (ask) {
                if (!Runtime.MessageService.AskQuestion (String.Format (GettextCatalog.GetString ("Do you really want to {0} {1} to {2}?"), how, what, where)))
                    return;
            }

            using (IProgressMonitor monitor = Runtime.TaskService.GetStatusProgressMonitor (GettextCatalog.GetString("Copying files ..."), Stock.CopyIcon, true))
            {
                bool move = operation == DragOperation.Move;
                Runtime.ProjectService.TransferFiles (monitor, sourceProject, source, targetProject, targetPath, move, false);
            }
            Runtime.ProjectService.SaveCombine();
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:45,代码来源:FolderNodeBuilder.cs

示例12: CanDropNode

        public override bool CanDropNode(object dataObject, DragOperation operation)
        {
            string targetPath = GetFolderPath (CurrentNode.DataItem);

            if (dataObject is ProjectFile)
                return Path.GetDirectoryName (((ProjectFile)dataObject).Name) != targetPath;
            if (dataObject is ProjectFolder)
                return ((ProjectFolder)dataObject).Path != targetPath;
            return false;
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:10,代码来源:FolderNodeBuilder.cs

示例13: DropFile

		internal static void DropFile (SolutionFolder folder, IFileItem fileItem, DragOperation operation)
		{
			FilePath dest = folder.BaseDirectory.Combine (fileItem.FileName.FileName);
			if (operation == DragOperation.Copy)
				FileService.CopyFile (fileItem.FileName, dest);
			else
				FileService.MoveFile (fileItem.FileName, dest);
			folder.Files.Add (dest);
		}
开发者ID:nieve,项目名称:monodevelop,代码行数:9,代码来源:SolutionFolderNodeBuilder.cs

示例14: OnNodeDrop

		public override void OnNodeDrop (object dataObject, DragOperation operation)
		{
			SolutionFolder folder = (SolutionFolder) CurrentNode.DataItem;
			if (dataObject is SolutionItem) {
				SolutionItem it = (SolutionItem) dataObject;
				if (!MessageService.Confirm (GettextCatalog.GetString ("Are you sure you want to move the item '{0}' to the solution folder '{1}'?", it.Name, folder.Name), AlertButton.Move))
					return;
	
				// If the items belongs to another folder, it will be automatically removed from it
				folder.Items.Add (it);
			}
			else {
				DropFile (folder, (IFileItem) dataObject, operation);
			}
			
		    IdeApp.ProjectOperations.Save (folder.ParentSolution);
		}
开发者ID:nieve,项目名称:monodevelop,代码行数:17,代码来源:SolutionFolderNodeBuilder.cs

示例15: CanDropMultipleNodes

		public virtual bool CanDropMultipleNodes (object[] dataObjects, DragOperation operation, DropPosition position)
		{
			cachedPosition = position;
			return CanDropMultipleNodes (dataObjects, operation);
		}
开发者ID:nieve,项目名称:monodevelop,代码行数:5,代码来源:NodeCommandHandler.cs


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