Пример #1
0
            private static New <SlotRankingEnumerator> BindConstructorArguments(SlotRanking slotRanking)
            {
                return(new New <SlotRankingEnumerator>(() =>
                {
                    IntPtr result = CreateSlotEnumeratorAdapter(slotRanking.DangerousGetHandle());

                    GC.KeepAlive(slotRanking); // Extend the lifetime of this handle because the delegate (and its data) is not stored on the heap.
                    return result;
                }));
            }
Пример #2
0
 public SlotRankingEnumerator(SlotRanking slotRanking) : base(BindConstructorArguments(slotRanking), new Delete <SlotRankingEnumerator>(DeleteSlotEnumeratorAdapter))
 {
 }