Exemple #1
0
        /// <summary>
        /// Insére un message dans la gridview
        /// </summary>
        /// <param name="message">VO_Message</param>
        private void InsertMessage(VO_Message message)
        {
            DataGridViewRow row = new DataGridViewRow();

            //Id
            DataGridViewTextBoxCell cellId = new DataGridViewTextBoxCell();

            cellId.Value = message.Id;

            //Text
            DataGridViewTextBoxCell cellText = new DataGridViewTextBoxCell();

            cellText.Value = message.Text;
            //Character
            DataGridViewComboBoxCell cellCharacter = new DataGridViewComboBoxCell();

            cellCharacter.DisplayMember = "Title";
            cellCharacter.ValueMember   = "Id";
            cellCharacter.DataSource    = _Characters;
            cellCharacter.Value         = message.Character;

            //Duration
            DataGridViewComboBoxCell cellDuration = new DataGridViewComboBoxCell();

            cellDuration.DisplayMember = "Title";
            cellDuration.ValueMember   = "Id";
            cellDuration.DataSource    = FormsTools.GetMessageDurationList();
            cellDuration.Value         = message.Duration;

            //FontSize
            DataGridViewComboBoxCell cellFontSize = new DataGridViewComboBoxCell();

            cellFontSize.DisplayMember = "Title";
            cellFontSize.ValueMember   = "Id";
            cellFontSize.DataSource    = FormsTools.GetMessageFontSizeList();
            cellFontSize.Value         = message.FontSize;

            //Sound
            DataGridViewButtonCell cellSound = new DataGridViewButtonCell();

            cellSound.Value = GlobalConstants.BUTTON_SOUND;

            row.Cells.Add(cellId);
            row.Cells.Add(cellText);
            row.Cells.Add(cellCharacter);
            row.Cells.Add(cellDuration);
            row.Cells.Add(cellFontSize);
            row.Cells.Add(cellSound);
            grdDialog.Rows.Add(row);
        }
 /// <summary>
 /// Constructeur principal
 /// </summary>
 public GeneralSettings()
 {
     InitializeComponent();
     ddpMessageDuration.Minimum                 = GlobalConstants.DIALOG_MIN_DURATION;
     ddpMessageDuration.Maximum                 = GlobalConstants.DIALOG_MAX_DURATION;
     ddpMessageFontSize.DataSource              = FormsTools.GetMessageFontSizeList();
     ddpMessageFontSize.DisplayMember           = "Title";
     ddpMessageFontSize.ValueMember             = "Id";
     ddpStagePadding.Minimum                    = 0;
     ddpStagePadding.Maximum                    = GlobalConstants.STAGE_PADDING_LIMIT;
     ddpVectorPointsSize.Minimum                = 1;
     ddpVectorPointsSize.Maximum                = 10;
     ddpAnimationDefaultFrequency.DataSource    = FormsTools.GetAnimationFrequencyList();
     ddpAnimationDefaultFrequency.DisplayMember = "Title";
     ddpAnimationDefaultFrequency.ValueMember   = "Id";
     ddpTransparentBlockSize.Items.Add(8);
     ddpTransparentBlockSize.Items.Add(16);
     ddpTransparentBlockSize.Items.Add(32);
 }