コード例 #1
0
        /// <summary>
        /// Sets the information on this page from a dictionary.
        /// </summary>
        /// <param name="dictionary">The dictionary.</param>
        /// <remarks>Documented by Dev02, 2008-01-15</remarks>
        public void SetInfo(MLifter.BusinessLayer.Dictionary dictionary)
        {
            if (dictionary.DictionaryDAL.Parent.CurrentUser.ConnectionString.Typ == MLifter.DAL.DatabaseType.PostgreSQL)
            {
                textBoxDictionaryLocation.Text = GenerateDatabaseInformation(dictionary.DictionaryPath);    //dictionary.DictionaryPath;
            }
            else
            {
                textBoxDictionaryLocation.Text = dictionary.DictionaryPath;
            }

            textBoxDictionaryLocation.SelectionStart = textBoxDictionaryLocation.Text.Length - 1;
            labelNumberOfCards.Text = Convert.ToString(dictionary.Cards.Cards.Count);

            // so that "Nan %" can't be displayed ML-1764
            double score     = (double.IsNaN(dictionary.Score)) ? 0.0 : dictionary.Score;
            double highScore = (double.IsNaN(dictionary.Highscore)) ? 0.0 : dictionary.Highscore;

            labelScore.Text     = Convert.ToString(Math.Round(score, 2)) + " %";
            labelHighscore.Text = Convert.ToString(Math.Round(highScore, 2)) + " %";
            dictionary.UsedDiskSpaceComplete += new MLifter.BusinessLayer.Dictionary.UsedDiskSpaceCompleteHandler(dictionary_UsedDiskSpaceComplete);
            dictionary.UsedDiskSpaceAsync();
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InfoPage"/> class.
 /// </summary>
 /// <param name="dictionary">The dictionary.</param>
 /// <remarks>Documented by Dev02, 2008-01-15</remarks>
 public InfoPage(MLifter.BusinessLayer.Dictionary dictionary)
 {
     SetInfo(dictionary);
 }