示例#1
0
 public void RequestDigitalWalls()
 {
     using (var context = new ExodusPrototype1Entities())
     {
         Clients.Caller.ReceivedDigitalWalls(DigitalWallMapper.GetDtoDigitalWallListFromEntDigitalWallList(context.DigitalWalls));
     }
 }
示例#2
0
        public void TryProcessStartupCache()
        {
            //If we've already processed the startup cache, we don't need to.
            if (this._startupCacheProcessed)
            {
                return;
            }

            //If the startup cache does not contain all the necessary data, we can't process it yet.
            if ((this._startupCache.ContainsKey(StartupCacheKey.Sources) &&
                 this._startupCache.ContainsKey(StartupCacheKey.SourceInstances) &&
                 this._startupCache.ContainsKey(StartupCacheKey.DigitalWalls) &&
                 this._startupCache.ContainsKey(StartupCacheKey.SpaceSessions)) == false)
            {
                return;
            }

            var context = SynchronizationContext.Current;

            App.Current.Dispatcher.Invoke((Action) delegate
            {
                this._profile.Sources       = SourceMapper.GetDcSourceListFromDtoSourceList((IEnumerable <SourceDto>) this._startupCache[StartupCacheKey.Sources]);
                var sourceInstances         = SourceInstanceMapper.GetDcSourceInstanceListFromDcSourceListAndDtoSourceInstanceList(this._profile.Sources, (IEnumerable <SourceInstanceDto>) this._startupCache[StartupCacheKey.SourceInstances]);
                this._profile.DigitalWalls  = DigitalWallMapper.GetDcDigitalWallListFromDtoDigitalWallList(sourceInstances, (IEnumerable <DigitalWallDto>) this._startupCache[StartupCacheKey.DigitalWalls]);
                this._profile.SpaceSessions = SpaceSessionMapper.GetDcSpaceSessionListFromDcDigitalWallListAndDtoSpaceSessionList(this._profile.DigitalWalls, (IEnumerable <SpaceSessionDto>) this._startupCache[StartupCacheKey.SpaceSessions]);
            });

            this._startupCacheProcessed = true;
        }
示例#3
0
        public void TryProcessStartupCache()
        {
            //If we've already processed the startup cache, we don't need to.
            if (this._startupCacheProcessed)
            {
                return;
            }

            //If the startup cache does not contain all the necessary data, we can't process it yet.
            if ((this._startupCache.ContainsKey(StartupCacheKey.Sources) &&
                 this._startupCache.ContainsKey(StartupCacheKey.SourceInstances) &&
                 this._startupCache.ContainsKey(StartupCacheKey.DigitalWalls) &&
                 this._startupCache.ContainsKey(StartupCacheKey.SpaceSessions)) == false)
            {
                return;
            }

            Device.BeginInvokeOnMainThread(() =>
            {
                this._profile.Sources       = SourceMapper.GetMcSourceListFromDtoSourceList((IEnumerable <SourceDto>) this._startupCache[StartupCacheKey.Sources]);
                var sourceInstances         = SourceInstanceMapper.GetMcSourceInstanceListFromMcSourceListAndDtoSourceInstanceList(this._profile.Sources, (IEnumerable <SourceInstanceDto>) this._startupCache[StartupCacheKey.SourceInstances]);
                this._profile.DigitalWalls  = DigitalWallMapper.GetMcDigitalWallListFromDtoDigitalWallList(sourceInstances, (IEnumerable <DigitalWallDto>) this._startupCache[StartupCacheKey.DigitalWalls]);
                this._profile.SpaceSessions = SpaceSessionMapper.GetMcSpaceSessionListFromMcDigitalWallListAndDtoSpaceSessionList(this._profile.DigitalWalls, (IEnumerable <SpaceSessionDto>) this._startupCache[StartupCacheKey.SpaceSessions]);
            });

            this._startupCacheProcessed = true;
        }
示例#4
0
 private void DigitalWallAdded(DigitalWallDto digitalWall)
 {
     Device.BeginInvokeOnMainThread(() =>
     {
         this._profile.DigitalWalls.Add(DigitalWallMapper.GetMcDigitalWallFromDtoDigitalWallAndSourceInstances(digitalWall, new ObservableCollection <McSourceInstance>()));
     });
 }
示例#5
0
        private void DigitalWallAdded(DigitalWallDto digitalWall)
        {
            var context = SynchronizationContext.Current;

            App.Current.Dispatcher.Invoke((Action) delegate
            {
                this._profile.DigitalWalls.Add(DigitalWallMapper.GetDcDigitalWallFromDtoDigitalWallAndSourceInstances(digitalWall, new ObservableCollection <DcSourceInstance>()));
            });
        }
示例#6
0
        public int AddDigitalWall(Common.Data.Models.DigitalWallDto digitalWall)
        {
            using (var context = new ExodusPrototype1Entities())
            {
                var newDigitalWallEnt = DigitalWallMapper.GetEntDigitalWallFromDtoDigitalWall(digitalWall);
                context.DigitalWalls.Add(newDigitalWallEnt);
                context.SaveChanges();
                Clients.All.DigitalWallAdded(DigitalWallMapper.GetDtoDigitalWallFromEntDigitalWall(newDigitalWallEnt));

                this.WriteToWindowConsole($"Client: {Context.ConnectionId} - Added Digital Wall With Id: {newDigitalWallEnt.Id} and Name: {newDigitalWallEnt.Wall.Name}");

                return(newDigitalWallEnt.Id);
            }
        }
示例#7
0
        public void TryProcessStartupCache()
        {
            //If we've already processed the startup cache, we don't need to.
            if (this._startupCacheProcessed)
            {
                return;
            }

            //If the startup cache does not contain all the necessary data, we can't process it yet.
            if ((this._startupCache.ContainsKey(StartupCacheKey.Sources) &&
                 this._startupCache.ContainsKey(StartupCacheKey.SourceInstances) &&
                 this._startupCache.ContainsKey(StartupCacheKey.DigitalWalls) &&
                 this._startupCache.ContainsKey(StartupCacheKey.SpaceSessions)) == false)
            {
                return;
            }

            this._unityMainThreadDispatcher.Enqueue(() =>
            {
                this._profile.Sources       = SourceMapper.GetUcSourceListFromDtoSourceList((IEnumerable <SourceDto>) this._startupCache[StartupCacheKey.Sources]);
                var sourceInstances         = SourceInstanceMapper.GetUcSourceInstanceListFromUcSourceListAndDtoSourceInstanceList(this._profile.Sources, (IEnumerable <SourceInstanceDto>) this._startupCache[StartupCacheKey.SourceInstances], this._commonValues.PixelToUnityUnitScale, this._unityMainThreadDispatcher);
                this._profile.DigitalWalls  = DigitalWallMapper.GetUcDigitalWallListFromDtoDigitalWallList(sourceInstances, (IEnumerable <DigitalWallDto>) this._startupCache[StartupCacheKey.DigitalWalls], this._commonValues.PixelToUnityUnitScale, this._commonValues.WallCenter, this._unityMainThreadDispatcher);
                this._profile.SpaceSessions = SpaceSessionMapper.GetUcSpaceSessionListFromUcDigitalWallListAndDtoSpaceSessionList(this._profile.DigitalWalls, (IEnumerable <SpaceSessionDto>) this._startupCache[StartupCacheKey.SpaceSessions]);

                //If we have any digital walls, render the first.
                UcDigitalWall firstWall = this._profile.DigitalWalls.FirstOrDefault();
                if (firstWall != null)
                {
                    firstWall.Render();
                    this._profile.SelectedWall = firstWall;
                }
            });


            this._startupCacheProcessed = true;
        }
示例#8
0
 private void DigitalWallAdded(DigitalWallDto digitalWall)
 {
     this._profile.DigitalWalls.Add(DigitalWallMapper.GetUcDigitalWallFromDtoDigitalWallAndSourceInstances(digitalWall, new ObservableCollection <UcSourceInstance>(), this._commonValues.PixelToUnityUnitScale, this._commonValues.WallCenter, this._unityMainThreadDispatcher));
 }
示例#9
0
        public async Task <int> AddDigitalWall(UcDigitalWall digitalWall)
        {
            int id = await HubProxy.Invoke <int>("AddDigitalWall", DigitalWallMapper.GetDtoDigitalWallFromUcDigitalWall(digitalWall));

            return(id);
        }