예제 #1
0
        private static List <_ShellObjectPair> GenerateJumpItems(IObjectArray shellObjects)
        {
            Debug.Assert(shellObjects != null);
            var retList    = new List <_ShellObjectPair>();
            var unknownIid = new Guid(IID.Unknown);
            var count      = shellObjects.GetCount();

            for (uint i = 0; i < count; ++i)
            {
                var      unk  = shellObjects.GetAt(i, ref unknownIid);
                JumpItem item = null;
                try
                {
                    item = GetJumpItemForShellObject(unk);
                }
                catch (Exception e)
                {
                    if (e is NullReferenceException || e is SEHException)
                    {
                        throw;
                    }
                }
                retList.Add(new _ShellObjectPair {
                    ShellObject = unk, JumpItem = item
                });
            }
            return(retList);
        }
예제 #2
0
        private static object GetShellObjectForJumpItem(JumpItem jumpItem)
        {
            var jumpPath = jumpItem as JumpPath;
            var jumpTask = jumpItem as JumpTask;

            if (jumpPath != null)
            {
                return(CreateItemFromJumpPath(jumpPath));
            }
            if (jumpTask != null)
            {
                return(CreateLinkFromJumpTask(jumpTask, true));
            }

            Debug.Assert(false);
            return(null);
        }