/// <summary> /// Execute the creation of a <see cref="ModellingAnnotationItem"/> /// </summary> protected void ExecuteCreateModellingAnnotation(ModellingAnnotationItem annotation, Participant participant, DomainOfExpertise owner) { if (this.SelectedThing == null) { return; } annotation.Owner = owner; annotation.Author = participant; annotation.Status = AnnotationStatusKind.OPEN; var annotatedThing = new ModellingThingReference(this.SelectedThing.Thing); annotation.RelatedThing.Add(annotatedThing); annotation.PrimaryAnnotatedThing = annotatedThing; var transactionContext = TransactionContextResolver.ResolveContext(this.Thing); var model = this.Thing.TopContainer as EngineeringModel; if (model == null) { throw new InvalidOperationException("A modelling annotation item can only be created in the context of a Engineering Model."); } var containerClone = model.Clone(false); var transaction = new ThingTransaction(transactionContext, containerClone); this.ThingDialogNavigationService.Navigate(annotation, transaction, this.Session, true, ThingDialogKind.Create, this.ThingDialogNavigationService, containerClone); }
/// <summary> /// Executes the <see cref="OpenAnnotationWindowCommand"/> /// </summary> /// <param name="annotation">The associated <see cref="ModellingAnnotationItem"/></param> protected override void ExecuteOpenAnnotationWindow(ModellingAnnotationItem annotation) { var vm = new AnnotationFloatingDialogViewModel(annotation, this.Session); this.DialogNavigationService.NavigateFloating(vm); }
protected override void ExecuteOpenAnnotationWindow(ModellingAnnotationItem annotation) { throw new System.NotImplementedException(); }
/// <summary> /// Open the floating annotation window /// </summary> protected abstract void ExecuteOpenAnnotationWindow(ModellingAnnotationItem annotation);
/// <summary> /// Add an Modelling Annotation row view model to the list of <see cref="ModellingAnnotationItem"/> /// </summary> /// <param name="modellingAnnotation"> /// The <see cref="ModellingAnnotation"/> that is to be added /// </param> private IModellingAnnotationItemRowViewModel <ModellingAnnotationItem> AddModellingAnnotationRowViewModel(ModellingAnnotationItem modellingAnnotation) { var requestForWaiver = modellingAnnotation as RequestForWaiver; if (requestForWaiver != null) { return(new RequestForWaiverRowViewModel(requestForWaiver, this.Session, this)); } var requestForDeviation = modellingAnnotation as RequestForDeviation; if (requestForDeviation != null) { return(new RequestForDeviationRowViewModel(requestForDeviation, this.Session, this)); } var changeRequest = modellingAnnotation as ChangeRequest; if (changeRequest != null) { return(new ChangeRequestRowViewModel(changeRequest, this.Session, this)); } var reviewItemDiscrepancy = modellingAnnotation as ReviewItemDiscrepancy; if (reviewItemDiscrepancy != null) { return(new ReviewItemDiscrepancyRowViewModel(reviewItemDiscrepancy, this.Session, this)); } var actionItem = modellingAnnotation as ActionItem; if (actionItem != null) { return(new ActionItemRowViewModel(actionItem, this.Session, this)); } var changeProposal = modellingAnnotation as ChangeProposal; if (changeProposal != null) { return(new ChangeProposalRowViewModel(changeProposal, this.Session, this)); } var contractChangeNotice = modellingAnnotation as ContractChangeNotice; if (contractChangeNotice != null) { return(new ContractChangeNoticeRowViewModel(contractChangeNotice, this.Session, this)); } throw new Exception("No ModellingAnnotationItem to return"); }