public MainWindowViewModel() { var mediumViewModel = new MediumViewModel(); MediumViewUserControl = new MediumView { DataContext = mediumViewModel }; _gitHubViewModel = new GitHubViewModel(); GitHubViewUserControl = new GitHubView { DataContext = _gitHubViewModel }; _linkedInViewModel = new LinkedInViewModel(); LinkedInViewUserControl = new LinkedInView { DataContext = _linkedInViewModel }; _checkListViewModel = new CheckListViewModel(); CheckListViewUserControl = new CheckListView { DataContext = _checkListViewModel }; SearchCommand = new RelayCommand(ExecuteSearchCommand); }
public void CreateCheckList(CheckListView checkListView) { var checkList = new CheckList { Name = checkListView.Name, Description = checkListView.Description }; _unitOfWork.CheckLists.Add(checkList); var items = checkListView.ItemViews.Select( itemView => new Item { Name = itemView.Name, Description = itemView.Description, }); var itemDetails = checkListView.ItemViews.Zip(items, (itemView, item) => new ItemDetail { Ready = itemView.IsReady, Quantity = itemView.Quantity, Notes = itemView.Notes, Item = item }); _unitOfWork.CheckListToItemDetails.AddRange(itemDetails.Select(itemDetail => new CheckListToItemDetail { ItemDetail = itemDetail, CheckList = checkList })); _unitOfWork.Save(); }
public SelectCodeTypeDialog(AutomationElement element) : base(element) { var actElement = Element.FindFirst( TreeScope.Descendants, new PropertyCondition( AutomationElement.AutomationIdProperty, "1005")); // AutomationId 1005 discovered with UISpy _availableCodeTypes = new CheckListView(actElement); }
public ActionResult DefineCheckList(int DroneID = 0) { ViewBag.DroneID = DroneID.ToString(); ExponentPortalEntities db = new ExponentPortalEntities(); List<CheckListView> TheRows = new List<CheckListView>(); foreach(MSTR_DroneCheckList dr in db.MSTR_DroneCheckList) { CheckListView cv = new CheckListView(); cv.CheckHeader = dr; cv.CheckList = db.MSTR_DroneCheckListItems.Where(x => x.DroneCheckList_ID == dr.ID).ToList(); TheRows.Add(cv); } return View(TheRows); }
public IActionResult CheckLists(CheckListView checkListView) { if (checkListView != null) { try { _checkListService.CreateCheckList(checkListView); // TODO: Because we use a view model approach, we may not have // any id to pass return(CreatedAtAction(nameof(CheckListView), new { id = 1 }, checkListView)); } catch (Exception ex) { return(BadRequest(ex.Message)); } } return(BadRequest("Checklist creation failed.")); }
private void BackgroundWorkerRunWorkerLoadCompleted(object sender, RunWorkerCompletedEventArgs e) { if (_addedChecks.Any(i => i.CheckUIType == CheckUIType.Iosa)) { _fromcheckListView = new CheckListView(); _tocheckListView = new CheckListView(); } else if (_addedChecks.Any(i => i.CheckUIType == CheckUIType.Safa)) { _fromcheckListView = new CheckListSAFAView(); _tocheckListView = new CheckListSAFAView(); } else if (_addedChecks.Any(i => i.CheckUIType == CheckUIType.Icao)) { _fromcheckListView = new CheckListICAOView(); _tocheckListView = new CheckListICAOView(); } // // _fromcheckListView // this._fromcheckListView.Location = new System.Drawing.Point(5, 53); this._fromcheckListView.Name = "_fromcheckListView"; this._fromcheckListView.Size = new System.Drawing.Size(1510, 306); // // _tocheckListView // this._tocheckListView.Location = new System.Drawing.Point(5, 406); this._tocheckListView.Name = "_tocheckListView"; this._tocheckListView.Size = new System.Drawing.Size(1510, 346); this.Controls.Add(this._tocheckListView); this.Controls.Add(this._fromcheckListView); UpdateInformation(); }
private void InitListView() { if (_parent.Type == RevisionType.Edition) { if (_manual.CheckUIType == CheckUIType.Iosa) { _directivesViewer = new CheckListView(AnimatedThreadWorker); } else if (_manual.CheckUIType == CheckUIType.Safa) { _directivesViewer = new CheckListSAFAView(AnimatedThreadWorker); } else if (_manual.CheckUIType == CheckUIType.Icao) { _directivesViewer = new CheckListICAOView(AnimatedThreadWorker); } else { return; } } else { if (_manual.CheckUIType == CheckUIType.Iosa) { _directivesViewer = new CheckListRevisionView(AnimatedThreadWorker); } else if (_manual.CheckUIType == CheckUIType.Safa) { _directivesViewer = new CheckListRevisionSAFAView(AnimatedThreadWorker); } else if (_manual.CheckUIType == CheckUIType.Icao) { _directivesViewer = new CheckListRevisionICAOView(AnimatedThreadWorker); } else { return; } } _directivesViewer.IsRevision = _parent.Type == RevisionType.Revision; _directivesViewer.Revision = _parent.Type == RevisionType.Revision ? _parent : null; _directivesViewer.TabIndex = 2; _directivesViewer.Location = new Point(panel1.Left, panel1.Top); _directivesViewer.Dock = DockStyle.Fill; _directivesViewer.SelectedItemsChanged += DirectivesViewerSelectedItemsChanged; Controls.Add(_directivesViewer); //события _directivesViewer.SelectedItemsChanged += DirectivesViewerSelectedItemsChanged; _directivesViewer.DisableContectMenu(); _directivesViewer.MenuOpeningAction = () => { if (_directivesViewer.SelectedItems.Count <= 0) { return; } if (_directivesViewer.SelectedItems.Count == 1) { } }; _directivesViewer.DisableCopyPaste(); panel1.Controls.Add(_directivesViewer); }