/// <summary> /// Initializes this PersistentGenericList from the cached values. /// </summary> /// <param name="persister">The CollectionPersister to use to reassemble the PersistentGenericList.</param> /// <param name="disassembled">The disassembled PersistentList.</param> /// <param name="owner">The owner object.</param> /// <param name="cancellationToken">A cancellation token that can be used to cancel the work</param> public override async Task InitializeFromCacheAsync(ICollectionPersister persister, object disassembled, object owner, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); object[] array = (object[])disassembled; int size = array.Length; BeforeInitialize(persister, size); for (int i = 0; i < size; i++) { var element = await(persister.ElementType.AssembleAsync(array[i], Session, owner, cancellationToken)).ConfigureAwait(false); WrappedList.Add((T)(element ?? DefaultForType)); } }
public ScanlineTexture(List <Vertex> vertices, byte[] pixels, byte[] texture, int tWidth, int tHeight) { Pixels = pixels; Texture = texture; textureHeight = tHeight; textureWidth = tWidth; polygonVertices = new WrappedList(vertices); List <Vertex> temp = vertices.OrderBy(v => v.Projected.Y).ToList(); this.sortedIndices = new List <int>(); foreach (Vertex v in temp) { sortedIndices.Add(vertices.IndexOf(v)); } }
public override async Task <object> ReadFromAsync(DbDataReader rs, ICollectionPersister role, ICollectionAliases descriptor, object owner, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); var element = (T)await(role.ReadElementAsync(rs, owner, descriptor.SuffixedElementAliases, Session, cancellationToken)).ConfigureAwait(false); int index = (int)await(role.ReadIndexAsync(rs, descriptor.SuffixedIndexAliases, Session, cancellationToken)).ConfigureAwait(false); //pad with nulls from the current last element up to the new index for (int i = WrappedList.Count; i <= index; i++) { WrappedList.Insert(i, DefaultForType); } WrappedList[index] = element; return(element); }
internal LivePage(int initialGroupDepth, ParentedLogEntry[] entries, MultiFileReader r, int pageLength) { Debug.Assert(pageLength == entries.Length || entries.Length == 0); _r = r; _pageLength = pageLength; _currentPath = new List <ParentedLogEntry>(); ParentedLogEntry e = null; for (int i = 0; i < initialGroupDepth; ++i) { ParentedLogEntry g = new ParentedLogEntry(e, LogEntry.CreateMissingOpenGroup(DateTimeStamp.Unknown)); _currentPath.Add(g); e = g; } _entries = new WrappedList(entries); if (_r != null) { _entries.FillPage(_r, _currentPath); } }
IQueryable GetQueryable() { return(queryable ?? (queryable = WasInitialized ? WrappedList.AsQueryable() : this.Query(Session))); }
private WrappedListTestArgs <T> CreateWrappedArrayTestArgs <T>(params T[] items) { WrappedList <T> wrappedList = new WrappedList <T>(items); return(new WrappedListTestArgs <T>(wrappedList, items)); }
public WrappedListTestArgs(WrappedList <T> hive, IEnumerable <T> expectedItems) : base(hive, expectedItems) { }
public static partial int SumStringLengths([MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionDepth = 1)] WrappedList <string> strArray);
public void ByValueCollectionWithNonBlittableElements_WithDefaultMarshalling() { var strings = new WrappedList <string>(GetStringList()); Assert.Equal(strings.Wrapped.Sum(str => str?.Length ?? 0), NativeExportsNE.Collections.SumStringLengths(strings)); }
public int IndexOfKey(object key) { return(WrappedList.IndexOfKey((TKey)key)); }
IEnumerator <T> IEnumerable <T> .GetEnumerator() { return(WrappedList.GetEnumerator()); }
public bool SetEquals(IEnumerable <T> other) { return(WrappedList.SetEquals(other)); }
/// <summary> /// Returns an enumerator that iterates through the collection. /// </summary> /// <returns> /// A <see cref="IEnumerator{T}"/> that can be used to iterate /// through the collection. /// </returns> /// <filterpriority>1</filterpriority> public override IEnumerator <T> GetEnumerator() { return(WrappedList.GetEnumerator()); }
public bool Overlaps(IEnumerable <T> other) { return(WrappedList.Overlaps(other)); }
public bool IsSupersetOf(IEnumerable <T> other) { return(WrappedList.IsSupersetOf(other)); }
public bool IsProperSubsetOf(IEnumerable <T> other) { return(WrappedList.IsProperSubsetOf(other)); }
public override IEnumerable <RowItem> ListRowItems() { return(WrappedList.DeepClone().Select(item => new RowItem(item))); }
public object GetKey(object item) { return(WrappedList.GetKey((TItem)item)); }
///<summary> /// Gets an enumerator for the list. ///</summary> ///<returns>Enumerator for the list.</returns> public RawList <T> .Enumerator GetEnumerator() { return(WrappedList.GetEnumerator()); }
public int IndexOf(T item) { return(WrappedList.IndexOf(item)); }
IEnumerator IEnumerable.GetEnumerator() { return(WrappedList.GetEnumerator()); }
public IEnumerable DeepClone() { return(WrappedList.DeepClone()); }