/// <summary> /// GET Verb /// Poll results /// </summary> /// <param name="Token"></param> public ArtifactsList GetResults(String Token) { var guidHndlr = GUIDHandler.Init(); var curGuid = new Guid(Token); bool bExist = guidHndlr.FindGuid(curGuid); if (!bExist) { WebOperationContext.Current.OutgoingResponse.StatusCode = HttpStatusCode.NotFound; Logger.WriteLogEntry(TraceEventType.Error, "Patterns Add On Service, Patterns Service, Get Results", "GUID not found"); return(ArtifactsList.GetEmptyList()); } var session = guidHndlr.GetSession(curGuid); if (session == null) { WebOperationContext.Current.OutgoingResponse.StatusCode = HttpStatusCode.NoContent; Logger.WriteLogEntry(TraceEventType.Error, "Patterns Add On Service, Patterns Service, Get Results", "Couldn't find session"); return(ArtifactsList.GetEmptyList()); } session.LastResultRequest = DateTime.Now; var listToRet = ArtifactsList.GetList(session); Logger.WriteLogEntry(TraceEventType.Information, "Patterns Add On Service, Patterns Service, Get Results", "Results sent"); Logger.WriteLogEntry(TraceEventType.Verbose, "Patterns Add On Service, Patterns Service, Get Results", "Results sent for GUID: " + curGuid.ToString()); return(listToRet); }
internal override void AfterLoad(World world) { base.AfterLoad(world); _artifactSearch = new ArtifactsList(World); _writtenContentSearch = new WrittenContentList(World); _danceFormSearch = new DanceFormsList(World); _musicalFormSearch = new MusicalFormsList(World); _poeticFormSearch = new PoeticFormsList(World); var writtencontents = from writtenContent in World.WrittenContents orderby writtenContent.Type.GetDescription() group writtenContent by writtenContent.Type.GetDescription() into writtenContentType select writtenContentType; var artifactTypes = World.Artifacts.Select(x => x.Type).SkipWhile(string.IsNullOrEmpty).Distinct().OrderBy(x => x); var artifactMaterials = World.Artifacts.Select(x => string.IsNullOrEmpty(x.Material) ? "" : x.Material).SkipWhile(string.IsNullOrEmpty).Distinct().OrderBy(x => x); cmbWrittenContentType.Items.Add("All"); cmbWrittenContentType.SelectedIndex = 0; foreach (var writtencontent in writtencontents) { cmbWrittenContentType.Items.Add(writtencontent.Key); } cbmArtTypeFilter.Items.Add("All"); cbmArtTypeFilter.SelectedIndex = 0; cbmArtTypeFilter.Items.AddRange(artifactTypes.ToArray()); lblArtTypeFilter.Visible = cbmArtTypeFilter.Visible = artifactTypes.Any(); cbmArtMatFilter.Items.Add("All"); cbmArtMatFilter.SelectedIndex = 0; cbmArtMatFilter.Items.AddRange(artifactMaterials.ToArray()); lblArtMatFilter.Visible = cbmArtMatFilter.Visible = artifactMaterials.Any(); var artifactEvents = from eventType in World.Artifacts.SelectMany(artifact => artifact.Events) group eventType by eventType.Type into type select type.Key; var writtenContentEvents = from eventType in World.WrittenContents.SelectMany(element => element.Events) group eventType by eventType.Type into type select type.Key; var danceFormEvents = from eventType in World.DanceForms.SelectMany(element => element.Events) group eventType by eventType.Type into type select type.Key; var musicalFormEvents = from eventType in World.MusicalForms.SelectMany(element => element.Events) group eventType by eventType.Type into type select type.Key; var poeticFormEvents = from eventType in World.PoeticForms.SelectMany(element => element.Events) group eventType by eventType.Type into type select type.Key; TabEvents.Clear(); TabEvents.Add(artifactEvents.ToList()); TabEvents.Add(writtenContentEvents.ToList()); TabEvents.Add(danceFormEvents.ToList()); TabEvents.Add(musicalFormEvents.ToList()); TabEvents.Add(poeticFormEvents.ToList()); }
public ArtifactsListViewModel( [Import] IAuthorizationService authorizator, [Import] IArtifactsService artifactsService, [Import] IEventAggregator aggregator, [Import] IBackgroundExecutor executor) { this.authorizator = authorizator; this.aggregator = aggregator; this.executor = executor; this.artifactsService = artifactsService; aggregator.Subscribe<Project>(ScrumFactoryEvent.ViewProjectDetails, OnViewProjectDetails); AddArtifactCommand = new DelegateCommand(CanAddArtifact, AddArtifact); RemoveArtifactCommand = new DelegateCommand<string>(CanAddArtifact, RemoveArtifact); GoToLinkCommand = new DelegateCommand<string>(GoToLink); StartEditCommand = new DelegateCommand<string>(CanAddArtifact, StartEdit); View = new ArtifactsList(); View.Model = this; }