public static void CloseDocuments(this IProductElement element, IUriReferenceService uriService, EnvDTE.Documents EnvDTEDocuments)
        {
            var documents = EnvDTEDocuments.OfType<EnvDTE.Document>();

            foreach (var referenceLink in element.References)
            {
                var item = default(IItemContainer);
                try
                {
                    item = uriService.ResolveUri<IItemContainer>(new Uri(referenceLink.Value));
                }
                catch { }

                if (item != null &&
                    item.Kind == ItemKind.Item &&
                    documents.Any (x => x.FullName == item.PhysicalPath))
                {
                    documents.First(x => x.FullName == item.PhysicalPath).Close(vsSaveChanges.vsSaveChangesYes);
                }
            }
        }