public static void InvalidateDragImage(System.Windows.IDataObject dataObject) { if (!dataObject.GetDataPresent("DragWindow")) return; Advent.Common.Interop.NativeMethods.PostMessage(DataObjectExtensions.GetIntPtrFromData(dataObject.GetData("DragWindow")), 1027U, IntPtr.Zero, IntPtr.Zero); }
private static bool IsShowingLayered(System.Windows.IDataObject dataObject) { if (dataObject.GetDataPresent("IsShowingLayered", true)) { object data = dataObject.GetData("IsShowingLayered"); if (data != null) return DataObjectExtensions.GetBooleanFromData(data); } return false; }
static bool DoEnablePaste(ISolutionFolder container, System.Windows.IDataObject dataObject) { if (dataObject == null) { return false; } if (dataObject.GetDataPresent(typeof(ISolutionItem).ToString())) { Guid guid = Guid.Parse(dataObject.GetData(typeof(ISolutionItem).ToString()).ToString()); ISolutionItem solutionItem = container.ParentSolution.GetItemByGuid(guid); if (solutionItem == null || solutionItem == container) return false; if (solutionItem is ISolutionFolder) { return solutionItem.ParentFolder != container && !((ISolutionFolder)solutionItem).IsAncestorOf(container); } else { return solutionItem.ParentFolder != container; } } return false; }
/// <summary> /// Determines whether [is project item dragged] [the specified i data object]. /// </summary> /// <param name="iDataObject">The i data object.</param> public bool IsProjectItemDragged(System.Windows.Forms.IDataObject iDataObject) { return iDataObject.GetDataPresent(ProjectItemReferenceFormat); }
/// <summary> /// Determines whether [is project dragged] [the specified data]. /// </summary> /// <param name="data">The data object.</param> /// <returns> /// <c>true</c> if [is project dragged] [the specified data]; otherwise, <c>false</c>. /// </returns> public bool IsProjectDragged(System.Windows.Forms.IDataObject data) { return data.GetDataPresent(ProjectReferenceFormat); }
/// <summary> /// Gets the project item dropped. /// </summary> /// <param name="data">The data.</param> /// <returns></returns> public HierarchyNode GetProjectItemDropped(System.Windows.Forms.IDataObject data) { string[] infos = DeserializeData(data, ProjectItemReferenceFormat); string fileName = null; if (infos != null) fileName = infos[2]; else if (data.GetDataPresent("Text")) fileName = (string)data.GetData("Text"); if (fileName != null) return CurrentSolution.RecursiveFindByPath(fileName); return null; }
public static bool CanDecode(System.Windows.IDataObject data) { return data.GetDataPresent(FileGroupDescriptorW) && data.GetDataPresent(FileContents); }