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.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,86 +6,97 @@ 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(List<Item> 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() |                 public int Count => _Items.Count(); | ||||||
|         { |  | ||||||
|             return _Items?.GetEnumerator(); |  | ||||||
|         } |  | ||||||
| 
 | 
 | ||||||
|         IEnumerator IEnumerable.GetEnumerator() |                 public bool IsReadOnly => false; | ||||||
|         { |  | ||||||
|             return _Items?.GetEnumerator(); |  | ||||||
|         } |  | ||||||
| 
 | 
 | ||||||
|         public virtual FilterViewModel GetNewFilterViewModel() |                 public Item this[int index] { get => _Items[index]; set => _Items[index] = value; } | ||||||
|         { |  | ||||||
|             return null; |  | ||||||
|         } |  | ||||||
| 
 | 
 | ||||||
|         public int IndexOf(Item item) |                 public IEnumerator<Item> GetEnumerator() | ||||||
|         { |                 { | ||||||
|             return _Items.IndexOf(item); |                     return _Items?.GetEnumerator(); | ||||||
|         } |                 } | ||||||
| 
 | 
 | ||||||
|         public void Insert(int index, Item item) |                 IEnumerator IEnumerable.GetEnumerator() | ||||||
|         { |                 { | ||||||
|             _Items.Insert(index, item); |                     return _Items?.GetEnumerator(); | ||||||
|         } |                 } | ||||||
| 
 | 
 | ||||||
|         public void RemoveAt(int index) |                 public virtual FilterViewModel GetNewFilterViewModel() | ||||||
|         { |                 { | ||||||
|             _Items.RemoveAt(index); |                     return null; | ||||||
|         } |                 } | ||||||
| 
 | 
 | ||||||
|         public void Add(Item item) |                 public int IndexOf(Item item) | ||||||
|         { |                 { | ||||||
|             _Items.Add(item); |                     return _Items.IndexOf(item); | ||||||
|         } |                 } | ||||||
| 
 | 
 | ||||||
|         public void Clear() |                 public void Insert(int index, Item item) | ||||||
|         { |                 { | ||||||
|             _Items.Clear(); |                     _Items.Insert(index, item); | ||||||
|         } |                 } | ||||||
| 
 | 
 | ||||||
|         public bool Contains(Item item) |                 public void RemoveAt(int index) | ||||||
|         { |                 { | ||||||
|             return _Items.Contains(item); |                     _Items.RemoveAt(index); | ||||||
|         } |                 } | ||||||
| 
 | 
 | ||||||
|         public void CopyTo(Item[] array, int arrayIndex) |                 public void Add(Item item) | ||||||
|         { |                 { | ||||||
|             _Items.CopyTo(array, arrayIndex); |                     _Items.Add(item); | ||||||
|         } |                 } | ||||||
| 
 | 
 | ||||||
|         public bool Remove(Item item) |                 public void Clear() | ||||||
|         { |                 { | ||||||
|             throw new NotImplementedException(); |                     _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