protected override void OnAssetDataLoaded(CommeillFautAsset asset) { this._socialExchangeList = new BindingListView <SocialExchangeDTO>((IList)null); gridSocialExchanges.DataSource = this._socialExchangeList; conditions = new ConditionSetView(); conditionSetEditorControl.View = conditions; conditions.OnDataChanged += ConditionSetView_OnDataChanged; this._socialExchangeList.DataSource = LoadedAsset.GetAllSocialExchanges().ToList(); EditorTools.HideColumns(gridSocialExchanges, new[] { PropertyUtil.GetPropertyName <SocialExchangeDTO>(dto => dto.Id), PropertyUtil.GetPropertyName <SocialExchangeDTO>(dto => dto.StartingConditions) }); if (this._socialExchangeList.Any()) { var ra = LoadedAsset.GetSocialExchange(this._socialExchangeList.First().Id); UpdateConditions(ra); } }
private void influenceRules_Click(object sender, EventArgs e) { var selectedRule = EditorTools.GetSelectedDtoFromTable <SocialExchangeDTO>(gridSocialExchanges); var newSE = new SocialExchange(selectedRule); var diag = new InfluenceRuleInspector(LoadedAsset, newSE); diag.ShowDialog(this); LoadedAsset.UpdateSocialExchange(newSE.ToDTO); _socialExchangeList.DataSource = LoadedAsset.GetAllSocialExchanges().ToList(); SetModified(); }
private void buttonDuplicateSE_Click(object sender, EventArgs e) { var r = EditorTools.GetSelectedDtoFromTable <SocialExchangeDTO>( this.gridSocialExchanges); if (r != null) { r.Id = Guid.Empty; var newRuleId = LoadedAsset.AddOrUpdateExchange(r); _socialExchangeList.DataSource = LoadedAsset.GetAllSocialExchanges().ToList(); EditorTools.HighlightItemInGrid <SocialExchangeDTO>(gridSocialExchanges, newRuleId); } }
private void buttonRemoveSE_Click(object sender, EventArgs e) { var selRows = gridSocialExchanges.SelectedRows; if (selRows.Count == 0) { return; } foreach (var r in selRows.Cast <DataGridViewRow>()) { var dto = ((ObjectView <SocialExchangeDTO>)r.DataBoundItem).Object; LoadedAsset.RemoveSocialExchange(dto.Id); } _socialExchangeList.DataSource = LoadedAsset.GetAllSocialExchanges().ToList(); EditorTools.HighlightItemInGrid <SocialExchangeDTO>(gridSocialExchanges, Guid.Empty); SetModified(); }
private void auxAddOrUpdateItem(SocialExchangeDTO item) { var diag = new AddSocialExchange(LoadedAsset, item); diag.ShowDialog(this); if (diag.UpdatedGuid != Guid.Empty) { // _socialExchangeList.DataSource = LoadedAsset.GetAllSocialExchanges().ToList(); this._socialExchangeList.DataSource = LoadedAsset.GetAllSocialExchanges().ToList(); EditorTools.HighlightItemInGrid <SocialExchangeDTO> (gridSocialExchanges, diag.UpdatedGuid); } SetModified(); }