BExplorer.Shell.ShellView.Do_Copy_OR_Move_Helper_2 C# (CSharp) Method

Do_Copy_OR_Move_Helper_2() private method

private Do_Copy_OR_Move_Helper_2 ( Boolean copy, IListItemEx destination, System.Windows.Forms dataObject ) : void
copy Boolean
destination IListItemEx
dataObject System.Windows.Forms
return void
    private void Do_Copy_OR_Move_Helper_2(Boolean copy, IListItemEx destination, F.IDataObject dataObject) {
      IntPtr handle = this.Handle;
      IShellItemArray shellItemArray = null;
      IShellItem[] items = null;

      if (((F.DataObject)dataObject).ContainsFileDropList()) {
        items = ((F.DataObject)dataObject).GetFileDropList().OfType<String>().Select(s => ShellItem.ToShellParsingName(s).ComInterface).ToArray();
      } else {
        shellItemArray = dataObject.ToShellItemArray();
        items = shellItemArray.ToArray();
      }
      var thread = new Thread(() => {
        try {
          var fo = new IIFileOperation(handle);
          foreach (var item in items) {
            if (copy)
              fo.CopyItem(item, destination);
            else
              fo.MoveItem(item, destination, null);
          }

          fo.PerformOperations();
        } catch (SecurityException) {
          throw;
        }
      });

      thread.SetApartmentState(ApartmentState.STA);
      thread.Start();
    }
ShellView