コード例 #1
0
        public void SetDataSource(IGameFile gameFile, IEnumerable <ITagData> tags)
        {
            DataSource = gameFile;
            TagData    = tags.ToArray();

            lblFile.Text = gameFile.FileName;

            if (!string.IsNullOrEmpty(gameFile.Title))
            {
                txtTitle.Text = gameFile.Title;
            }
            else
            {
                txtTitle.Text = string.Empty;
            }
            if (!string.IsNullOrEmpty(gameFile.Author))
            {
                txtAuthor.Text = gameFile.Author;
            }
            else
            {
                txtAuthor.Text = string.Empty;
            }
            if (!string.IsNullOrEmpty(gameFile.Description))
            {
                txtDescription.Text = Util.CleanDescription(gameFile.Description);
            }
            else
            {
                txtDescription.Text = string.Empty;
            }
            if (!string.IsNullOrEmpty(gameFile.Comments))
            {
                txtComments.Text = gameFile.Comments;
            }
            else
            {
                txtComments.Text = string.Empty;
            }
            if (gameFile.ReleaseDate.HasValue)
            {
                dtRelease.Value = gameFile.ReleaseDate.Value;
            }
            else
            {
                dtRelease.Value = DateTime.Now;
            }
            if (gameFile.Rating.HasValue)
            {
                ctrlStarRating.SelectedRating = Convert.ToInt32(gameFile.Rating.Value);
            }
            else
            {
                ctrlStarRating.SelectedRating = 0;
            }

            dtRelease.Checked = gameFile.ReleaseDate.HasValue;

            lblTags.Text = string.Join(", ", tags.Select(x => x.Name).ToArray());
        }
コード例 #2
0
        public void SetDescription(string text)
        {
            txtDescription.Clear();
            txtDescription.Visible = false;

            txtDescription.Text = Util.CleanDescription(text);

            txtDescription.Visible = true;
        }