예제 #1
0
 public void Handle(RemovedEvent eventToHandle)
 {
     if (canHandle(eventToHandle))
     {
         Edit(_eventBuilder);
     }
 }
 public void Handle(RemovedEvent eventToHandle)
 {
     if (eventToHandle.RemovedObjects.Any(shouldHandleRemoved) && Equals(eventToHandle.Parent, BuildingBlock))
     {
         Edit(_reactionBuildingBlock);
     }
 }
예제 #3
0
 public void Handle(RemovedEvent eventToHandle)
 {
     foreach (var removedObject in eventToHandle.RemovedObjects)
     {
         ClearComparisonIfComparing(removedObject);
     }
 }
 public void Handle(RemovedEvent eventToHandle)
 {
     foreach (var removedObject in eventToHandle.RemovedObjects)
     {
         Close(removedObject);
     }
 }
        public void Handle(RemovedEvent eventToHandle)
        {
            if (!eventToHandle.RemovedObjects.Any(shouldHandleRemoved))
            {
                return;
            }

            setInitalView();
        }
예제 #6
0
 private bool canHandle(RemovedEvent eventToHandle)
 {
     if (_eventBuilder == null)
     {
         return(false);
     }
     return(eventToHandle.RemovedObjects.Any(removedObject => removedObject.IsAnImplementationOf <IEventAssignmentBuilder>() ||
                                             removedObject.IsAnImplementationOf <IParameter>()));
 }
 protected override void Context()
 {
     base.Context();
     _project = A.Fake <IMoBiProject>();
     _context = A.Fake <IMoBiContext>();
     A.CallTo(() => _context.CurrentProject).Returns(_project);
     A.CallTo(() => _context.PublishEvent(A <RemovedEvent> ._))
     .Invokes(x => _event = x.GetArgument <RemovedEvent>(0));
 }
예제 #8
0
 public void Handle(RemovedEvent eventToHandle)
 {
     foreach (var removedObject in eventToHandle.RemovedObjects)
     {
         if (_view.Shows(removedObject))
         {
             _view.Remove(removedObject);
         }
     }
 }
 /// <summary>
 ///    Handles the specified event to handle.
 /// </summary>
 /// <param name="eventToHandle"> The event to handle. </param>
 public void Handle(RemovedEvent eventToHandle)
 {
     if (_buildingBlock == null)
     {
         return;
     }
     if (eventToHandle.RemovedObjects.Any(ShouldShow))
     {
         _view.Show(GetListToShow(_buildingBlock));
     }
 }
예제 #10
0
 public void Handle(RemovedEvent eventToHandle)
 {
     if (_reactionBuildingBlock == null)
     {
         return;
     }
     if (eventToHandle.RemovedObjects.Any(item => item.IsAnImplementationOf <IReactionBuilder>()))
     {
         Edit(_reactionBuildingBlock);
     }
 }
 public void Handle(RemovedEvent eventToHandle)
 {
     if (_passiveTransports == null)
     {
         return;
     }
     if (eventToHandle.RemovedObjects.Any(removedObject => removedObject.IsAnImplementationOf <ITransportBuilder>()))
     {
         refresh(_passiveTransports);
     }
 }
예제 #12
0
        /// <summary>
        /// Смотри <see cref="IDataset.Remove"/>
        /// </summary>
        public void Remove(int index)
        {
            var value = _DataSet[index];

            _DataSet.RemoveAt(index);
            value.EventChanged -= DatasetItemOnEventChanged;

            RemovedEvent?.Invoke(this, index, value);

            ApplyDatasetElement();
        }
 public void Handle(RemovedEvent eventToHandle)
 {
     if (_applicationBuilder == null)
     {
         return;
     }
     if (eventToHandle.RemovedObjects.Any(removedObject => removedObject.IsAnImplementationOf <IApplicationMoleculeBuilder>()))
     {
         Edit(_applicationBuilder);
     }
 }
예제 #14
0
        public void Handle(RemovedEvent eventToHandle)
        {
            var removedObjects = eventToHandle.RemovedObjects.ToList();

            if (!removedObjects.Any(ShouldHandleRemovedEvent))
            {
                return;
            }

            refresh();
        }
예제 #15
0
        public void Handle(RemovedEvent eventToHandle)
        {
            if (_spatialStructure == null)
            {
                return;
            }

            foreach (var objectBase in eventToHandle.RemovedObjects.OfType <IEntity>())
            {
                _view.Remove(_objectBaseMapper.MapFrom(objectBase));
            }
        }
        public void Handle(RemovedEvent eventToHandle)
        {
            if (_disableEventsForHeavyWork)
            {
                return;
            }

            if (eventToHandle.RemovedObjects.Any(shouldHandleType))
            {
                refresh(_moleculeBuildingBlock);
            }
        }
