Beispiel #1
0
        private void buttonDuplicateAttRule_Click(object sender, EventArgs e)
        {
            var r = EditorTools.GetSelectedDtoFromTable <AttributionRuleDTO>(this.dataGridViewAttributionRules);

            if (r != null)
            {
                var newRule = LoadedAsset.AddAttributionRule(r);
                attributionRules.DataSource = LoadedAsset.GetAttributionRules().ToList();
                EditorTools.HighlightItemInGrid <AttributionRuleDTO>(dataGridViewAttributionRules, newRule.Id);
                SetModified();
            }
        }
Beispiel #2
0
        private void auxAddOrUpdateItem(AttributionRuleDTO item)
        {
            var diag = new AddOrEditAttributionRuleForm(LoadedAsset, item);

            diag.ShowDialog(this);
            if (diag.UpdatedGuid != Guid.Empty)
            {
                attributionRules.DataSource = LoadedAsset.GetAttributionRules().ToList();
                EditorTools.HighlightItemInGrid <AttributionRuleDTO>(dataGridViewAttributionRules, diag.UpdatedGuid);
            }
            SetModified();
        }
Beispiel #3
0
        private void buttonRemoveAttRule_Click(object sender, EventArgs e)
        {
            var selRows = dataGridViewAttributionRules.SelectedRows;

            if (selRows.Count == 0)
            {
                return;
            }
            foreach (var r in selRows.Cast <DataGridViewRow>())
            {
                var dto = ((ObjectView <AttributionRuleDTO>)r.DataBoundItem).Object;
                LoadedAsset.RemoveAttributionRuleById(dto.Id);
            }
            attributionRules.DataSource = LoadedAsset.GetAttributionRules().ToList();
            EditorTools.HighlightItemInGrid <AttributionRuleDTO>(dataGridViewAttributionRules, Guid.Empty);
            SetModified();
        }
Beispiel #4
0
        protected override void OnAssetDataLoaded(SocialImportanceAsset asset)
        {
            attributionRules = new BindingListView <AttributionRuleDTO>((IList)null);
            dataGridViewAttributionRules.DataSource = this.attributionRules;

            _attRuleConditionSetEditor.View = conditions;

            conditions = new ConditionSetView();
            _attRuleConditionSetEditor.View = conditions;
            conditions.OnDataChanged       += ConditionSetView_OnDataChanged;
            attributionRules.DataSource     = LoadedAsset.GetAttributionRules().ToList();
            EditorTools.HideColumns(dataGridViewAttributionRules, new[] {
                PropertyUtil.GetPropertyName <AttributionRuleDTO>(o => o.Id),
                PropertyUtil.GetPropertyName <AttributionRuleDTO>(o => o.Conditions)
            });

            _wasModified = false;
        }