public void RemoveImport(string targetPath)
 {
     GuiSyncDispatch(() => {
         string relativeTargetPath = GetRelativePath(targetPath);
         project.RemoveImport(relativeTargetPath);
         RemoveImportWithForwardSlashes(targetPath);
         project.Save();
     });
 }
        public void RemoveImport(string targetPath)
        {
            GuiSyncDispatch(() => {
                string relativeTargetPath = GetRelativePath(targetPath);
                project.RemoveImport(relativeTargetPath);
                RemoveImportWithForwardSlashes(targetPath);

                using (var updater = new EnsureNuGetPackageBuildImportsTargetUpdater()) {
                    updater.RemoveImport(relativeTargetPath);
                    project.DisposeProjectBuilder();
                    project.Save();
                }
            });
        }
        public void RemoveImport(string targetFullPath)
        {
            GuiSyncDispatch(async() => {
                string relativeTargetPath = GetRelativePath(targetFullPath);
                project.RemoveImport(relativeTargetPath);
                RemoveImportWithForwardSlashes(targetFullPath);

                using (var updater = new EnsureNuGetPackageBuildImportsTargetUpdater()) {
                    updater.RemoveImport(relativeTargetPath);
                    await project.SaveAsync();
                }

                packageManagementEvents.OnImportRemoved(project, relativeTargetPath);
            });
        }
Beispiel #4
0
        void RemoveImportWithForwardSlashes(string targetPath)
        {
            string relativeTargetPath = FileService.AbsoluteToRelativePath(project.BaseDirectory, targetPath);

            if (Path.DirectorySeparatorChar == '\\')
            {
                relativeTargetPath = relativeTargetPath.Replace('\\', '/');
            }
            project.RemoveImport(relativeTargetPath);
        }