コード例 #1
0
 private void resetObjectIdIfRequired(IWithId withId)
 {
     if (_withIdRepository.ContainsObjectWithId(withId.Id))
     {
         _objectIdResetter.ResetIdFor(withId);
     }
 }
コード例 #2
0
 private void register(IWithId objectBase)
 {
     if (objectBase == null)
     {
         return;
     }
     _withIdRepository.Register(objectBase);
 }
コード例 #3
0
        public override void LoadSettingsForSubject(IWithId subject)
        {
            base.LoadSettingsForSubject(subject);
            _pkAnalysisPresenter.LoadSettingsForSubject(subject);
            _settings = _presentationSettingsTask.PresentationSettingsFor <DefaultPresentationSettings>(this, subject);

            setViewMode(_settings.IsEqual(CHART_DISPLAY_MODE_SETTING, ChartDisplayMode.PKAnalysis));
        }
コード例 #4
0
 private void unregister(IWithId objectToUnregister)
 {
     if (objectToUnregister == null)
     {
         return;
     }
     _withIdRepository.Unregister(objectToUnregister.Id);
 }
コード例 #5
0
 protected override void Context()
 {
     base.Context();
     _dataRepo1     = new DataRepository("OBS1");
     _simmulation   = new MoBiSimulation().WithId("ID");
     _parentContext = new SerializationContext(_dimensionFactory, _objectBaseFactory, new WithIdRepository(), new[] { _dataRepo1 }, _cloneManagerForModel, _container);
     _parentContext.Register(_simmulation);
 }
コード例 #6
0
        private EntityMetaData mapFrom(IWithId entityWithId)
        {
            var entityMetaData = new EntityMetaData {
                Id = entityWithId.Id
            };

            serialize(entityMetaData, entityWithId);
            return(entityMetaData);
        }
コード例 #7
0
        public virtual void RemoveNodeFor(IWithId objectWithId)
        {
            var node = NodeFor(objectWithId);

            if (node == null)
            {
                return;
            }
            _view.DestroyNode(node);
        }
コード例 #8
0
        protected void RemoveClassifiableForWrappedObject(IWithId wrappedObject)
        {
            var classifiable = _allClassifiables.FindById(wrappedObject.Id);

            if (classifiable == null)
            {
                return;
            }
            RemoveClassifiable(classifiable);
        }
コード例 #9
0
ファイル: ClonerSpecs.cs プロジェクト: yvkashyap/PK-Sim
        protected override void Context()
        {
            base.Context();
            _derserialziedObject = A.Fake <IWithId>();
            _objectWithId        = A.Fake <IWithId>();
            var stream = new byte[] { 1, 2 };

            A.CallTo(() => _serializationManager.Serialize(_objectWithId)).Returns(stream);
            A.CallTo(() => _serializationManager.Deserialize <IWithId>(stream, null)).Returns(_derserialziedObject);
        }
コード例 #10
0
        protected void Unregister(IWithId objectWithId)
        {
            if (objectWithId == null)
            {
                return;
            }

            var registrationTask = IoC.Resolve <IRegistrationTask>();

            registrationTask.Unregister(objectWithId);
        }
コード例 #11
0
        protected void Unregister(IWithId objectWithId)
        {
            if (objectWithId == null)
            {
                return;
            }

            var unregisterTask = IoC.Resolve <IUnregisterTask>();

            unregisterTask.UnregisterAllIn(objectWithId);
        }
コード例 #12
0
 protected override void Context()
 {
     base.Context();
     _project       = A.Fake <IProject>();
     _subject1      = A.Fake <IWithId>();
     _classifiable1 = A.Fake <IClassifiableWrapper>().WithId("1");
     _classifiable2 = A.Fake <IClassifiableWrapper>().WithId("2");
     A.CallTo(() => _repository.Get(_classifiable1.Id)).Returns(_subject1);
     A.CallTo(() => _repository.Get(_classifiable2.Id)).Returns(null);
     A.CallTo(() => _project.AllClassifiablesByType <IClassifiableWrapper>()).Returns(new[] { _classifiable1, _classifiable2 });
 }
コード例 #13
0
        public void UnregisterAllIn(IWithId objectToUnregister)
        {
            var objectBase = objectToUnregister as IObjectBase;

            if (objectBase == null)
            {
                Visit(objectToUnregister);
            }
            else
            {
                objectBase.AcceptVisitor(this);
            }
        }
