Beispiel #1
0
        public FrmFrequencies(xTextFile xFile)
        {
            InitializeComponent();

            _xFile                   = xFile;
            lblCategory.Text        += xFile.getCategoryName();
            lblCharactersCount.Text += xFile.charactersCount.ToString();
            Text += " | " + xFile.fileName;
            lblUniqueWords.Text += xFile.uniqueWordsCount.ToString();
            lblWordCount.Text   += xFile.wordsCount.ToString();
            olvFrequencies.SetObjects(xFile.frequencies);
        }
Beispiel #2
0
        public FrmFrequencies(xTextFile xFile, string word)
        {
            InitializeComponent();

            _xFile                   = xFile;
            lblCategory.Text        += xFile.getCategoryName();
            lblCharactersCount.Text += xFile.charactersCount.ToString();
            Text += " | " + xFile.fileName;
            lblUniqueWords.Text += xFile.uniqueWordsCount.ToString();
            lblWordCount.Text   += xFile.wordsCount.ToString();
            olvFrequencies.SetObjects(xFile.frequencies);

            // Select the element
            olvFrequencies.SelectedObject = (xFile.frequencies.First(xObj => xObj.word == word));
            // Scroll to the selected element
            olvFrequencies.EnsureModelVisible((xFile.frequencies.First(xObj => xObj.word == word)));
        }