mirror of
https://github.com/farcasclaudiu/myfriendsaround.git
synced 2026-06-29 09:01:55 +03:00
Added tag tag1 for changeset 4c285537b335
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated from a template.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
|
||||
namespace MyFriendsAround.Common.Entities
|
||||
{
|
||||
// An System.Collections.ObjectModel.ObservableCollection that raises
|
||||
// individual item removal notifications on clear and prevents adding duplicates.
|
||||
public class FixupCollection<T> : ObservableCollection<T>
|
||||
{
|
||||
protected override void ClearItems()
|
||||
{
|
||||
new List<T>(this).ForEach(t => Remove(t));
|
||||
}
|
||||
|
||||
protected override void InsertItem(int index, T item)
|
||||
{
|
||||
if (!this.Contains(item))
|
||||
{
|
||||
base.InsertItem(index, item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user