mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-11-01 07:56:04 +00:00
Item > Items
This commit is contained in:
parent
a232d82ff3
commit
268161a075
2 changed files with 154 additions and 59 deletions
|
|
@ -1,4 +1,8 @@
|
||||||
using System.Collections.Generic;
|
using AideDeJeu.ViewModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
|
@ -6,8 +10,88 @@ using System.Xml;
|
||||||
namespace AideDeJeuLib
|
namespace AideDeJeuLib
|
||||||
{
|
{
|
||||||
[DataContract]
|
[DataContract]
|
||||||
public class Item
|
public class Item : IList<Item>
|
||||||
{
|
{
|
||||||
|
private List<Item> _Items;
|
||||||
|
|
||||||
|
public Item(List<Item> items)
|
||||||
|
{
|
||||||
|
_Items = items;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Item(IEnumerable<Item> items)
|
||||||
|
{
|
||||||
|
_Items = items.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Item()
|
||||||
|
{
|
||||||
|
_Items = new List<Item>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Header { get; set; }
|
||||||
|
|
||||||
|
public int Count => _Items.Count();
|
||||||
|
|
||||||
|
public bool IsReadOnly => false;
|
||||||
|
|
||||||
|
public Item this[int index] { get => _Items[index]; set => _Items[index] = value; }
|
||||||
|
|
||||||
|
public IEnumerator<Item> GetEnumerator()
|
||||||
|
{
|
||||||
|
return _Items?.GetEnumerator();
|
||||||
|
}
|
||||||
|
|
||||||
|
IEnumerator IEnumerable.GetEnumerator()
|
||||||
|
{
|
||||||
|
return _Items?.GetEnumerator();
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual FilterViewModel GetNewFilterViewModel()
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int IndexOf(Item item)
|
||||||
|
{
|
||||||
|
return _Items.IndexOf(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Insert(int index, Item item)
|
||||||
|
{
|
||||||
|
_Items.Insert(index, item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveAt(int index)
|
||||||
|
{
|
||||||
|
_Items.RemoveAt(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Add(Item item)
|
||||||
|
{
|
||||||
|
_Items.Add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Clear()
|
||||||
|
{
|
||||||
|
_Items.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Contains(Item item)
|
||||||
|
{
|
||||||
|
return _Items.Contains(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CopyTo(Item[] array, int arrayIndex)
|
||||||
|
{
|
||||||
|
_Items.CopyTo(array, arrayIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Remove(Item item)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
[DataMember]
|
[DataMember]
|
||||||
public virtual string Id { get; set; }
|
public virtual string Id { get; set; }
|
||||||
[DataMember]
|
[DataMember]
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,20 @@ using AideDeJeu.ViewModels;
|
||||||
|
|
||||||
namespace AideDeJeuLib
|
namespace AideDeJeuLib
|
||||||
{
|
{
|
||||||
public class Items : Item, IList<Item>
|
public class Items : Item //, IList<Item>
|
||||||
{
|
{
|
||||||
private List<Item> _Items;
|
public Items(List<Item> items) : base(items)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public Items(IEnumerable<Item> items) : base(items)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public Items() : base()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
/* private List<Item> _Items;
|
||||||
|
|
||||||
public Items(List<Item> items)
|
public Items(List<Item> items)
|
||||||
{
|
{
|
||||||
|
|
@ -86,6 +97,6 @@ namespace AideDeJeuLib
|
||||||
public bool Remove(Item item)
|
public bool Remove(Item item)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue