public void RequestSpaceSessions() { using (var context = new ExodusPrototype1Entities()) { Clients.Caller.ReceivedSpaceSessions(SpaceSessionMapper.GetDtoSpaceSessionListFromEntSpaceSessionList(context.SpaceSessions)); } }
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; }
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; }
private void SpaceSessionAdded(SpaceSessionDto spaceSession) { Device.BeginInvokeOnMainThread(() => { var matchingDigitalWall = this._profile.DigitalWalls.FirstOrDefault(w => w.WallId == spaceSession.DigitalWallId); this._profile.SpaceSessions.Add(SpaceSessionMapper.GetMcSpaceSessionFromMcDigitalWallAndDtoSpaceSession(matchingDigitalWall, spaceSession)); }); }
public async Task <int> AddSpaceSession(UcSpaceSession spaceSession, int digitalWallId) { SpaceSessionDto newSession = SpaceSessionMapper.GetDtoSpaceSessionFromUcSpaceSession(spaceSession); newSession.DigitalWallId = digitalWallId; int id = await HubProxy.Invoke <int>("AddSpaceSession", newSession); return(id); }
private void SpaceSessionAdded(SpaceSessionDto spaceSession) { var context = SynchronizationContext.Current; App.Current.Dispatcher.Invoke((Action) delegate { var matchingDigitalWall = this._profile.DigitalWalls.FirstOrDefault(w => w.WallId == spaceSession.DigitalWallId); this._profile.SpaceSessions.Add(SpaceSessionMapper.GetDcSpaceSessionFromDcDigitalWallAndDtoSpaceSession(matchingDigitalWall, spaceSession)); }); }
public int AddSpaceSession(Common.Data.Models.SpaceSessionDto spaceSession) { using (var context = new ExodusPrototype1Entities()) { var newSpaceSessionEnt = SpaceSessionMapper.GetEntSpaceSessionFromDtoSpaceSession(spaceSession); context.SpaceSessions.Add(newSpaceSessionEnt); context.SaveChanges(); Clients.All.SpaceSessionAdded(SpaceSessionMapper.GetDtoSpaceSessionFromEntSpaceSession(newSpaceSessionEnt)); this.WriteToWindowConsole($"Client: {Context.ConnectionId} - Added Space Session With Id: {newSpaceSessionEnt.Id} and Name: {newSpaceSessionEnt.Session.Name}"); return(newSpaceSessionEnt.Id); } }
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; }
private void SpaceSessionAdded(SpaceSessionDto spaceSession) { var matchingDigitalWall = this._profile.DigitalWalls.FirstOrDefault(w => w.WallId == spaceSession.DigitalWallId); this._profile.SpaceSessions.Add(SpaceSessionMapper.GetUcSpaceSessionFromUcDigitalWallAndDtoSpaceSession(matchingDigitalWall, spaceSession)); }