public void ToggleAlwaysCompile(Project project, string[] paths) { foreach (string path in paths) { bool isTarget = project.IsCompileTarget(path); project.SetCompileTarget(path, !isTarget); } if (project.MaxTargetsCount > 0) { while (project.CompileTargets.Count > project.MaxTargetsCount) { int len = project.CompileTargets.Count; string relPath = project.CompileTargets[0]; project.SetCompileTarget(relPath, false); if (project.CompileTargets.Count == len) // safety if path is not removed project.CompileTargets.RemoveAt(0); string path = project.GetAbsolutePath(relPath); OnProjectModified(new string[] { path }); } } project.Save(); OnProjectModified(paths); }
public void MoveReferences(Project project, string fromPath, string toPath) { if (project.IsCompileTarget(fromPath)) { project.SetCompileTarget(fromPath, false); project.SetCompileTarget(toPath, true); } if (project.IsLibraryAsset(fromPath)) { project.ChangeAssetPath(fromPath, toPath); } }
public void RemoveAllReferences(Project project, string path) { if (project.IsLibraryAsset(path)) project.SetLibraryAsset(path, false); if (project.IsCompileTarget(path)) project.SetCompileTarget(path, false); }
public void ToggleAlwaysCompile(Project project, string[] paths) { foreach (string path in paths) { bool isTarget = project.IsCompileTarget(path); project.SetCompileTarget(path, !isTarget); } if (project.MaxTargetsCount > 0) { while (project.CompileTargets.Count > project.MaxTargetsCount) { string relPath = project.CompileTargets[0]; string path = project.GetAbsolutePath(relPath); project.SetCompileTarget(path, false); OnProjectModified(new string[] { path }); } } project.Save(); OnProjectModified(paths); }