public void StartBuild(FilePackageGenerator.Context context) { BuildViewModel buildViewModel = new BuildViewModel(context); buildViewModel.CloseMode = _commandLine.IsGenerateMode ? CloseMode.AlwaysClose : CloseMode.CloseOnlyWhenSuccess; if (_commandLine.IsGenerateMode) { buildViewModel.Messages.CollectionChanged += Messages_CollectionChanged; } RunMode mode = _commandLine.IsGenerateMode && !_commandLine.ShowProgressUi ? RunMode.Blocking : RunMode.Async; buildViewModel.Start(mode); if (mode == RunMode.Async) { BuildView buildView = new BuildView(); buildView.DataContext = buildViewModel; buildView.ShowDialog(); } buildViewModel.Detach(); if (_commandLine.IsGenerateMode) { buildViewModel.Messages.CollectionChanged -= Messages_CollectionChanged; } }
// From College public DialogSemesterCollege(MainForm form, DataGridViewRow row) { InitializeComponent(); mainForm = form; collegeId = (int)row.Cells["CollegeId"].Value; collegeName = row.Cells["CollegeName"].Value.ToString(); LBL_DialogSemesterCollege_Name.Text = "College:"; LBL_DialogSemesterCollege_Value.Text = collegeName; semesterCollegeView = new BuildView() { GridView = DGV_SemesterCollege, TabledData = cmd.SemestersNotAssignedToCollege(collegeId), DataGridViewColumns = new DataGridViewColumn[] { columnProperties.year, columnProperties.isSecondSemester, columnProperties.semesterKey, columnProperties.semesterName_Dialog } }; semesterCollegeView.Create(); if (semesterCollegeView.ResultCount < 1) { LBL_DialogSemesterCollege_Results.Text = "No available Semester(s)"; BTN_DialogSemesterCollegeAdd.Enabled = false; } else { LBL_DialogSemesterCollege_Results.Text = semesterCollegeView.ResultCount.ToString() + " available Semester(s)"; } }
public DialogTeachingHistory(DataGridViewRow row) { InitializeComponent(); currentSemester = new SemesterKey(cmd.GetCurrentSemesterKey()); string email = row.Cells["Email"].Value.ToString(); string name = row.Cells["FirstName"].Value.ToString() + " " + row.Cells["LastName"].Value.ToString(); ColumnProperties columnProperties = new ColumnProperties(); BuildView historyView = new BuildView() { GridView = DGV_DialogTeachingHistory, TabledData = cmd.TeacherHistory(email), DataGridViewColumns = new DataGridViewColumn[] { columnProperties.courseCode, columnProperties.courseName, columnProperties.subjectName, columnProperties.collegeName, columnProperties.semesterName, columnProperties.period, columnProperties.teacherEmail_Hidden, columnProperties.teacherFullName_Hidden, columnProperties.semesterKey } }; historyView.Create(); historyView.GridView.MultiSelect = true; SetPeriod(); LBL_TeachingHistory_Name.Text = name; LBL_DialogTeacherHistoryResults.Text = string.Format("{0} Course(s)", historyView.ResultCount.ToString()); }
// "form" currently unused - keeping dialog constructor params consistant public DialogCourseUnit(MainForm form, DataGridViewRow row) { InitializeComponent(); mainForm = form; courseCode = row.Cells["CourseCode"].Value.ToString(); courseName = row.Cells["CourseName"].Value.ToString(); ColumnProperties columnProperties = new ColumnProperties(); courseUnitView = new BuildView() { GridView = DGV_DialogCourseUnit, TabledData = cmd.DialogCourseUnitPopulateUnit(courseCode, ""), DataGridViewColumns = new DataGridViewColumn[] { columnProperties.unitCode, columnProperties.unitDescription, columnProperties.core_CheckBox, columnProperties.select_CheckBox }, EditMode = DataGridViewEditMode.EditOnEnter }; courseUnitView.Create(); totalCount = courseUnitView.ResultCount; resultCount = courseUnitView.ResultCount; GetLoadedUnits(); SetResultLabel(); LBL_DialogCourseUnit.Text = string.Format("{0} - {1}", courseCode, courseName); }
protected override void Given() { sequnceId = 0; ProjectView = SetupProjectView(); project_test_support = ProjectView as ProjectTestSupport; BuildView = ProjectView as BuildView; EventHandler = new PipelineStatusEventHandler(StoreFactory.WireupEventStore()); }
/// <summary> /// The initialize build controller. /// </summary> /// <param name="buildCount"> /// The buildCount. /// </param> /// <param name="targetCount"> /// The target Count. /// </param> private void InitializeBuildDetailView(int buildCount = 1, int targetCount = 1) { this.builds = new List <Build>(); this.targets = new List <BuildTarget>(); this.buildDetailViews = new List <BuildDetailView>(); this.buildViews = new List <BuildView>(); this.BuildCount = buildCount; this.TargetCount = targetCount; var rng = new Random(); for (var i = 1; i <= buildCount; i++) { var build = new Build { Id = i, RequestTimestamp = DateTime.UtcNow.AddHours(rng.Next(-72, 0)), CompleteTimestamp = DateTime.UtcNow, Status = (BuildStatus)rng.Next(0, 3) }; var buildView = new BuildView(this.UrlHelper) { Id = i, RequestTimestamp = build.RequestTimestamp, CompleteTimestamp = build.CompleteTimestamp, Status = build.Status }; buildView.PopulateLinks(); this.buildViews.Add(buildView); var buildDetailView = new BuildDetailView(this.UrlHelper) { Id = i, RequestTimestamp = build.RequestTimestamp, CompleteTimestamp = build.CompleteTimestamp, Status = build.Status }; buildDetailView.PopulateLinks(); build.Targets = new List <BuildTarget>(); var targetViews = new List <BuildTargetView>(); for (var tc = 1; tc <= targetCount; tc++) { var job = rng.Next(1, 100); build.Targets.Add(new BuildTarget { Id = i, Build = build, JobId = 10, Target = "Target" + tc }); targetViews.Add(new BuildTargetView { Target = "Target" + tc }); } this.targets.AddRange(build.Targets); this.builds.Add(build); buildDetailView.Targets = targetViews; this.buildDetailViews.Add(buildDetailView); } }
public DialogNeverRun(string entity) { InitializeComponent(); BuildView neverRunView; ColumnProperties columnProperties = new ColumnProperties(); string name; if (entity.ToLower() == "course") { name = "Course"; neverRunView = new BuildView() { GridView = DGV_DialogNeverRun, TabledData = cmd.CoursesNeverRun(), DataGridViewColumns = new DataGridViewColumn[] { columnProperties.courseCode, columnProperties.courseName, columnProperties.fee } }; } else if (entity.ToLower() == "subject") { name = "Subject"; neverRunView = new BuildView() { GridView = DGV_DialogNeverRun, TabledData = cmd.SubjectsNeverRun(), DataGridViewColumns = new DataGridViewColumn[] { columnProperties.subjectId, columnProperties.subjectName } }; } else // unit is default (entity.ToLower() == "unit") { name = "Unit"; neverRunView = new BuildView() { GridView = DGV_DialogNeverRun, TabledData = cmd.UnitsNeverRun(), DataGridViewColumns = new DataGridViewColumn[] { columnProperties.unitCode, columnProperties.unitDescription } }; } neverRunView.Create(); Text = string.Format("{0}s Never Run or Assigned", name); GRPBOX_NeverRun.Text = string.Format("{0}s Never Run or Assigned", name); LBL_DialogNeverRunResults.Text = string.Format("{0} {1}(s)", neverRunView.ResultCount.ToString(), name); }
// From Semester - alternate signature public DialogSemesterCollege(MainForm form, DataGridView dgv, int rowNumber) { InitializeComponent(); mainForm = form; DataGridViewRow row = dgv.Rows[rowNumber]; semesterKey = new SemesterKey(row.Cells["SemesterKey"].Value.ToString()); semesterName = row.Cells["SemesterName"].Value.ToString(); LBL_DialogSemesterCollege_Name.Text = "Semester:"; LBL_DialogSemesterCollege_Value.Text = semesterName; semesterCollegeView = new BuildView() { GridView = DGV_SemesterCollege, TabledData = cmd.CollegesNotOperatingDuringSemester(semesterKey.Key), DataGridViewColumns = new DataGridViewColumn[] { columnProperties.collegeId_Hidden, columnProperties.collegeName, columnProperties.address, columnProperties.city, columnProperties.state, columnProperties.postCode, columnProperties.semesterKey } }; semesterCollegeView.Create(); if (semesterCollegeView.ResultCount < 1) { LBL_DialogSemesterCollege_Results.Text = "No available College(s)"; BTN_DialogSemesterCollegeAdd.Enabled = false; } else { if (mainForm.currentSemester.Key >= semesterKey.Key) { BTN_DialogSemesterCollegeAdd.Enabled = false; LBL_DialogSemesterCollege_Results.Text = "Cannot operate in the past " + semesterCollegeView.ResultCount.ToString() + " College(s)"; } else { LBL_DialogSemesterCollege_Results.Text = semesterCollegeView.ResultCount.ToString() + " available College(s)"; } } }
/// <summary> /// The update node. /// </summary> /// <param name="nodeRequests"> /// The node requests. /// </param> /// <returns> /// The <see cref="Task"/>. /// </returns> public async Task <IEnumerable <NodeDetailResult> > UpdateNode(IEnumerable <NodeRequest> nodeRequests) { var details = new List <NodeDetailResult>(); foreach (var entry in nodeRequests) { var nodeRequest = entry; var detail = await this.NodeRepository.Include(n => n.Roles).FindNodeByName(entry.NodeName); detail.IncludeConfigurationProperties(this.Context); if (detail == null) { continue; } var dirty = detail.Merge(nodeRequest.NodeData, this.Context); detail.IncludeConfigurationProperties(this.Context, true); var view = detail.Map <NodeDetailView>(); BuildView build = null; if (nodeRequest.BuildMof && dirty) { if (this.BuildService == null) { this.Logging.BuildRequestedNoBuildService(nodeRequest); } else { build = await this.BuildService.Build(this.GetConfigurationData(view)); } } var result = new NodeDetailResult { Build = build, NodeView = view }; details.Add(result); this.Logging.NodeUpdated(detail.Name); if (entry.NodeData.ContainsKey("IsInitialDeployment") && (bool)entry.NodeData["IsInitialDeployment"] != result.NodeView.IsInitialDeployment) { this.Logging.NodeChangedInitialDeployment(result.NodeView.Name, result.NodeView.IsInitialDeployment); } } await this.Context.SaveChangesAsync(); return(details); }
// From Student Enrolments public DialogRegister(MainForm form, DataGridViewRow row) { InitializeComponent(); // Add values to variables mainForm = form; college = row.Cells["CollegeName"].Value.ToString(); semesterName = row.Cells["SemesterName"].Value.ToString(); semesterKey = new SemesterKey((int)row.Cells["SemesterKey"].Value); collegeId = (int)row.Cells["CollegeId"].Value; LBL_DialogRegister_Name.Text = "College:"; LBL_DialogRegister_Value.Text = college; LBL_DialogRegister_Semester.Text = "Semester:"; LBL_DialogRegister_SemesterValue.Text = semesterName; LBL_DialogRegister_Semester.Visible = true; LBL_DialogRegister_SemesterValue.Visible = true; // Create DataGridView ColumnProperties columnProperties = new ColumnProperties(); BuildView registerView = new BuildView() { GridView = DGV_DialogRegister, TabledData = cmd.AllExceptRegisteredStudents(semesterKey.Key, collegeId), DataGridViewColumns = new DataGridViewColumn[] { columnProperties.studentFirstName_Dialog, columnProperties.studentLastName_Dialog, columnProperties.studentEmail } }; registerView.Create(); // Sundry functions if (form.currentSemester.Key >= semesterKey.Key) { BTN_DialogRegisterAdd.Enabled = false; LBL_DialogRegisterResults.Text = string.Format("Cannot register in the past {0} unregistered students(s)", registerView.ResultCount.ToString()); } else { LBL_DialogRegisterResults.Text = string.Format("Select a student from {0} unregistered students(s)", registerView.ResultCount.ToString()); } }
public DialogSubjectUnit(MainForm form, DataGridViewRow row) { InitializeComponent(); // Add values to variables mainForm = form; currentSemester = mainForm.currentSemester; semesterKey = new SemesterKey(row.Cells["SemesterKey"].Value.ToString()); semesterName = row.Cells["SemesterName"].Value.ToString(); collegeId = (int)row.Cells["CollegeId"].Value; college = row.Cells["CollegeName"].Value.ToString(); courseCode = row.Cells["CourseCode"].Value.ToString(); courseName = row.Cells["CourseName"].Value.ToString(); // Create DataGridView comboBoxColumn = columnProperties.subject; comboBoxColumn.ComboData = new MainDAL().ViewSubjectAssignments(semesterKey.Key, collegeId, courseCode, 0, ""); subjectUnitView = new BuildView() { GridView = DGV_DialogSubjectUnit, TabledData = cmd.SpecialSubjectUnit(semesterKey.Key, collegeId, courseCode), DataGridViewColumns = new DataGridViewColumn[] { columnProperties.unitCode, columnProperties.unitDescription, columnProperties.subjectId_Hidden, columnProperties.subjectName_Hidden, columnProperties.core, columnProperties.select_CheckBox }, ComboBoxColumns = new ComboBoxColumn[] { comboBoxColumn }, EditMode = DataGridViewEditMode.EditOnEnter }; comboBoxColumn.Create(); // Column must be added to grid on 'data binding complete' subjectUnitView.Create(); // Sundry functions GetLoadedUnits(); SelectCore(); LBL_DialogSubjectUnit_Course.Text = courseCode + " - " + courseName; LBL_DialogSubjectUnit_College.Text = college; LBL_DialogSubjectUnit_Semester.Text = semesterName; }
public DialogEnrol(MainForm form, DataGridViewRow row) { InitializeComponent(); // Add values to variables mainForm = form; name = row.Cells["StudentFullName"].Value.ToString(); college = row.Cells["CollegeName"].Value.ToString(); semesterName = row.Cells["SemesterName"].Value.ToString(); email = row.Cells["StudentEmail"].Value.ToString(); semesterKey = new SemesterKey((int)row.Cells["SemesterKey"].Value); collegeId = (int)row.Cells["CollegeId"].Value; currentSemester = mainForm.currentSemester; LBL_DialogEnrol_Name.Text = name; LBL_DialogEnrol_College.Text = college; LBL_DialogEnrol_Semester.Text = semesterName; // Create DataGridView columnProperties = new ColumnProperties() { }; enrolView = new BuildView() { GridView = DGV_DialogEnrol, TabledData = cmd.DialogEnrolment(semesterKey.Key, collegeId, email), DataGridViewColumns = new DataGridViewColumn[] { columnProperties.courseCode, columnProperties.courseName, columnProperties.year, columnProperties.isSecondSemester, columnProperties.collegeName, columnProperties.fee, columnProperties.dateEnroled, columnProperties.select_Hidden }, ButtonColumns = new ButtonColumn[] { columnProperties.enrol } }; enrolView.Create(); // Sundry functions DGV_DialogEnrol.CurrentCellDirtyStateChanged += new EventHandler(DGV_DialogEnrol_CurrentCellDirtyStateChanged); }
public DialogCourseSubject(MainForm form, DataGridViewRow row) { InitializeComponent(); // Add values to variables mainForm = form; currentSemester = mainForm.currentSemester; semesterKey = new SemesterKey((int)row.Cells["SemesterKey"].Value); semesterName = row.Cells["SemesterName"].Value.ToString(); collegeId = (int)row.Cells["CollegeId"].Value; college = row.Cells["CollegeName"].Value.ToString(); courseCode = row.Cells["CourseCode"].Value.ToString(); courseName = row.Cells["CourseName"].Value.ToString(); // Create DataGridView comboBoxColumn = columnProperties.teacher; courseSubjectView = new BuildView() { GridView = DGV_DialogCourseSubject, TabledData = cmd.SpecialCourseSubject(semesterKey.Key, collegeId, courseCode), DataGridViewColumns = new DataGridViewColumn[] { columnProperties.semesterKey, columnProperties.collegeId_Hidden, columnProperties.courseCode_Hidden, columnProperties.subjectId_Hidden, columnProperties.subjectName, columnProperties.teacherFullName_Hidden, columnProperties.teacherEmail_Hidden, columnProperties.select_CheckBox }, ComboBoxColumns = new ComboBoxColumn[] { comboBoxColumn }, EditMode = DataGridViewEditMode.EditOnEnter }; comboBoxColumn.Create(); // Column must be added on 'data binding complete' courseSubjectView.Create(); // Sundry functions GetLoadedSubjects(); LBL_DialogCourseSubject_Course.Text = courseCode + " - " + courseName; LBL_DialogCourseSubject_College.Text = college; LBL_DialogCourseSubject_Semester.Text = semesterName; }
public ShellViewModel(SDGuiStrings strings, IConfigController configController, IBuildController buildController, Action onCloseHandle) { _onCloseHandle = onCloseHandle; _buildController = buildController; _buildController.BuildMessenger.OnStepMessage += (s) => StepMessage = s; _configController = configController; Strings = strings; Config = configController.GetConfigSection <ICoreConfigSection>(); ConfigSections = configController.GetAllConfigSections().ToList(); ProgressBarViewModel = new ProgressBarViewModel(buildController, strings); _configController.OnRecentProjectsChanged += RecentProjectsChanged; _buildWindow = new BuildView(Strings, buildController.BuildMessenger); RecentProjectsChanged(); }
public DialogGrade(MainForm form, DataGridViewRow row) { // Mainform currently unused - keeping dialog constructor params consistant InitializeComponent(); semesterKey = new SemesterKey((int)row.Cells["SemesterKey"].Value); collegeId = (int)row.Cells["CollegeId"].Value; courseCode = row.Cells["CourseCode"].Value.ToString(); email = row.Cells["StudentEmail"].Value.ToString(); name = row.Cells["StudentFullName"].Value.ToString(); college = row.Cells["CollegeName"].Value.ToString(); semesterName = row.Cells["SemesterName"].Value.ToString(); course = row.Cells["CourseName"].Value.ToString(); LBL_DialogGrade_Name.Text = name; LBL_DialogGrade_College.Text = college; LBL_DialogGrade_Semester.Text = semesterName; LBL_DialogGrade_Course.Text = courseCode + " - " + course; ColumnProperties columnProperties = new ColumnProperties(); gradesView = new BuildView() { GridView = DGV_DialogGrade, TabledData = cmd.DialogGrades(semesterKey.Key, collegeId, email, courseCode), DataGridViewColumns = new DataGridViewColumn[] { columnProperties.unitCode, columnProperties.unitDescription, columnProperties.subjectName, columnProperties.subjectId_Hidden, columnProperties.competent_CheckBox, columnProperties.rpl_CheckBox, columnProperties.dateGraded }, EditMode = DataGridViewEditMode.EditOnEnter }; gradesView.Create(); GetGradedUnits(); }
/// <summary> /// The create node. /// </summary> /// <param name="nodeRequests"> /// The node requests. /// </param> /// <returns> /// The <see cref="Task"/>. /// </returns> public async Task <IEnumerable <NodeDetailResult> > CreateNode(IEnumerable <NodeRequest> nodeRequests) { var details = new List <NodeDetailResult>(); foreach (var nodeRequest in nodeRequests) { var detail = new Node(); detail.Merge(nodeRequest.NodeData, this.Context); this.NodeRepository.Add(detail); detail.IncludeConfigurationProperties(this.Context); var view = detail.Map <NodeDetailView>(); BuildView build = null; if (nodeRequest.BuildMof) { if (this.BuildService == null) { this.Logging.BuildRequestedNoBuildService(nodeRequest); } else { build = await this.BuildService.Build(this.GetConfigurationData(view)); } } var result = new NodeDetailResult { Build = build, NodeView = view }; details.Add(result); this.Logging.NodeCreated(detail.Name); if (detail.IsInitialDeployment) { this.Logging.NodeChangedInitialDeployment(detail.Name, detail.IsInitialDeployment); } } await this.Context.SaveChangesAsync(); return(details); }
public ShellViewModel(SDGuiStrings strings, IConfigController configController, BuildController buildController, Action onCloseHandle) { _onCloseHandle = onCloseHandle; _buildController = buildController; _buildController.BuildMessenger.OnStepMessage += (s) => StepMessage = s; _buildController.BuildMessenger.OnBuildFailed += () => Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => _buildWindow.Show())); _configController = configController; Strings = strings; Config = configController.GetConfigSection<ICoreConfigSection>(); ConfigSections = configController.GetAllConfigSections().ToList(); _configController.OnRecentProjectsChanged += RecentProjectsChanged; _buildWindow = new BuildView(Strings, buildController.BuildMessenger); ProgressBarViewModel = new ProgressBarViewModel(buildController, strings); RecentProjectsChanged(); }
public DialogCollegeCourse(MainForm form, DataGridViewRow row) { InitializeComponent(); mainForm = form; college = row.Cells["CollegeName"].Value.ToString(); semesterName = row.Cells["SemesterName"].Value.ToString(); semesterKey = new SemesterKey((int)row.Cells["SemesterKey"].Value); collegeId = (int)row.Cells["CollegeId"].Value; ColumnProperties columnProperties = new ColumnProperties(); BuildView collegeCourseView = new BuildView() { GridView = DGV_DialogCollegeCourse, TabledData = cmd.CoursesNotRunning(semesterKey.Key, collegeId), DataGridViewColumns = new DataGridViewColumn[] { columnProperties.courseCode, columnProperties.courseName } }; collegeCourseView.Create(); // TODO - On hold whilst deciding how TAB navigation should operate // collegeCourseView.GridView.TabStop = true; LBL_DialogCollegeCourse_College.Text = college; LBL_DialogCollegeCourse_Semester.Text = semesterName; if (form.currentSemester.Key >= semesterKey.Key) { BTN_DialogCollegeCourseAdd.Enabled = false; LBL_DialogCollegeCourse_Results.Text = string.Format("Cannot assign in the past {0} course(s)", collegeCourseView.ResultCount.ToString()); } else { LBL_DialogCollegeCourse_Results.Text = string.Format("{0} available course(s)", collegeCourseView.ResultCount.ToString()); } }
public BuildController( EntityController.Select entityControllerSelect, BuildViewPresenter unitViewPresenter, BaseUnit.UnitCharacteristics unitCharacteristics, EntityController.GetTarget getTarget, EntityController.Faction faction, DeathDestroy updateDeath, BaraksModel.SetUpdeteCharacteristicsDelegate setUpdeteCharacteristicsDelegate ) : base(entityControllerSelect, unitViewPresenter, unitCharacteristics, getTarget, faction, updateDeath, setUpdeteCharacteristicsDelegate) { this.updateDeath = updateDeath; EffectsController effectsController = new EffectsController(); unitBehaviour.CallDeathFSMEvent(); unitBehaviour = new BuildBehaviour( getTarget, faction, unitViewPresenter, animationController ); unitModel = new BuildUnit( unitCharacteristics, faction, effectsController, _UpdateCharacteristics, UpdateDeath, setUpdeteCharacteristicsDelegate, DeleteVisualEffect ); BuildView unitView = new BuildView( unitViewPresenter, Selected, ((BuildUnit)unitModel).GetDamage ); this.unitView = unitView; }
// From Student public DialogRegister(MainForm form, DataGridView dgv, int rowNumber) { InitializeComponent(); // Add values to variables DataGridViewRow row = dgv.Rows[rowNumber]; mainForm = form; studentEmail = row.Cells["Email"].Value.ToString(); student = string.Format("{0} {1}", row.Cells["FirstName"].Value.ToString(), row.Cells["LastName"].Value.ToString()); LBL_DialogRegister_Name.Text = "Student:"; LBL_DialogRegister_Value.Text = student; LBL_DialogRegister_Semester.Visible = false; LBL_DialogRegister_SemesterValue.Visible = false; // Create DataGridView ColumnProperties columnProperties = new ColumnProperties(); BuildView registerView = new BuildView() { GridView = DGV_DialogRegister, TabledData = cmd.AvailableStudentRegistrations(studentEmail), DataGridViewColumns = new DataGridViewColumn[] { columnProperties.year, columnProperties.isSecondSemester, columnProperties.semesterKey, columnProperties.collegeId_Hidden, columnProperties.collegeName } }; registerView.Create(); // Sundry functions LBL_DialogRegisterResults.Text = string.Format("Select an entry from {0} available registration(s)", registerView.ResultCount.ToString()); }
public void Setup() { view = GetProjectView(); build_view = view as BuildView; ((ProjectTestSupport) view).WipeBucket(); }