コード例 #1
0
ファイル: DataObjectExtensions.cs プロジェクト: kingpin2k/MCS
 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);
 }
コード例 #2
0
ファイル: DataObjectExtensions.cs プロジェクト: kingpin2k/MCS
 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;
 }
コード例 #3
0
		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;
		}
コード例 #4
0
 /// <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);
 }
コード例 #5
0
 /// <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);
 }
コード例 #6
0
 /// <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;
 }
コード例 #7
0
 public static bool CanDecode(System.Windows.IDataObject data)
 {
     return data.GetDataPresent(FileGroupDescriptorW) && data.GetDataPresent(FileContents);
 }