예제 #17
0
        public void Handle(RemovedEvent eventToHandle)
        {
            if (_eventGroupBuildingBlock == null)
            {
                return;
            }

            if (!eventToHandle.RemovedObjects.Any(shouldShow))
            {
                return;
            }

            Edit(_eventGroupBuildingBlock);
        }
예제 #18
0
        public void Handle(RemovedEvent eventToHandle)
        {
            if (!eventToHandle.RemovedObjects.Any(isShowableType))
            {
                return;
            }

            //If only a Application Molecule Builder is removed we do not need to update the edit presenter
            if (eventToHandle.RemovedObjects.Count() != 1 ||
                !eventToHandle.RemovedObjects.First().IsAnImplementationOf <IApplicationMoleculeBuilder>())
            {
                setupEditPresenterFor(_eventGroupBuildingBlock.FirstOrDefault());
            }
        }
예제 #19
0
        public void Handle(RemovedEvent eventToHandle)
        {
            if (_editObserverPresenter != null)
            {
                if (eventToHandle.RemovedObjects.Select(objects => objects.Id).Contains(((IObserverBuilder)_editObserverPresenter.Subject).Id))
                {
                    Edit(_subject);
                }
            }

            if (eventToHandle.RemovedObjects.Select(objects => objects.Id).Contains(_subject.Id))
            {
                _view.CloseView();
            }
        }
예제 #20
0
        public void Handle(RemovedEvent eventToHandle)
        {
            if (_disableEventsForHeavyWork)
            {
                return;
            }

            if (MoleculeBuildingBlock == null)
            {
                return;
            }
            if (eventToHandle.RemovedObjects.Any(canHandle))
            {
                Edit(MoleculeBuildingBlock);
            }
        }
예제 #21
0
        public void Handle(RemovedEvent eventToHandle)
        {
            if (_disableEventsForHeavyWork)
            {
                return;
            }

            if (_cache == null)
            {
                return;
            }
            if (!Equals(eventToHandle.Parent, _buildingBlock))
            {
                return;
            }

            Edit(_buildingBlock);
        }
예제 #22
0
        public override Task ExecuteAsync(string receiver, WebHookHandlerContext context)
        {
            if (receiver.ToLower() == Properties.Settings.Default.WebhookRecieverClient.ToLower())
            {
                JObject       content           = context.GetDataOrDefault <JObject>();
                var           serializedContent = JsonConvert.SerializeObject(content);
                var           util           = new JsonUtilities();
                var           action         = util.GetFirstInstance <string>("action", serializedContent);
                var           actionUser     = content["sender"]["login"].Value <string>(); //Get the user performing the action
                var           owner          = content["repository"]["owner"]["login"].Value <string>();
                var           repositoryName = util.GetFirstInstance <string>("name", serializedContent);
                var           taggedUser     = ConfigurationManager.AppSettings["Assignees"];
                IWebhookEvent webhookEvent   = null;

                switch (action.ToLower())
                {
                case "deleted":
                    webhookEvent = new DeleteEvent(repositoryName, actionUser, action, taggedUser);
                    break;

                case "created":
                    webhookEvent = new CreatedEvent(repositoryName, actionUser, action, taggedUser);
                    break;

                case "added":
                    webhookEvent = new RemovedEvent(repositoryName, actionUser, action, taggedUser);
                    webhookEvent.EditRepository(repositoryName, owner, actionUser);
                    break;

                default:
                    break;
                }

                if (webhookEvent != null)
                {
                    return(webhookEvent.CreateRepositoryIssue());
                }
            }

            return(Task.FromResult(true));
        }
예제 #23
0
 public void Handle(RemovedEvent eventToHandle)
 {
     notificationsReferencing(eventToHandle.RemovedObjects.ToList()).Each(removeNotification);
     updateNotificationCount();
 }
 public void Handle(RemovedEvent eventToHandle)
 {
     RemoveNodesFor(eventToHandle.RemovedObjects);
 }
예제 #25
0
 private void Ss_Removed(object sender, RemovedEvent e)
 {
     this.ss.ShadowSenseDevice.Removed -= Ss_Removed;
     this.ss.ShadowSenseDevice.CloseDevice();
     this.ss.ShadowSenseDevice = null;
 }