mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-31 07:26:09 +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.Text.RegularExpressions; | ||||
| using System.Xml; | ||||
|  | @ -6,8 +10,88 @@ using System.Xml; | |||
| namespace AideDeJeuLib | ||||
| { | ||||
|     [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] | ||||
|         public virtual string Id { get; set; } | ||||
|         [DataMember] | ||||
|  |  | |||
|  | @ -6,86 +6,97 @@ using AideDeJeu.ViewModels; | |||
| 
 | ||||
| namespace AideDeJeuLib | ||||
| { | ||||
|     public class Items : Item, IList<Item> | ||||
|     public class Items : Item //, IList<Item> | ||||
|     { | ||||
|         private List<Item> _Items; | ||||
| 
 | ||||
|         public Items(List<Item> items) | ||||
|         public Items(List<Item> items) : base(items) | ||||
|         { | ||||
|             _Items = items; | ||||
|         } | ||||
| 
 | ||||
|         public Items(IEnumerable<Item> items) | ||||
|         public Items(IEnumerable<Item> items) : base(items) | ||||
|         { | ||||
|             _Items = items.ToList(); | ||||
|         } | ||||
| 
 | ||||
|         public Items() | ||||
|         public Items() : base() | ||||
|         { | ||||
|             _Items = new List<Item>(); | ||||
|         } | ||||
|         /*        private List<Item> _Items; | ||||
| 
 | ||||
|         public string Header { get; set; } | ||||
|                 public Items(List<Item> items) | ||||
|                 { | ||||
|                     _Items = items; | ||||
|                 } | ||||
| 
 | ||||
|         public int Count => _Items.Count(); | ||||
|                 public Items(IEnumerable<Item> items) | ||||
|                 { | ||||
|                     _Items = items.ToList(); | ||||
|                 } | ||||
| 
 | ||||
|         public bool IsReadOnly => false; | ||||
|                 public Items() | ||||
|                 { | ||||
|                     _Items = new List<Item>(); | ||||
|                 } | ||||
| 
 | ||||
|         public Item this[int index] { get => _Items[index]; set => _Items[index] = value; } | ||||
|                 public string Header { get; set; } | ||||
| 
 | ||||
|         public IEnumerator<Item> GetEnumerator() | ||||
|         { | ||||
|             return _Items?.GetEnumerator(); | ||||
|         } | ||||
|                 public int Count => _Items.Count(); | ||||
| 
 | ||||
|         IEnumerator IEnumerable.GetEnumerator() | ||||
|         { | ||||
|             return _Items?.GetEnumerator(); | ||||
|         } | ||||
|                 public bool IsReadOnly => false; | ||||
| 
 | ||||
|         public virtual FilterViewModel GetNewFilterViewModel() | ||||
|         { | ||||
|             return null; | ||||
|         } | ||||
|                 public Item this[int index] { get => _Items[index]; set => _Items[index] = value; } | ||||
| 
 | ||||
|         public int IndexOf(Item item) | ||||
|         { | ||||
|             return _Items.IndexOf(item); | ||||
|         } | ||||
|                 public IEnumerator<Item> GetEnumerator() | ||||
|                 { | ||||
|                     return _Items?.GetEnumerator(); | ||||
|                 } | ||||
| 
 | ||||
|         public void Insert(int index, Item item) | ||||
|         { | ||||
|             _Items.Insert(index, item); | ||||
|         } | ||||
|                 IEnumerator IEnumerable.GetEnumerator() | ||||
|                 { | ||||
|                     return _Items?.GetEnumerator(); | ||||
|                 } | ||||
| 
 | ||||
|         public void RemoveAt(int index) | ||||
|         { | ||||
|             _Items.RemoveAt(index); | ||||
|         } | ||||
|                 public virtual FilterViewModel GetNewFilterViewModel() | ||||
|                 { | ||||
|                     return null; | ||||
|                 } | ||||
| 
 | ||||
|         public void Add(Item item) | ||||
|         { | ||||
|             _Items.Add(item); | ||||
|         } | ||||
|                 public int IndexOf(Item item) | ||||
|                 { | ||||
|                     return _Items.IndexOf(item); | ||||
|                 } | ||||
| 
 | ||||
|         public void Clear() | ||||
|         { | ||||
|             _Items.Clear(); | ||||
|         } | ||||
|                 public void Insert(int index, Item item) | ||||
|                 { | ||||
|                     _Items.Insert(index, item); | ||||
|                 } | ||||
| 
 | ||||
|         public bool Contains(Item item) | ||||
|         { | ||||
|             return _Items.Contains(item); | ||||
|         } | ||||
|                 public void RemoveAt(int index) | ||||
|                 { | ||||
|                     _Items.RemoveAt(index); | ||||
|                 } | ||||
| 
 | ||||
|         public void CopyTo(Item[] array, int arrayIndex) | ||||
|         { | ||||
|             _Items.CopyTo(array, arrayIndex); | ||||
|         } | ||||
|                 public void Add(Item item) | ||||
|                 { | ||||
|                     _Items.Add(item); | ||||
|                 } | ||||
| 
 | ||||
|         public bool Remove(Item item) | ||||
|         { | ||||
|             throw new NotImplementedException(); | ||||
|         } | ||||
|                 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(); | ||||
|                 }*/ | ||||
|     } | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yan Maniez
						Yan Maniez