Microsoft.VisualStudio.Project.ProjectElement.RefreshProperties C# (CSharp) Method

RefreshProperties() public method

Reevaluate all properties for the current item This should be call if you believe the property for this item may have changed since it was created/refreshed, or global properties this items depends on have changed. Be aware that there is a perf cost in calling this function.
public RefreshProperties ( ) : void
return void
        public void RefreshProperties()
        {
            if (HasItemBeenDeleted)
                throw new InvalidOperationException("The item has been deleted.");

            if(this.IsVirtual)
                return;

            ProjectManager.BuildProject.ReevaluateIfNecessary();

            IEnumerable<ProjectItem> items = ProjectManager.BuildProject.GetItems(Item.ItemType);
            foreach (ProjectItem projectItem in items)
            {
                if(projectItem!= null && projectItem.EvaluatedInclude.Equals(Item.EvaluatedInclude))
                {
                    item = projectItem;
                    return;
                }
            }
        }