BExplorer.Shell.ShellTreeViewEx.DoMove C# (CSharp) Method

DoMove() private method

Moves the selected items to the destination on a separate thread
private DoMove ( IDataObject dataObject, IListItemEx destination ) : void
dataObject IDataObject Contains the items you want to moe
destination IListItemEx The place you want to move the items to
return void
		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();
		}