void NotifyFileRemovedFromProject(IEnumerable <ProjectFile> objs) { if (!objs.Any()) { return; } var args = new ProjectFileEventArgs(); foreach (ProjectFile file in objs) { file.SetProject(null); args.Add(new ProjectFileEventInfo(this, file)); if (DependencyResolutionEnabled) { unresolvedDeps.Remove(file); foreach (ProjectFile f in file.DependentChildren) { f.DependsOnFile = null; if (!string.IsNullOrEmpty(f.DependsOn)) { unresolvedDeps.Add(f); } } file.DependsOnFile = null; } } NotifyModified("Files"); OnFileRemovedFromProject(args); }
void NotifyFileAddedToProject(IEnumerable <ProjectFile> objs) { if (!objs.Any()) { return; } var args = new ProjectFileEventArgs(); foreach (ProjectFile file in objs) { if (file.Project != null) { throw new InvalidOperationException("ProjectFile already belongs to a project"); } file.SetProject(this); args.Add(new ProjectFileEventInfo(this, file)); ResolveDependencies(file); } NotifyModified("Files"); OnFileAddedToProject(args); }
void NotifyFileAddedToProject (IEnumerable<ProjectFile> objs) { if (!objs.Any ()) return; var args = new ProjectFileEventArgs (); foreach (ProjectFile file in objs) { if (file.Project != null) throw new InvalidOperationException ("ProjectFile already belongs to a project"); file.SetProject (this); args.Add (new ProjectFileEventInfo (this, file)); ResolveDependencies (file); } SetDirty (); NotifyModified ("Files"); OnFileAddedToProject (args); }
void NotifyFileRemovedFromProject (IEnumerable<ProjectFile> objs) { if (!objs.Any ()) return; var args = new ProjectFileEventArgs (); foreach (ProjectFile file in objs) { file.SetProject (null); args.Add (new ProjectFileEventInfo (this, file)); if (DependencyResolutionEnabled) { if (unresolvedDeps.Contains (file)) unresolvedDeps.Remove (file); foreach (ProjectFile f in file.DependentChildren) { f.DependsOnFile = null; if (!string.IsNullOrEmpty (f.DependsOn)) unresolvedDeps.Add (f); } file.DependsOnFile = null; } } SetDirty (); NotifyModified ("Files"); OnFileRemovedFromProject (args); }