示例#1
0
        /// <summary>
        /// Remotes the item (and the reverse too)
        /// </summary>
        /// <param name="item">The item.</param>
        protected void RemoveItem(T item)
        {
            var newElement = new ProjectionItem <T>(item, ProjectionItemActionEnum.Delete);

            this.Work.AddModifiedProjectionItem(newElement);

            if (this.ReverseEnabled)
            {
                T   reverseItem       = ReverseItem(item);
                var newReverseElement = new ProjectionItem <T>(reverseItem, ProjectionItemActionEnum.Delete);
                this.Work.AddModifiedProjectionItem(newReverseElement);
            }
        }
示例#2
0
        /// <summary>
        /// Adds the or replace item.
        /// </summary>
        /// <param name="item">The item.</param>
        protected void AddOrReplaceItem(T item)
        {
            var newElement = new ProjectionItem <T>(item, ProjectionItemActionEnum.UpdateOrNew);

            this.Work.AddModifiedProjectionItem(newElement);

            if (this.ReverseEnabled)
            {
                T reverseItem = ReverseItem(item);

                var newReverseElement = new ProjectionItem <T>(reverseItem, ProjectionItemActionEnum.UpdateOrNew);
                this.Work.AddModifiedProjectionItem(newReverseElement);
            }
        }