public void Reset()
        {
            int hr = _enumVariantObject.Reset();

            if (hr < 0)
            {
                Marshal.ThrowExceptionForHR(hr);
            }
        }
 void IEnumerator.Reset()
 {
     if (!IsWrappingNullReference)
     {
         int hr = _enumeratorRCW.Reset();
         if (hr < 0)
         {
             throw Marshal.GetExceptionForHR(hr);
         }
     }
 }
        public void Reset()
        {
            int hr = _enumVariantObject.Reset();

            if (hr < 0)
            {
                Marshal.ThrowExceptionForHR(hr);
            }

            _fetchedLastObject = false;
            _current           = null;
        }
Example #4
0
        public static IEnumerable <T> ToEnumerable <T>(this IEnumVARIANT enumVariant, int count)
        {
            enumVariant.Reset();

            var buffer = new object[count];
            var bufferLengthPointer = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(int)));

            enumVariant.Next(buffer.Length, buffer, bufferLengthPointer);
            var bufferLength = Marshal.ReadInt32(bufferLengthPointer);

            Marshal.FreeCoTaskMem(bufferLengthPointer);

            for (var i = 0; i < Math.Min(bufferLength, count); i++)
            {
                yield return((T)buffer[i]);
            }
        }
 public void Reset()
 {
     enumVariant.Reset();
 }
 public void Reset ()
 {
     com_enum.Reset ();
 }