private void BeginList() { uint slots; object o; var r = list.BeginList(out slots, ref GUID_IObjectArray, out o); if (r < 0) { throw Marshal.GetExceptionForHR(r); } var oa = (IObjectArray)o; uint count; oa.GetCount(out count); if (count > 0) { var removed = new List <IJumpItem>((int)count); var buffer = new StringBuilder(512); for (uint i = 0; i < count; ++i) { oa.GetAt(i, ref GUID_IUnknown, out o); if (o is Shortcut.IShellLink) { var link = (Shortcut.IShellLink)o; var title = JumpItemTask.GetTitle(link); string args = null; for (var j = tasks.Count - 1; j >= 0; --j) { var t = tasks[j]; if (t.Title == title) { if (args == null) { link.GetArguments(buffer, buffer.Capacity); args = buffer.ToString(); buffer.Length = 0; } if (Compare(t.Arguments, args)) { tasks.RemoveAt(j); removed.Add(t); break; } } } } //else if (o is Dialogs.FileDialogNative.IShellItem) //{ // var item = (Dialogs.FileDialogNative.IShellItem)o; //} } if (removed.Count > 0) { try { if (Removed != null) { Removed(this, removed); } } catch (Exception e) { Util.Logging.Log(e); } } } }