File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,31 @@ public bool IsCapabilityMatch(string capability)
8484 return hier . IsCapabilityMatch ( capability ) ;
8585 }
8686
87+ /// <summary>
88+ /// Tries to remove an attribute in the project file for the item.
89+ /// </summary>
90+ public Task < bool > RemoveAttributeAsync ( string name )
91+ {
92+ return RemoveAttributeAsync ( name , ProjectStorageType . ProjectFile ) ;
93+ }
94+
95+ /// <summary>
96+ /// Tries to remove an attribute in the project file for the item from the specified storage type.
97+ /// </summary>
98+ public async Task < bool > RemoveAttributeAsync ( string name , ProjectStorageType storageType )
99+ {
100+ await ThreadHelper . JoinableTaskFactory . SwitchToMainThreadAsync ( ) ;
101+ GetItemInfo ( out IVsHierarchy hierarchy , out _ , out _ ) ;
102+
103+ if ( hierarchy is IVsBuildPropertyStorage storage )
104+ {
105+ storage . RemoveProperty ( name , "" , ToPersistStorageType ( storageType ) ) ;
106+ return true ;
107+ }
108+
109+ return false ;
110+ }
111+
87112 /// <summary>
88113 /// Save the project if it's dirty.
89114 /// </summary>
You can’t perform that action at this time.
0 commit comments