te
This commit is contained in:
parent
01151e679b
commit
57b2f0400e
265 changed files with 22828 additions and 6 deletions
33
Unused/Decal.Adapter.Wrappers/IndexedCollection.cs
Normal file
33
Unused/Decal.Adapter.Wrappers/IndexedCollection.cs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Decal.Adapter.Wrappers;
|
||||
|
||||
public sealed class IndexedCollection<InternalIndexType, IndexType, RType> : MarshalByRefObject, IEnumerable<RType>, IEnumerable where InternalIndexType : struct, IConvertible where IndexType : struct, IConvertible
|
||||
{
|
||||
private InternalIndexType myDataType;
|
||||
|
||||
private IIndexedProvider<InternalIndexType> myWrap;
|
||||
|
||||
public RType this[IndexType index] => (RType)myWrap.GetIndexedObject(myDataType, index.ToInt32(CultureInfo.InvariantCulture));
|
||||
|
||||
public int Count => myWrap.Count(myDataType);
|
||||
|
||||
internal IndexedCollection(IIndexedProvider<InternalIndexType> wrap, InternalIndexType data)
|
||||
{
|
||||
myDataType = data;
|
||||
myWrap = wrap;
|
||||
}
|
||||
|
||||
IEnumerator<RType> IEnumerable<RType>.GetEnumerator()
|
||||
{
|
||||
return (IEnumerator<RType>)myWrap.GetEnumerator(myDataType);
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return myWrap.GetEnumerator(myDataType);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue