Exemplo n.º 1
0
 private void SourceInstanceAdded(SourceInstanceDto sourceInstance)
 {
     Device.BeginInvokeOnMainThread(() =>
     {
         var matchingSource    = this._profile.Sources.FirstOrDefault(s => s.SourceId == sourceInstance.SourceId);
         var newSourceInstance = SourceInstanceMapper.GetMcSourceInstanceFromMcSourceAndDtoSourceInstance(matchingSource, sourceInstance);
         var matchingWall      = this._profile.DigitalWalls.FirstOrDefault(w => w.WallId == newSourceInstance.WallId);
         matchingWall.SourceInstances.Add(newSourceInstance);
     });
 }
Exemplo n.º 2
0
        private void SourceInstanceModified(SourceInstanceDto sourceInstance)
        {
            Device.BeginInvokeOnMainThread(() =>
            {
                var matchingWall           = this._profile.DigitalWalls.FirstOrDefault(w => w.WallId == sourceInstance.WallId);
                var matchingSourceInstance = matchingWall?.SourceInstances.FirstOrDefault(s => s.SourceInstanceId == sourceInstance.Id);

                var toCopy = SourceInstanceMapper.GetMcSourceInstanceFromMcSourceAndDtoSourceInstance((McSource)matchingSourceInstance, sourceInstance);

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