本文整理汇总了C#中IDataObject.ToShellItemArray方法的典型用法代码示例。如果您正苦于以下问题:C# IDataObject.ToShellItemArray方法的具体用法?C# IDataObject.ToShellItemArray怎么用?C# IDataObject.ToShellItemArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDataObject
的用法示例。
在下文中一共展示了IDataObject.ToShellItemArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoMove
/// <summary>
/// Moves the selected items to the destination on a separate thread
/// </summary>
/// <param name="dataObject">Contains the items you want to moe</param>
/// <param name="destination">The place you want to move the items to</param>
private void DoMove(IDataObject dataObject, IListItemEx destination) {
var handle = this.Handle;
var thread = new Thread(() => {
IShellItem[] items =
dataObject.GetDataPresent("FileDrop") ?
items = ((F.DataObject)dataObject).GetFileDropList().OfType<String>().Select(s => FileSystemListItem.ToFileSystemItem(IntPtr.Zero, s.ToShellParsingName()).ComInterface).ToArray()
:
dataObject.ToShellItemArray().ToArray();
try {
var fo = new IIFileOperation(handle);
foreach (var item in items) {
fo.MoveItem(item, destination, null);
}
fo.PerformOperations();
}
catch (SecurityException) {
throw;
}
});
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
}