Beispiel #1
0
        public void Remove <T>(T item) where T : ProjectItem, new()
        {
            this._projectItemCache.Remove(item.Include);
            MSBuildItem element = this._project.GetAllItems(new string[]
            {
                item.Name
            }).FirstOrDefault((MSBuildItem x) => x.Include == item.Include);

            if (element != null)
            {
                element.Remove();
            }
        }
Beispiel #2
0
        public void Remove <T>(string include) where T : ProjectItem, new()
        {
            T      t    = Activator.CreateInstance <T>();
            string name = t.Name;

            this._projectItemCache.Remove(include);
            MSBuildItem element = this._project.GetAllItems(new string[]
            {
                name
            }).FirstOrDefault((MSBuildItem x) => x.Include == include);

            if (element != null)
            {
                element.Remove();
            }
        }