Exemplo n.º 1
0
 private void dataGridView_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
 {
     if ((e.ColumnIndex == Offset.Index) && (e.Value != null))
     {
         byte b = (byte)e.Value;
         e.Value             = b.ToString("X2");
         e.FormattingApplied = true;
     }
     else if (e.ColumnIndex == ActionColumn.Index)
     {
         if ((e.RowIndex >= 0) && (e.ColumnIndex >= 0) &&
             (dataGridView[e.ColumnIndex, e.RowIndex] is DataGridViewComboBoxCell) &&
             (dataGridView.Rows[e.RowIndex].DataBoundItem is ActionMenu))
         {
             ActionMenu menu = dataGridView.Rows[e.RowIndex].DataBoundItem as ActionMenu;
             if (menu.Default != null)
             {
                 ActionMenuEntry a = menu.Default.MenuAction;
                 if (a != (e.Value as ActionMenuEntry))
                 {
                     e.CellStyle.BackColor = Color.Blue;
                     e.CellStyle.ForeColor = Color.White;
                 }
             }
         }
     }
 }
        private ActionMenuEntry Dequeue()
        {
            Poolable        p     = GameObjectPoolController.Dequeue(EntryPoolKey);
            ActionMenuEntry entry = p.GetComponent <ActionMenuEntry>();

            entry.transform.SetParent(panel.transform, false);
            entry.transform.localScale = Vector3.one;
            entry.gameObject.SetActive(true);
            entry.Reset();
            return(entry);
        }
 public void Show(string title, List <string> options)
 {
     canvas.SetActive(true);
     Clear();
     titleLabel.text = title;
     for (int i = 0; i < options.Count; ++i)
     {
         ActionMenuEntry entry = Dequeue();
         entry.Title = options[i];
         menuEntries.Add(entry);
     }
     SetSelection(0);
     TogglePos(ShowKey);
 }
        private void Enqueue(ActionMenuEntry entry)
        {
            Poolable p = entry.GetComponent <Poolable>();

            GameObjectPoolController.Enqueue(p);
        }