public int OnItemAdded(uint itemidParent, uint itemidSiblingPrev, uint itemidAdded)
        {
            object addedItemObject;
            if (Hierarchy.GetProperty(itemidAdded, (int)__VSHPROPID.VSHPROPID_ExtObject, out addedItemObject) == VSConstants.S_OK)
            {
                EnvDTE.ProjectItem projectItem = addedItemObject as EnvDTE.ProjectItem;
                if (projectItem != null)
                {
                    if (projectItem.Kind == EnvDTE.Constants.vsProjectItemKindPhysicalFile)
                    {
                        LocatorProjectItem item = new LocatorProjectItem();
                        item.Name = projectItem.Name;
                        item.Path = Utils.PathRelativeTo(projectItem.FileNames[0], projectItem.ContainingProject.FullName);
                        item.Item = projectItem;
                        item.ItemId = itemidAdded;
                        item.Image = GetProjectItemImage(Hierarchy, itemidAdded);
                        lock (Items)
                        {
                            Items.Add(item);
                        }
                    }
                }
            }

            return VSConstants.S_OK;
        }
        private void ProcessHierarchy(uint itemId, IVsHierarchy hierarchy)
        {
            if (hierarchy == null || CancelProjectLoad)
                return;

            object obj;
            int result = hierarchy.GetProperty(itemId, (int)__VSHPROPID.VSHPROPID_ExtObject, out obj);
            if (result == VSConstants.S_OK)
            {
                EnvDTE.ProjectItem projectItem = obj as EnvDTE.ProjectItem;
                if (projectItem != null)
                {
                    if (projectItem.Kind == EnvDTE.Constants.vsProjectItemKindPhysicalFile)
                    {
                        LocatorProjectItem item = new LocatorProjectItem();
                        item.Name = projectItem.Name;
                        item.Path = Utils.PathRelativeTo(projectItem.FileNames[0], projectItem.ContainingProject.FullName);
                        item.Item = projectItem;
                        item.ItemId = itemId;
                        item.Image = GetProjectItemImage(hierarchy, itemId);
                        Items.Add(item);
                    }
                }
            }

            // Recursively process children, depth first.
            result = hierarchy.GetProperty(itemId, (int)__VSHPROPID.VSHPROPID_FirstVisibleChild, out obj);
            if (result == VSConstants.S_OK)
            {
                uint childId = (uint)(Int32)obj;
                while (childId != VSConstants.VSITEMID_NIL)
                {
                    ProcessHierarchy(childId, hierarchy);

                    result = hierarchy.GetProperty(childId, (int)__VSHPROPID.VSHPROPID_NextVisibleSibling, out obj);
                    if (result == VSConstants.S_OK)
                    {
                        childId = (uint)(Int32)obj;
                    }
                    else
                    {
                        break;
                    }
                }
            }
        }