Esempio n. 1
0
        private void SourceInstanceAdded(SourceInstanceDto sourceInstance)
        {
            var context = SynchronizationContext.Current;

            App.Current.Dispatcher.Invoke((Action) delegate
            {
                var matchingSource    = this._profile.Sources.FirstOrDefault(s => s.SourceId == sourceInstance.SourceId);
                var newSourceInstance = SourceInstanceMapper.GetDcSourceInstanceFromDcSourceAndDtoSourceInstance(matchingSource, sourceInstance);
                var matchingWall      = this._profile.DigitalWalls.FirstOrDefault(w => w.WallId == newSourceInstance.WallId);
                matchingWall.SourceInstances.Add(newSourceInstance);
            });
        }
Esempio n. 2
0
        private void SourceInstanceModified(SourceInstanceDto sourceInstance)
        {
            var context = SynchronizationContext.Current;

            App.Current.Dispatcher.Invoke((Action) delegate
            {
                var matchingWall           = this._profile.DigitalWalls.FirstOrDefault(w => w.WallId == sourceInstance.WallId);
                var matchingSourceInstance = matchingWall?.SourceInstances.FirstOrDefault(s => s.SourceInstanceId == sourceInstance.Id);

                var toCopy = SourceInstanceMapper.GetDcSourceInstanceFromDcSourceAndDtoSourceInstance((DcSource)matchingSourceInstance, sourceInstance);

                matchingSourceInstance.X      = toCopy.X;
                matchingSourceInstance.Y      = toCopy.Y;
                matchingSourceInstance.Width  = toCopy.Width;
                matchingSourceInstance.Height = toCopy.Height;
                matchingSourceInstance.WallId = toCopy.WallId;
            });
        }