Exemplo n.º 1
0
 /// <summary>
 /// Le dialogue manager se ferme.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void DialogManager_FormClosed(object sender, FormClosedEventArgs e)
 {
     FormsManager.Instance.DialogManager.FormClosed -= new FormClosedEventHandler(DialogManager_FormClosed);
     if (!FormsManager.Instance.DialogManager.CanceledChanges)
     {
         VO_BadInteraction badInteraction = CurrentClass.BadInteractions.Find(p => p.Id == FormsManager.Instance.DialogManager.CurrentDialog.ParentObjectId);
         badInteraction.Dialog = FormsManager.Instance.DialogManager.CurrentDialog.Clone();
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Erreurs gérés en remplacant la ligne effacée par un Unknown
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void grdBadInteractions_DataError(object sender, DataGridViewDataErrorEventArgs e)
        {
            if (e.RowIndex >= 0 && e.RowIndex < grdBadInteractions.Rows.Count)
            {
                Guid id = (Guid)grdBadInteractions.Rows[e.RowIndex].Cells[0].Value;

                VO_BadInteraction badInteraction = CurrentClass.BadInteractions.Find(p => p.Id == id);
                grdBadInteractions.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = new Guid();
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Créateur de Bad Interactions
        /// </summary>
        /// <returns>Bad Interaction</returns>
        public VO_BadInteraction CreateBadInteraction()
        {
            VO_BadInteraction badInteraction = null;

            RunServiceTask(delegate
            {
                badInteraction = _Business.CreateBadInteraction();
            }, Errors.ERROR_CLASS_BADINTERACTION_CREATE);

            return(badInteraction);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Enregistrer les valeurs drop down list
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void grdBadInteractions_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0 && e.RowIndex < grdBadInteractions.Rows.Count)
            {
                Guid id = (Guid)grdBadInteractions.Rows[e.RowIndex].Cells[0].Value;

                VO_BadInteraction badInteraction = CurrentClass.BadInteractions.Find(p => p.Id == id);
                badInteraction.Action    = (Guid)grdBadInteractions.Rows[e.RowIndex].Cells[1].Value;
                badInteraction.Character = (Guid)grdBadInteractions.Rows[e.RowIndex].Cells[2].Value;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Créateur de Bad Interactions
        /// </summary>
        /// <returns>Bad Interaction</returns>
        public static VO_BadInteraction CreateBadInteraction()
        {
            //Création de l'objet
            VO_BadInteraction badInteraction = new VO_BadInteraction()
            {
                Id        = Guid.NewGuid(),
                Dialog    = CreateDialog(),
                Action    = new Guid(),
                Character = new Guid()
            };

            badInteraction.Dialog.ParentObjectId = badInteraction.Id;

            return(badInteraction);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Ajoute une "mauvaise interaction" dans la gridview
        /// </summary>
        /// <param name="badInteraction"></param>
        private void InsertBadInteraction(VO_BadInteraction badInteraction)
        {
            DataGridViewRow row = new DataGridViewRow();

            //Id
            DataGridViewTextBoxCell cellId = new DataGridViewTextBoxCell();

            cellId.Value = badInteraction.Id;

            //Action
            DataGridViewComboBoxCell cellAction = new DataGridViewComboBoxCell();

            cellAction.DisplayMember = "Title";
            cellAction.ValueMember   = "Id";
            cellAction.DataSource    = _Actions;
            cellAction.Value         = badInteraction.Action;

            //Action
            DataGridViewComboBoxCell cellCharacter = new DataGridViewComboBoxCell();

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

            //Dialog
            DataGridViewButtonCell cellDialog = new DataGridViewButtonCell();

            cellDialog.Value = GlobalConstants.CLASS_CHOOSE_DIALOG;

            //Delete
            DataGridViewButtonCell cellDelete = new DataGridViewButtonCell();

            cellDelete.Value = GlobalConstants.GRIDVIEW_DELETE;

            row.Cells.Add(cellId);
            row.Cells.Add(cellAction);
            row.Cells.Add(cellCharacter);
            row.Cells.Add(cellDialog);
            row.Cells.Add(cellDelete);
            grdBadInteractions.Rows.Add(row);
        }