public SearchResultLabel(SearchResult result)
        {
            this.DocNumber = result.Number;
            string content = SearchResultLabel.GetContent(result.Content);

            this.Content = string.Format("Confidence {0}, Document {1}: {2}", result.Confidence, result.Number, content);
        }
Esempio n. 2
0
        private int FindResultByDocNumber(int number)
        {
            for (int i = 0; i < this.Results.Children.Count; i++)
            {
                SearchResultLabel label = (SearchResultLabel)this.Results.Children[i];
                if (label.DocNumber == number)
                {
                    return(i);
                }
            }

            throw new Exception(
                      string.Format(
                          "Collection out of sync, expected to find document number {0} in it, but was unable to find it.",
                          number));
        }