public void CompareObjects(IObjectBase leftObject, IObjectBase rightObject, bool runComparison = true, string leftCaption = null, string rightCaption = null, string viewCaption = null)
        {
            _leftObject   = leftObject;
            _rightObject  = rightObject;
            _leftCaption  = leftCaption ?? Captions.Comparisons.Left;
            _rightCaption = rightCaption ?? Captions.Comparisons.Right;
            _view.Caption = viewCaption ?? Captions.Comparisons.ComparisonTitle(_executionContext.TypeFor(leftObject));
            updateButtons();

            _executionContext.Load(leftObject);
            _executionContext.Load(rightObject);

            if (runComparison)
            {
                RunComparison();
            }
        }
Example #2
0
        private void loadSubjectBeforeRenaming()
        {
            var objectBase = Subject as IObjectBase;

            if (objectBase == null)
            {
                return;
            }
            _context.Load(objectBase);
        }
Example #3
0
        private void updatePaths(ParameterIdentification identification, ISimulation simulation, string oldName, string newName)
        {
            if (!identification.UsesSimulation(simulation))
            {
                return;
            }

            _executionContext.Load(identification);

            updateMappedObservationColumnPaths(identification, simulation, oldName, newName);
            updateSimulationResultColumnPaths(identification, oldName, newName);
            updateResidualOutputsPaths(identification, oldName, newName);
        }
        public RelatedItem Create <T>(T relatedObject) where T : class, IObjectBase
        {
            _executionContext.Load(relatedObject);

            var name     = relatedObject.Name;
            var data     = _relatedItemSerializer.Serialize(relatedObject);
            var itemType = _relatedItemTypeRetriever.TypeFor(relatedObject);

            return(createRelatedItem(name, itemType, data, relatedItem =>
            {
                relatedItem.Origin = _applicationConfiguration.Product;
                relatedItem.IconName = relatedObject.Icon;
                relatedItem.FullPath = _projectRetriever.CurrentProject.FilePath;
                relatedItem.Discriminator = _applicationDiscriminator.DiscriminatorFor(relatedObject);
                relatedItem.Description = _relatedItemDescriptionCreator.DescriptionFor(relatedObject);
            }));
        }
        protected override void PerformExecute()
        {
            var items = new List <IObjectBase>();

            //Load the subject first to ensure that we can retrieve the observed data used
            _executionContext.Load(Subject);

            //Add first observed data if available
            if (Subject is IUsesObservedData usesObservedData)
            {
                items.AddRange(_observedDataRepository.AllObservedDataUsedBy(usesObservedData));
            }

            //Then simulations
            items.AddRange(Subject.AllSimulations);

            //last subect
            items.Add(Subject);

            _journalTask.AddAsRelatedItemsToJournal(items);
        }
Example #6
0
 private void loadSimulation(ISimulation newSimulation)
 {
     _executionContext.Load(newSimulation);
 }