Exemplo n.º 1
0
        public Task AddOrUpdateScreen(IInternalScreen internalScreen)
        {
            var predicateScreen     = new Predicate <IInternalScreen>((screen) => screen.Id == internalScreen.Id);
            var internalScreenFound = InternalScreens.Find(predicateScreen);

            if (internalScreenFound != null)
            {
                UpdateScreen(internalScreenFound, internalScreen);
            }
            else
            {
                InternalScreens.Add(internalScreen);
                InternalScreensById[internalScreen.Id] = internalScreen;
            }
            return(Task.CompletedTask);
        }
Exemplo n.º 2
0
 private void UpdateScreen(IInternalScreen internalScreenToUpdate, IInternalScreen internalScreenExternal)
 {
     internalScreenToUpdate.UpdateFrom(internalScreenExternal);
 }