예제 #1
0
 public static void ItemRemoved(ProjectItem projectItem)
 {
     CopiedFiles.Remove(projectItem.FilenameAsRelativePath());
     //var startupProject = Infrastructure.Core.Instance.StartupProject;
     //var existingFile = startupProject.Combine(projectItem.FilenameAsRelativePath());
     //if (File.Exists(existingFile))
     //File.Delete(existingFile);
 }
예제 #2
0
        public static void Add(Project destination, ProjectItem projectItem)
        {
            if (!_relativeFilenames.Select(m => m.Name).Contains(projectItem.FilenameAsRelativePath()))
                _relativeFilenames.Add(new RelativeFile(projectItem.FilenameAsRelativePath()));

            var saveTo = destination.Combine(projectItem.FilenameAsRelativePath());
            Directory.CreateDirectory(Path.GetDirectoryName(saveTo));

            if (File.Exists(saveTo))
                File.Delete(saveTo);

            File.Copy(projectItem.FileNames[0], saveTo, true);
            if (File.GetAttributes(saveTo).HasFlag(FileAttributes.ReadOnly))
                File.SetAttributes(saveTo, File.GetAttributes(saveTo) & ~FileAttributes.ReadOnly);

            OutputWindow.Log(String.Format("Suctioning '{0}'", saveTo));
        }
예제 #3
0
        public static void Add(Project destination, ProjectItem projectItem)
        {
            if (!_relativeFilenames.Select(m => m.Name).Contains(projectItem.FilenameAsRelativePath()))
            {
                _relativeFilenames.Add(new RelativeFile(projectItem.FilenameAsRelativePath()));
            }

            var saveTo = destination.Combine(projectItem.FilenameAsRelativePath());

            Directory.CreateDirectory(Path.GetDirectoryName(saveTo));

            if (File.Exists(saveTo))
            {
                File.Delete(saveTo);
            }

            File.Copy(projectItem.FileNames[0], saveTo, true);
            if (File.GetAttributes(saveTo).HasFlag(FileAttributes.ReadOnly))
            {
                File.SetAttributes(saveTo, File.GetAttributes(saveTo) & ~FileAttributes.ReadOnly);
            }

            OutputWindow.Log(String.Format("Suctioning '{0}'", saveTo));
        }
예제 #4
0
        public static void ItemRenamed(ProjectItem projectItem, string oldName)
        {
            // Write the new file to disk and clean up the old.
            ItemAdded(projectItem);

            // Remove the old file, so we need to sub out the name name with the old.
            var oldRelativeFilePath = projectItem.FilenameAsRelativePath().Replace(Path.GetFileName(projectItem.FileNames[0]), oldName);

            CopiedFiles.Remove(oldRelativeFilePath);

            //var startupProject = Infrastructure.Core.Instance.StartupProject;
            //var existingFile = startupProject.Combine(projectItem.FilenameAsRelativePath());
            //var old = Path.Combine(Path.GetDirectoryName(existingFile), oldName);
            //if (File.Exists(old))
            //File.Delete(old);
        }
예제 #5
0
 public static void ItemRemoved(ProjectItem projectItem)
 {
     CopiedFiles.Remove(projectItem.FilenameAsRelativePath());
     //var startupProject = Infrastructure.Core.Instance.StartupProject;
     //var existingFile = startupProject.Combine(projectItem.FilenameAsRelativePath());
     //if (File.Exists(existingFile))
     //File.Delete(existingFile);
 }
예제 #6
0
        public static void ItemRenamed(ProjectItem projectItem, string oldName)
        {
            // Write the new file to disk and clean up the old.
            ItemAdded(projectItem);

            // Remove the old file, so we need to sub out the name name with the old.
            var oldRelativeFilePath = projectItem.FilenameAsRelativePath().Replace(Path.GetFileName(projectItem.FileNames[0]), oldName);
            CopiedFiles.Remove(oldRelativeFilePath);

            //var startupProject = Infrastructure.Core.Instance.StartupProject;
            //var existingFile = startupProject.Combine(projectItem.FilenameAsRelativePath());
            //var old = Path.Combine(Path.GetDirectoryName(existingFile), oldName);
            //if (File.Exists(old))
            //File.Delete(old);
        }