예제 #1
0
        /// <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);
        }
예제 #2
0
 private void SearchArtifactList(object sender, EventArgs e)
 {
     if (!FileLoader.Working && World != null)
     {
         _artifactSearch.Name               = txtArtifactSearch.Text;
         _artifactSearch.SortEvents         = radArtifactSortEvents.Checked;
         _artifactSearch.SortFiltered       = radArtifactSortFiltered.Checked;
         _artifactSearch.Type               = cbmArtTypeFilter.SelectedIndex == 0 ? null : cbmArtTypeFilter.SelectedItem.ToString();
         _artifactSearch.Material           = cbmArtMatFilter.SelectedIndex == 0 ? null : cbmArtMatFilter.SelectedItem.ToString();
         _artifactSearch.ShowWrittenContent = chkWrittenContent.Checked;
         IEnumerable <Artifact> list = _artifactSearch.GetList();
         var results = list.ToArray();
         listArtifactSearch.SetObjects(results);
         UpdateCounts(lblArtifactResults, results.Length, _artifactSearch.BaseList.Count);
     }
 }