コード例 #14
0
        public override void LoadSettingsForSubject(IWithId subject)
        {
            base.LoadSettingsForSubject(subject);
            _pkAnalysisPresenter.LoadSettingsForSubject(subject);

            if (_settings.IsEqual(_chartDisplayModeSetting, ChartDisplayMode.PKAnalysis))
            {
                ShowAnalysis();
            }
            else
            {
                ShowChart();
            }
        }
コード例 #15
0
        public void Register(IWithId objectToRegister)
        {
            if (objectToRegister == null)
            {
                return;
            }

            var objectBase = objectToRegister as IObjectBase;

            if (objectBase == null)
            {
                register(objectToRegister);
            }
            else
            {
                objectBase.AcceptVisitor(this);
            }
        }
コード例 #16
0
        public void RegisterAllIn(IWithId objectToRegister)
        {
            //If already registered, no need to register the whole hiearchy again
            if (_withIdRepository.ContainsObjectWithId(objectToRegister.Id))
            {
                return;
            }

            var objectBase = objectToRegister as IObjectBase;

            if (objectBase == null)
            {
                Visit(objectToRegister);
            }
            else
            {
                objectBase.AcceptVisitor(this);
            }
        }
コード例 #17
0
        public virtual void Register(IWithId objectWithId)
        {
            if (string.IsNullOrEmpty(objectWithId.Id))
            {
                return;
            }

            if (!ContainsObjectWithId(objectWithId.Id))
            {
                _entities.Add(objectWithId);
                return;
            }

            var existing = Get(objectWithId.Id);

            if (ReferenceEquals(existing, objectWithId))
            {
                return;
            }

            throw new NotUniqueIdException(objectWithId.Id);
        }
コード例 #18
0
 public virtual ITreeNode NodeFor(IWithId objectWithId)
 {
     return(objectWithId != null?_view.NodeById(objectWithId.Id) : null);
 }
コード例 #19
0
 protected override void Context()
 {
     base.Context();
     _dataRepo1   = new DataRepository("OBS1");
     _simmulation = new IndividualSimulation().WithId("ID");
 }
コード例 #20
0
 public void Unregister(IWithId objectToUnregister)
 {
     _unregisterObjectVisitor.Unregister(objectToUnregister);
 }
コード例 #21
0
 protected override void Context()
 {
     _workspace = A.Fake <IWithWorkspaceLayout>();
     sut        = new PresentationSettingsTask(_workspace);
     _subject   = A.Fake <IWithId>();
 }
コード例 #22
0
 protected TPresentationSettings PresentationSettingsFor(IWithId withId, string presentationKey)
 {
     return(_presentationSettingsTask.PresentationSettingsFor <TPresentationSettings>(presentationKey, withId));
 }
コード例 #23
0
 public void Register(IWithId objectToRegister)
 {
     _registerObjectVisitor.Register(objectToRegister);
 }
コード例 #24
0
 public override void LoadSettingsForSubject(IWithId subject)
 {
     base.LoadSettingsForSubject(subject);
     _globalPKAnalysisPresenter.LoadSettingsForSubject(subject);
 }
コード例 #25
0
 public void LoadSettingsForSubject(IWithId subject)
 {
     _settings = _presentationSettingsTask.PresentationSettingsFor <DefaultPresentationSettings>(this, subject);
 }
コード例 #26
0
 public void Unregister(IWithId objectToUnregister)
 {
     _registrationTask.Unregister(objectToUnregister);
 }
コード例 #27
0
 public void Register(IWithId objectToRegister)
 {
     _registrationTask.Register(objectToRegister);
 }
コード例 #28
0
 public void LoadSettingsForSubject(IWithId subject)
 {
     _settings = _presentationSettingsTask.PresentationSettingsFor <ParameterGroupsPresenterSettings>(this, subject);
     _settings.DefaultParameterGroupingModeId = _userSettings.DefaultParameterGroupingMode;
     _parameterGroupingMode = _settings.ParameterGroupingMode;
 }
コード例 #29
0
 public void Register(IWithId objectToRegister)
 {
 }
コード例 #30
0
 public void Unregister(IWithId objectToUnregister)
 {
 }