protected override int AddNewData() { m_behaviorInstanceDefinition = DataManager.Generate<BehaviorInstanceDefinition>(); m_behaviorInstanceDefinition.Name = m_textBox_name.Text; m_behaviorInstanceDefinition.EntityInstanceDefinition = m_comboBox_entityInstanceDefinition.SelectedItem as EntityInstanceDefinition; m_behaviorInstanceDefinition.BehaviorFile = m_textBox_behaviorFile.Text; m_behaviorInstanceDefinition.BehaviorConstructor = m_textBlock_behaviorConstructor.Text; DataManager.BehaviorInstanceDefinitions.Add(m_behaviorInstanceDefinition); return m_behaviorInstanceDefinition.Id; }
public UserControl_BehaviorInstanceDefinition(BehaviorInstanceDefinition behaviorInstanceDefinition) : base("Behavior Instance Definition", false) { m_behaviorInstanceDefinition = behaviorInstanceDefinition; if (DataIsNull()) { m_textBlock_id.Text = "N/A"; m_textBox_name.Text = string.Empty; m_comboBox_entityInstanceDefinition.SelectedItem = null; m_textBox_behaviorFile.Text = string.Empty; m_textBlock_behaviorConstructor.Text = string.Empty; } else { m_textBlock_id.Text = m_behaviorInstanceDefinition.Id.ToString(); m_textBox_name.Text = m_behaviorInstanceDefinition.Name; m_comboBox_entityInstanceDefinition.SelectedItem = m_behaviorInstanceDefinition.EntityInstanceDefinition; m_textBox_behaviorFile.Text = m_behaviorInstanceDefinition.BehaviorFile; m_textBlock_behaviorConstructor.Text = m_behaviorInstanceDefinition.BehaviorConstructor; } }
private void Select(BehaviorInstanceDefinition behaviorInstanceDefinition) { RemoveUserControl(); m_userControl_behaviorInstanceDefinition = new UserControl_BehaviorInstanceDefinition(behaviorInstanceDefinition); m_grid_main.SetRowColumn(m_userControl_behaviorInstanceDefinition, 1, 0); }