OSDN Git Service

初コミット
[fooeditengine/FooEditEngine.git] / Common / CollectionDebugView.cs
1 /*
2  * Copyright (C) 2013 FooProject
3  * * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
5
6  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 
7  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
8
9 You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
10  */
11 #region Using Directives
12
13 using System;
14 using System.Collections.Generic;
15 using System.Text;
16 using System.Diagnostics;
17
18 #endregion Using Directives
19
20
21 namespace Slusser.Collections.Generic
22 {
23         internal sealed class CollectionDebugView<T>
24         {
25                 #region Fields
26
27                 private ICollection<T> _collection;
28
29                 #endregion Fields
30
31
32                 #region Constructors
33
34                 public CollectionDebugView(ICollection<T> collection)
35                 {
36                         if (collection == null)
37                                 throw new ArgumentNullException("collection");
38
39                         this._collection = collection;
40                 }
41
42                 #endregion Constructors
43
44
45                 #region Properties
46
47                 [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
48                 public T[] Items
49                 {
50                         get
51                         {
52                                 T[] array = new T[this._collection.Count];
53                                 this._collection.CopyTo(array, 0);
54                                 return array;
55                         }
56                 }
57
58                 #endregion Properties
59         }
60 }