Skip to content

Commit

Permalink
Added AddRange(IEnumerable<T> items) method to the IndependentList cl…
Browse files Browse the repository at this point in the history
…asses.

Added AddContacts(IEnumerable<Contact> contacts) method to the ContactList class.
  • Loading branch information
Braster authored and Braster committed Nov 17, 2015
1 parent 5a31268 commit 926c22d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ public void AddContact(Contact contact)
_contacts.Add(contact);
}

public void AddContacts(IEnumerable<Contact> contacts)
{
_contacts.AddRange(contacts);
}

public void DeleteContact(Contact contact)
{
_contacts.Remove(contact);
Expand Down
8 changes: 7 additions & 1 deletion Portable/UpdateControls/Collections/IndependentList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace UpdateControls.Collections
{
public class IndependentList<T> : IList<T>
{
private IList<T> _list;
private List<T> _list;
private Independent _indList = new NamedIndependent(MemoizedTypeName<IndependentList<T>>.GenericName());

public IndependentList()
Expand Down Expand Up @@ -66,6 +66,12 @@ public void Add(T item)
_list.Add(item);
}

public void AddRange(IEnumerable<T> items)
{
_indList.OnSet();
_list.AddRange(items);
}

public void Clear()
{
_indList.OnSet();
Expand Down
18 changes: 12 additions & 6 deletions Universal/UpdateControls/Collections/IndependentList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace UpdateControls.Collections
{
public class IndependentList<T> : IList<T>
{
private IList<T> _list;
private List<T> _list;
private Independent _indList = new Independent();

public IndependentList()
Expand Down Expand Up @@ -60,11 +60,17 @@ public T this[int index]
}
}

public void Add(T item)
{
_indList.OnSet();
_list.Add(item);
}
public void Add(T item)
{
_indList.OnSet();
_list.Add(item);
}

public void AddRange(IEnumerable<T> items)
{
_indList.OnSet();
_list.AddRange(items);
}

public void Clear()
{
Expand Down
18 changes: 12 additions & 6 deletions WindowsForms/UpdateControls/Collections/IndependentList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace UpdateControls.Collections
{
public class IndependentList<T> : IList<T>
{
private IList<T> _list;
private List<T> _list;
private Independent _indList = new NamedIndependent(MemoizedTypeName<IndependentList<T>>.GenericName());

public IndependentList()
Expand Down Expand Up @@ -60,11 +60,17 @@ public T this[int index]
}
}

public void Add(T item)
{
_indList.OnSet();
_list.Add(item);
}
public void Add(T item)
{
_indList.OnSet();
_list.Add(item);
}

public void AddRange(IEnumerable<T> items)
{
_indList.OnSet();
_list.AddRange(items);
}

public void Clear()
{
Expand Down

0 comments on commit 926c22d

Please sign in to comment.