private void RefreshEventList() { var ds = (DataSet)dataGridViewEventTemplates.DataSource; ds.Tables[0].Clear(); foreach (var a in LoadedAsset.GetAllActions()) { var aName = a.Item1; var aPriority = a.Item2; ds.Tables[0].Rows.Add(aName.GetNTerm(3), aName.GetNTerm(2), aName.GetNTerm(4), aPriority); } if (_wm.GetAllEventEffects().Count > 0) { button1.Enabled = true; button2.Enabled = true; buttonRemoveAttRule.Enabled = true; buttonEditAttRule.Enabled = true; button4.Enabled = true; addEffectDTO.Enabled = true; } RefreshEffects(); }
private void button3_Click(object sender, EventArgs e) // Duplicate Action { var index = dataGridViewEventTemplates.SelectedRows[0].Index; var eventTemp = LoadedAsset.GetAllActions().ElementAt(index).Item1; //Cant add events with the same name so I have to rework their variables string newActionName = "Duplicate" + eventTemp.GetNTerm(3).ToString(); var newEventTemp = WellFormedNames.Name.BuildName( (Name)AMConsts.EVENT, (Name)"Action-End", eventTemp.GetNTerm(2), (Name)newActionName, eventTemp.GetNTerm(4)); var priority = LoadedAsset.GetAllActions().ElementAt(index).Item2; LoadedAsset.addActionTemplate((Name)newEventTemp, priority); LoadedAsset.AddActionEffects((Name)newEventTemp, LoadedAsset.GetAllEventEffects()[eventTemp].ToList()); SetModified(); RefreshEventList(); }
private void buttonRemoveAttRule_Click(object sender, EventArgs e) { var index = dataGridViewEventTemplates.SelectedRows[0].Index; var actionTemp = LoadedAsset.GetAllActions().ElementAt(index).Item1; LoadedAsset.RemoveAction(actionTemp); SetModified(); RefreshEventList(); }
private void addEffectDTO_Click(object sender, EventArgs e) { var index = dataGridViewEventTemplates.SelectedRows[0].Index; var eventTemp = LoadedAsset.GetAllActions().ElementAt(index); var ef = new AddorEditEffect(LoadedAsset, eventTemp.Item1, -1, new EffectDTO()); ef.ShowDialog(this); SetModified(); dataGridViewEventTemplates_SelectionChanged(sender, e); RefreshEventList(); }
private void buttonEditAttRule_Click(object sender, EventArgs e) { var index = dataGridViewEventTemplates.SelectedRows[0].Index; var actionTemp = LoadedAsset.GetAllActions().ElementAt(index).Item1; var priority = LoadedAsset.GetAllActions().ElementAt(index).Item2; var ev = new AddOrEditActionTemplateForm(LoadedAsset, actionTemp, priority); ev.ShowDialog(this); SetModified(); RefreshEventList(); }
private void button1_Click(object sender, EventArgs e) // Duplicate Effect { var index = dataGridViewEventTemplates.SelectedRows[0].Index; var eventTemp = LoadedAsset.GetAllActions().ElementAt(index).Item1; var index2 = dataGridViewEffects.SelectedRows[0].Index; var effect = LoadedAsset.GetAllEventEffects()[eventTemp].ElementAt(index2); LoadedAsset.AddActionEffect(eventTemp, effect.ToDTO()); SetModified(); dataGridViewEventTemplates_SelectionChanged(sender, e); }
private void button2_Click(object sender, EventArgs e) // Edit Effect { var index2 = -1; var index = dataGridViewEventTemplates.SelectedRows[0].Index; var actionTemp = LoadedAsset.GetAllActions().ElementAt(index).Item1; index2 = dataGridViewEffects.SelectedRows[0].Index; var effect = LoadedAsset.GetAllEventEffects()[actionTemp].ElementAt(index2); var ef = new AddorEditEffect(LoadedAsset, actionTemp, index2, effect.ToDTO()); ef.ShowDialog(this); SetModified(); dataGridViewEventTemplates_SelectionChanged(sender, e); }