/// <inheritdoc /> public override object Clone() { DataGridViewDisableCheckBoxCell cell = (DataGridViewDisableCheckBoxCell)base.Clone(); cell.Enabled = Enabled; return(cell); }
/// <inheritdoc /> public void ShowSettings(DataGridViewRowCollection rows) { row = new DataGridViewRow(); DataGridViewDisableCheckBoxCell visibleCell = new DataGridViewDisableCheckBoxCell() { Value = VariableNodeSocket.Visible, Enabled = VariableNodeSocket.Connections.Count == 0 }; visibleCell.ValueChanged += (object sender, EventArgs e) => { VariableNodeSocket.Visible = (bool)visibleCell.Value; if (!VariableNodeSocket.Visible && VariableNodeSocket.Connections.Count != 0) { VariableNodeSocket.Visible = true; } else { Node.Refresh(); } }; row.Cells.Add(visibleCell); row.Cells.Add(new DataGridViewTextBoxCell() { Value = VariableNodeSocket.Name }); // variable in if (VariableNodeSocket.Type == NodeSocketType.VariableIn) { if (VariableNodeSocket.Connections.Count == 0) { // edit value if (!VariableNodeSocket.NodeSocketData.CanBeEmpty) { row.Cells.Add(VariableNodeSocket.Value.GetGridCell()); } // only connection is possible else { row.Cells.Add(new DataGridViewTextBoxCell() { Value = "(connection-only)" }); row.Cells[row.Cells.Count - 1].ReadOnly = true; } } // socket used else { row.Cells.Add(new DataGridViewTextBoxCell() { Value = "(socket used)" }); row.Cells[row.Cells.Count - 1].ReadOnly = true; } } // variable out else { row.Cells.Add(new DataGridViewTextBoxCell() { Value = "(read-only)" }); row.Cells[row.Cells.Count - 1].ReadOnly = true; } row.Cells.Add(new DataGridViewTextBoxCell() { Value = VariableTypeHelper.FriendlyName(VariableNodeSocket.VariableType) }); rows.Add(row); }