private void OnStartBuilding(object sender, StartBuildingEventArgs e) { if (e.ProjectFiles == null) { return; } String buildState = e.Rebuild == false ? "Build" : (e.Rebuild == true ? "Rebuild" : "Clean"); String msg = String.Join("\n", e.ProjectFiles); MessageBox.Show(String.Format("BuildState : {0};\nBuildProjects:\n{1}", buildState, msg), "Building", MessageBoxButton.OK); // 模拟编译操作 ThreadPool.QueueUserWorkItem(this.SimulateBuildWork, e.ProjectFiles); }
public void BuildProjects(List <String> projectFiles, bool?rebuild) { if (this.StartBuilding == null) { return; } if (projectFiles == null || projectFiles.Count <= 0) { return; } // 开始编译 this.IsBuilding = true; StartBuildingEventArgs args = new StartBuildingEventArgs(rebuild); foreach (String item in projectFiles) { args.Add(item); } this.StartBuilding.Invoke(this, args); }