/// <summary> /// Posts refresh messages to the ancestors of the specified entityToken /// </summary> /// <param name="childEntityToken"></param> /// <param name="parentLevel">1 means the first parent, 2 means the second, etc.</param> public void PostRefreshMessages(EntityToken childEntityToken, int parentLevel = 1) { Verify.ArgumentNotNull(childEntityToken, "childEntityToken"); if (_postRefreshMessagesCalled) { throw new InvalidOperationException("Only one PostRefreshMessages call is allowed"); } _postRefreshMessagesCalled = true; RelationshipGraph relationshipGraph = new RelationshipGraph(childEntityToken, RelationshipGraphSearchOption.Both); var levels = relationshipGraph.Levels.Evaluate(); if (levels.Count <= parentLevel) { return; } RelationshipGraphLevel relationshipGraphLevel = levels.ElementAt(parentLevel); IManagementConsoleMessageService messageService = _flowControllerServicesContainer.GetService <IManagementConsoleMessageService>(); foreach (EntityToken entityToken in relationshipGraphLevel.AllEntities) { messageService.RefreshTreeSection(entityToken); Log.LogVerbose(this.GetType().Name, "Refreshing EntityToken: Type = {0}, Source = {1}, Id = {2}, EntityTokenType = {3}", entityToken.Type, entityToken.Source, entityToken.Id, entityToken.GetType()); } }
/// <exclude /> public void PostRefreshMessages(EntityToken specificEntityToken) { Verify.ArgumentNotNull(specificEntityToken, "specificEntityToken"); if (_postRefreshMessagesCalled) { throw new InvalidOperationException("Only one PostRefreshMessages call is allowed"); } IManagementConsoleMessageService messageService = _flowControllerServicesContainer.GetService <IManagementConsoleMessageService>(); messageService.RefreshTreeSection(specificEntityToken); Log.LogVerbose(GetType().Name, "Refreshing EntityToken: Type = {0}, Source = {1}, Id = {2}, EntityTokenType = {3}", specificEntityToken.Type, specificEntityToken.Source, specificEntityToken.Id, specificEntityToken.GetType()); }
/// <exclude /> public void PostRefreshMessages(bool skipBeforeDeleteEntityToken = false) { if (_postRefreshMessagesCalled) { throw new InvalidOperationException("Only one PostRefreshMessages call is allowed"); } _postRefreshMessagesCalled = true; IManagementConsoleMessageService messageService = _flowControllerServicesContainer.GetService <IManagementConsoleMessageService>(); foreach (EntityToken entityToken in RefreshDeleteEntityTokenFinder.FindEntityTokens(_beforeGraph, skipBeforeDeleteEntityToken)) { messageService.RefreshTreeSection(entityToken); } }
/// <exclude /> public void PostRefreshMesseges(EntityToken newChildEntityToken) { Verify.ArgumentNotNull(newChildEntityToken, "newChildEntityToken"); Verify.That(!_postRefreshMessegesCalled, "Only one PostRefreshMesseges call is allowed"); _postRefreshMessegesCalled = true; _afterGraph = new RelationshipGraph(newChildEntityToken, RelationshipGraphSearchOption.Both, false, false); IManagementConsoleMessageService messageService = _flowControllerServicesContainer.GetService <IManagementConsoleMessageService>(); foreach (EntityToken entityToken in RefreshBeforeAfterEntityTokenFinder.FindEntityTokens(_beforeGraph, _afterGraph)) { messageService.RefreshTreeSection(entityToken); Log.LogVerbose("AddNewTreeRefresher", string.Format("Refreshing EntityToken: Type = {0}, Source = {1}, Id = {2}, EntityTokenType = {3}", entityToken.Type, entityToken.Source, entityToken.Id, entityToken.GetType())); } }
/// <exclude /> public void PostRefreshMessages(bool skipBeforeDeleteEntityToken = false) { if (_postRefreshMessagesCalled) { throw new InvalidOperationException("Only one PostRefreshMessages call is allowed"); } _postRefreshMessagesCalled = true; IManagementConsoleMessageService messageService = _flowControllerServicesContainer.GetService <IManagementConsoleMessageService>(); foreach (EntityToken entityToken in RefreshDeleteEntityTokenFinder.FindEntityTokens(_beforeGraph, skipBeforeDeleteEntityToken)) { messageService.RefreshTreeSection(entityToken); Log.LogVerbose(this.GetType().Name, "Refreshing EntityToken: Type = {0}, Source = {1}, Id = {2}, EntityTokenType = {3}", entityToken.Type, entityToken.Source, entityToken.Id, entityToken.GetType()); } }
/// <exclude /> public void PostRefreshMessages(EntityToken afterUpdateEntityToken) { if (_postRefreshMessagesCalled) { throw new InvalidOperationException("Only one PostRefreshMessages call is allowed"); } _postRefreshMessagesCalled = true; _afterGraph = new RelationshipGraph(afterUpdateEntityToken, RelationshipGraphSearchOption.Both, false, false); IManagementConsoleMessageService messageService = _flowControllerServicesContainer.GetService <IManagementConsoleMessageService>(); foreach (EntityToken entityToken in RefreshBeforeAfterEntityTokenFinder.FindEntityTokens(_beforeGraph, _afterGraph)) { messageService.RefreshTreeSection(entityToken); Log.LogVerbose(this.GetType().Name, "Refreshing EntityToken: Type = {0}, Source = {1}, Id = {2}, EntityTokenType = {3}", entityToken.Type, entityToken.Source, entityToken.Id, entityToken.GetType()); } }