Esempio n. 1
0
            protected override void OnRemove(int index)
            {
                UxRemoveAttributeChange change = null;
                var changed = Container.Changed;

                if (changed != null)
                {
                    var item = this[index];
                    change = new UxRemoveAttributeChange(item.Parent.NodePath, item.AttributeIndex, item.Syntax);
                }

                base.OnRemove(index);

                if (change != null)
                {
                    changed(change);
                }
            }
Esempio n. 2
0
            protected override void OnReplace(int index, UxAttribute item)
            {
                var changed = Container.Changed;
                UxRemoveAttributeChange change = null;

                if (changed != null)
                {
                    var oldItem = this[index];
                    change = new UxRemoveAttributeChange(oldItem.Parent.NodePath, oldItem.AttributeIndex, oldItem.Syntax);
                }

                base.OnReplace(index, item);

                if (change != null)
                {
                    var insertedItemSyntax = item.Syntax;
                    changed(change);
                    changed(new UxInsertAttributeChange(change.NodePath, change.AttributeIndex, insertedItemSyntax));
                }
            }