public virtual void RemoveImport(string targetFullPath) { if (String.IsNullOrEmpty(targetFullPath)) { throw new ArgumentNullException(CommonResources.Argument_Cannot_Be_Null_Or_Empty, "targetPath"); } string relativeTargetPath = PathUtility.GetRelativePath(PathUtility.EnsureTrailingSlash(EnvDTEProjectUtility.GetFullPath(EnvDTEProject)), targetFullPath); EnvDTEProjectUtility.RemoveImportStatement(EnvDTEProject, relativeTargetPath); EnvDTEProjectUtility.Save(EnvDTEProject); // notify the project system of the change UpdateImportStamp(EnvDTEProject); }
public virtual void RemoveImport(string targetFullPath) { if (String.IsNullOrEmpty(targetFullPath)) { throw new ArgumentNullException(CommonResources.Argument_Cannot_Be_Null_Or_Empty, "targetPath"); } NuGetUIThreadHelper.JoinableTaskFactory.Run(async delegate { await NuGetUIThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); string relativeTargetPath = PathUtility.GetRelativePath(PathUtility.EnsureTrailingSlash(ProjectFullPath), targetFullPath); EnvDTEProjectUtility.RemoveImportStatement(EnvDTEProject, relativeTargetPath); EnvDTEProjectUtility.Save(EnvDTEProject); // notify the project system of the change UpdateImportStamp(EnvDTEProject); }); }