本文整理汇总了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;
}
示例2: CanDropNode
public override bool CanDropNode (object dataObject, DragOperation operation)
{
return (dataObject is SolutionItem && ((ProjectFile) CurrentNode.DataItem).DependsOnFile == null);
}
示例3: CanDropNode
public override bool CanDropNode (object dataObject, DragOperation operation)
{
return (dataObject is SolutionItem) || (dataObject is IFileItem);
}
示例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;
}
示例5: CanDropNode
public override bool CanDropNode (object dataObject, DragOperation operation)
{
return dataObject is ProjectReference || dataObject is Project;
}
示例6: OnMultipleNodeDrop
public virtual void OnMultipleNodeDrop (object[] dataObjects, DragOperation operation, DropPosition position)
{
cachedPosition = position;
OnMultipleNodeDrop (dataObjects, operation);
}
示例7: OnNodeDrop
public virtual void OnNodeDrop (object dataObjects, DragOperation operation, DropPosition position)
{
OnNodeDrop (dataObjects, operation);
}
示例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;
}
示例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);
}
示例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;
}
示例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();
}
示例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;
}
示例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);
}
示例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);
}
示例15: CanDropMultipleNodes
public virtual bool CanDropMultipleNodes (object[] dataObjects, DragOperation operation, DropPosition position)
{
cachedPosition = position;
return CanDropMultipleNodes (dataObjects, operation);
}