private void EntitySelected(EntitySelectedEvent obj)
        {
            switch (obj.EntityKey)
            {
            case "SourceParty":
                this.PartyAccountability.SourcePartyId   = obj.Id;
                this.PartyAccountability.SourcePartyName = obj.EntityValue;
                break;

            case "TargetParty":
                this.PartyAccountability.TargetPartyId   = obj.Id;
                this.PartyAccountability.TargetPartyName = obj.EntityValue;
                break;

            case "SourcePerson":
                this.PartyAccountability.SourcePersonId   = obj.Id;
                this.PartyAccountability.SourcePersonName = obj.EntityValue;
                break;

            case "TargetPerson":
                this.PartyAccountability.TargetPersonId   = obj.Id;
                this.PartyAccountability.TargetPersonName = obj.EntityValue;
                break;
            }
        }
Exemplo n.º 2
0
        public void Handle(EntitySelectedEvent eventToHandle)
        {
            if (MoleculeBuildingBlock == null)
            {
                return;
            }
            if (eventToHandle.Sender == this)
            {
                return;
            }

            var selectedObjectBase = eventToHandle.ObjectBase;

            if (!canHandle(selectedObjectBase))
            {
                return;
            }

            if (isParameterInMoleculeBuildingBlock(selectedObjectBase))
            {
                _view.SelectItem(((IEntity)selectedObjectBase).ParentContainer);
            }
            else
            {
                _view.SelectItem(selectedObjectBase);
            }
        }
Exemplo n.º 3
0
 private void EntitySelected(EntitySelectedEvent obj)
 {
     switch (obj.EntityKey)
     {
     case "Party":
         this.PartyRole.PartyId   = obj.Id;
         this.PartyRole.PartyName = obj.EntityValue;
         break;
     }
 }
Exemplo n.º 4
0
 private void EntitySelected(EntitySelectedEvent obj)
 {
     switch (obj.EntityKey)
     {
     case "Parent":
         this.Location.ParentId   = obj.Id;
         this.Location.ParentName = obj.EntityValue;
         break;
     }
 }
Exemplo n.º 5
0
        public void Handle(EntitySelectedEvent eventToHandle)
        {
            var handled = CanHandle(eventToHandle.ObjectBase);

            if (!handled.Item1)
            {
                return;
            }

            selectObjectAndParent(handled.Item2, eventToHandle.ObjectBase);
        }
        public void Handle(EntitySelectedEvent eventToHandle)
        {
            if (_buildingBlock == null)
            {
                return;
            }
            var selectedObserver = eventToHandle.ObjectBase as IObserverBuilder;

            if (selectedObserver != null && ShouldShow(selectedObserver))
            {
                SelectObserver(selectedObserver);
            }
        }
Exemplo n.º 7
0
        public void Handle(EntitySelectedEvent eventToHandle)
        {
            var formula = eventToHandle.ObjectBase as IFormula;

            if (formula == null)
            {
                return;
            }
            if (_cache.Contains(formula))
            {
                Select(formula);
                _view.Select(dtoFor(formula));
            }
        }
Exemplo n.º 8
0
        public void Handle(EntitySelectedEvent eventToHandle)
        {
            if (eventToHandle.Sender == this)
            {
                return;
            }
            var entity = eventToHandle.ObjectBase as IEntity;

            if (entity == null || _spatialStructure == null)
            {
                return;
            }
            if (!_spatialStructure.TopContainers.Contains(entity.RootContainer))
            {
                return;
            }

            var entityToSelect = entity.IsAnImplementationOf <IParameter>() ? entity.ParentContainer : entity;

            _view.Select(entityToSelect.Id);
        }
        /// <summary>
        ///    Handle select event by selecting node.
        /// </summary>
        public void Handle(EntitySelectedEvent eventToHandle)
        {
            if (DiagramManager == null)
            {
                return;
            }
            if (!DiagramManager.MustHandleExisting(eventToHandle.ObjectBase.Id))
            {
                return;
            }

            IBaseNode baseNode = DiagramModel.GetNode(eventToHandle.ObjectBase.Id);

            if (baseNode == null)
            {
                return;
            }

            IContainerBase parentContainer = baseNode.GetParent();

            // Show node and parents
            baseNode.Hidden = false;
            baseNode.ShowParents();

            _view.ExpandParents(baseNode);

            // Expand parent
            var parentContainerNode = parentContainer as IContainerNode;

            if (parentContainerNode != null)
            {
                Focus(parentContainerNode);
            }

            _view.ClearSelection();
            _view.Select(baseNode);
            _view.CenterAt(baseNode);
        }
        public void Handle(EntitySelectedEvent eventToHandle)
        {
            if (eventToHandle.Sender == this)
            {
                return;
            }

            var entity = eventToHandle.ObjectBase as IEntity;

            if (entity == null)
            {
                return;
            }

            if (!selectedEntityIsInSimulation(entity))
            {
                return;
            }

            var entityToSelect = entity.IsAnImplementationOf <IParameter>() ? entity.ParentContainer : entity;

            _view.Select(entityToSelect.Id);
        }
        public void Handle(EntitySelectedEvent eventToHandle)
        {
            var entity = eventToHandle.ObjectBase as IEntity;

            if (!shouldShow(entity))
            {
                return;
            }

            _view.Display();

            var parameter = entity as IParameter;

            if (parameter != null)
            {
                setupEditPresenter(parameter, parameter.ParentContainer);
            }

            else
            {
                setupEditPresenter(entity);
            }
        }
 private void EntitySelected(EntitySelectedEvent obj)
 {
 }